From b6385f8b8c53a9473bb9585dee9e006677dcc9de Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 26 Aug 2016 16:28:07 +0100 Subject: [PATCH 001/140] Add basic SYSTEM.ADRINT type. --- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +-- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 18 +++++----- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 ++++++++--------- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 4 +-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 ++--- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 6 ++-- bootstrap/unix-44/OPT.h | 4 +-- bootstrap/unix-44/OPV.c | 7 ++-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 20 +++++------ bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 14 ++++---- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 12 +++---- bootstrap/unix-44/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 3 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +-- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 18 +++++----- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 ++++++++--------- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 4 +-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 ++--- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 6 ++-- bootstrap/unix-48/OPT.h | 4 +-- bootstrap/unix-48/OPV.c | 7 ++-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 20 +++++------ bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 14 ++++---- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 12 +++---- bootstrap/unix-48/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 3 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +-- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 18 +++++----- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 32 ++++++++--------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 4 +-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 6 ++-- bootstrap/unix-88/OPT.h | 4 +-- bootstrap/unix-88/OPV.c | 7 ++-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 20 +++++------ bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 14 ++++---- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 12 +++---- bootstrap/unix-88/SYSTEM.h | 39 ++++++++++---------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 3 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +-- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 18 +++++----- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 ++++++++--------- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 4 +-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 ++--- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 6 ++-- bootstrap/windows-48/OPT.h | 4 +-- bootstrap/windows-48/OPV.c | 7 ++-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 54 ++++++++++++++-------------- bootstrap/windows-48/Platform.h | 6 ++-- bootstrap/windows-48/Reals.c | 14 ++++---- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 12 +++---- bootstrap/windows-48/SYSTEM.h | 39 ++++++++++---------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 3 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +-- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 18 +++++----- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 32 ++++++++--------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 4 +-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 6 ++-- bootstrap/windows-88/OPT.h | 4 +-- bootstrap/windows-88/OPV.c | 7 ++-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 54 ++++++++++++++-------------- bootstrap/windows-88/Platform.h | 6 ++-- bootstrap/windows-88/Reals.c | 14 ++++---- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 12 +++---- bootstrap/windows-88/SYSTEM.h | 39 ++++++++++---------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 3 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 1 + src/compiler/OPT.Mod | 2 ++ src/compiler/OPV.Mod | 5 +-- src/compiler/Vishap.Mod | 1 + src/system/Heap.Mod | 2 +- src/system/Platformunix.Mod | 10 +++--- src/system/Platformwindows.Mod | 44 +++++++++++------------ src/system/SYSTEM.c | 12 +++---- src/system/SYSTEM.h | 39 ++++++++++---------- 214 files changed, 680 insertions(+), 649 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f9161937..cc4cc8bd 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5a1dd875..496a4a87 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a4a4ea8c..bc1d11eb 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 74c43788..6326549f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index dd5ce434..77a9b68f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9ab3b430..52012a3c 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 777a6c22..9a5617f1 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f9161937..cc4cc8bd 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5a1dd875..496a4a87 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a4a4ea8c..bc1d11eb 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 74c43788..6326549f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -138,13 +138,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -161,7 +161,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index dd5ce434..77a9b68f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index cfe34ca7..f7a3fdd3 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 632b644a..d178499a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 47f1ffc7..8539a1e2 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index ba0bbd99..b091f1f7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b39e6cf3..6cd166ef 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 4606384c..a0813c94 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1b144711..86914f24 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 62487a35..8bcec40e 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9873a734..d3529141 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b1ff5968..7827d119 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0c836ead..e006bde8 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6e6ded2e..9a0517b5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f4bdb1a8..cb07c606 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index af419f75..f2056569 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index bb9b75e6..7e9ddb90 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 37a86252..aa92d405 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 50047c9e..3bc1b6d2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1706f8f1..f11b56ba 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index be7c13b5..3a345c1f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 0b3b1b2c..c0c9c3dd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index cc04e014..1f9f2a46 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 32148c49..4b760b22 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a0d41c71..daf5051d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1719,6 +1719,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1795,6 +1796,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index ab2c4684..550ea673 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ae14f629..fe8d848a 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -932,7 +933,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -948,7 +949,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 4eba5b89..b0551679 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c1a0ea9e..7ecd9794 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -119,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address) +#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len); + *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 49702e6d..832aaa35 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8b61d8cd..660cd605 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index ff21c192..3102ce18 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 20a14540..2df49d25 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d64d3478..9505fe03 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a1fb81c0..0e0b4725 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index bca5665d..3086fb00 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 6eda4f2c..7e1eba78 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,6 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 48246ffa..8489752b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9081238a..a5af5a7d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4005b0a6..fce52835 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6ac1ab91..9e5aed51 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a9110e8a..0e0401e3 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 801bc8f9..eb6374ea 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 821dff97..b0d48f0a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ec5e865a..38a63260 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index ebd86b8d..52a0ced0 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 5fdd4e4d..2c462da9 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1f3a8e9c..966fb2ca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 868f24df..7e437f34 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 30ec687a..cca2fc74 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 8, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a2cab30c..d05f688c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 330b7506..d76a50a2 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ac8ac89e..78c8d49e 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0f614e6a..60b37750 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d1c88266..e7a96131 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 3abccc9a..fce9997f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b7d34a07..7aea7283 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index bf683e41..88c3bd4d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index ed914bff..3c2be746 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 01d2144d..a0c19958 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index bf56b7d7..6c24817c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index cacf9256..85c8b275 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e901bcfc..313c0ac7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index b32d0ebd..4b76312b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1718,6 +1718,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1794,6 +1795,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 41b3e7ec..7187f687 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cf646f5e..8b98e5f9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -284,6 +284,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -931,7 +932,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -947,7 +948,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 04828b2f..122fda4a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4e8b44c8..6204567c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -111,9 +111,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +121,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +173,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 673b2b0b..b4e3ecf5 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -78,7 +78,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2323e34d..11c99924 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7e6b534c..b0497a9c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 115456ea..15aeff29 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 96dbb01d..385096bc 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index cfe34ca7..f7a3fdd3 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 632b644a..d178499a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 4c9e3b45..0feff79c 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,6 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 68e433df..59b8db27 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 41d399ad..6ae0cd7a 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 4efd107a..2ef65e7b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fc4f0da1..39837586 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index d77b0b84..e0edabd9 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 4af04d6e..413ae867 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 47f1ffc7..8539a1e2 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index ba0bbd99..b091f1f7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 5a9998a9..e0344732 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 4606384c..a0813c94 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c46ffdd2..db7f4cd9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size); + error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min); + __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n); + error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len); + __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; LONGINT res; - f = (Files_File)(SYSTEM_ADDRESS)o; + f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index eb946544..12178ad1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9873a734..d3529141 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern LONGINT Platform_OSAllocate(LONGINT size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer))) +#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, ((LONGINT)(20))); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) __PUT(adr + 16, 0, LONGINT); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8); + _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz); - tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24; + new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADDRESS)&frame; + sp = (LONGINT)(SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align; + inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) LONGINT cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules; + m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADDRESS)obj; + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b1ff5968..7827d119 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0c836ead..e006bde8 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6e6ded2e..9a0517b5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f4bdb1a8..cb07c606 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index af419f75..f2056569 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index bb9b75e6..7e9ddb90 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 37a86252..aa92d405 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 50047c9e..3bc1b6d2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1706f8f1..f11b56ba 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index be7c13b5..3a345c1f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 0b3b1b2c..c0c9c3dd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index cc04e014..1f9f2a46 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 32148c49..4b760b22 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a0d41c71..daf5051d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1719,6 +1719,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_ainttyp); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1795,6 +1796,7 @@ export void *OPT__init(void) OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index ab2c4684..550ea673 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ae14f629..fe8d848a 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_ainttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; @@ -932,7 +933,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26); + OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -948,7 +949,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); } OPV_expr(l, exprPrec); } else { diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 4eba5b89..b0551679 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4281164c..875aa4b4 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -112,9 +112,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INTEGER e) { @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr; + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector; + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); } } @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len, &*n); + result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN); + __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 374b6842..1c350cbf 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -79,7 +79,7 @@ import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADDRESS)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADDRESS)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8b61d8cd..660cd605 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER); + __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index ff21c192..3102ce18 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 6377745e..35620b9b 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 20a14540..2df49d25 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d64d3478..9505fe03 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a1fb81c0..0e0b4725 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index bca5665d..3086fb00 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 6eda4f2c..7e1eba78 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,6 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_LIntSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 48246ffa..8489752b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9081238a..a5af5a7d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4005b0a6..fce52835 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6ac1ab91..9e5aed51 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a9110e8a..0e0401e3 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 801bc8f9..eb6374ea 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 1076a289..849c04e9 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -127,6 +127,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) + OR (obj = OPT.ainttyp^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index fb77b0ea..62a0d4b7 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,6 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, + ainttyp*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1148,6 +1149,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7a59c1d3..529c1aa9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,6 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; @@ -555,7 +556,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADDRESS)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADRINT)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -568,7 +569,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(SYSTEM_ADDRESS)") + OPM.WriteString("(SYSTEM_ADRINT)") END; expr(l, exprPrec) ELSE diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 63cc4260..216533a1 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,6 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; + OPT.ainttyp.size := OPM.LIntSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 6395c0a7..5acbb04e 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -186,7 +186,7 @@ MODULE Heap; correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))"; + PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 1c2da65d..a55e1130 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -106,10 +106,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADDRESS)address)"; +PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADRINT)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADDRESS)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADRINT)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; +"read(fd, (void*)(SYSTEM_ADRINT)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(SYSTEM_ADDRESS)(p), l)"; +"write(fd, (void*)(SYSTEM_ADRINT)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index a97d7da9..cfd080be 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -104,10 +104,10 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADDRESS)address)"; +PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)"; PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADDRESS)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADDRESS)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADRINT)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADRINT)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADDRESS)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADDRESS)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADDRESS)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -413,7 +413,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; @@ -434,7 +434,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADDRESS)fd, (void*)(SYSTEM_ADDRESS)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADDRESS)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADDRESS)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -589,9 +589,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 33511a70..1077d3ce 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr)))); + P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[-1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADDRESS)x[- 1]; + p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADDRESS h) { + void SystemSetHandler(int s, SYSTEM_ADRINT h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADDRESS h) { + void SystemSetInterruptHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADDRESS h) { + void SystemSetQuitHandler(SYSTEM_ADRINT h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6377745e..35620b9b 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -26,11 +26,12 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADDRESS size_t +#define SYSTEM_ADRINT size_t +#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size); +void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); @@ -107,10 +108,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADDRESS h); + extern void SystemSetHandler(int s, SYSTEM_ADRINT h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h); - extern void SystemSetQuitHandler (SYSTEM_ADDRESS h); + extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); + extern void SystemSetQuitHandler (SYSTEM_ADRINT h); #endif @@ -133,9 +134,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x) +#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) @@ -145,8 +146,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x +#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) +#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x #define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) @@ -161,7 +162,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) #define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) @@ -222,7 +223,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -243,7 +244,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -274,20 +275,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \ + t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ + t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist From 7df022d94ec3fc4d3b66582fe8c97523b556da9e Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 26 Aug 2016 18:59:50 +0100 Subject: [PATCH 002/140] Add SYSTEM types INT8 through INT64. Define LINT as derived type of SYSTEM.INT64. --- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 ++ bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 ++ bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 ++ bootstrap/unix-88/Vishap.c | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 ++ bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPT.c | 89 ++++++++++++++++++++++------------- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 ++ bootstrap/windows-88/Vishap.c | 2 +- src/compiler/OPC.Mod | 4 ++ src/compiler/OPT.Mod | 31 +++++++++--- src/compiler/OPV.Mod | 4 ++ src/compiler/Vishap.Mod | 2 +- 29 files changed, 344 insertions(+), 192 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 7e9ddb90..0813dca9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index daf5051d..20234e22 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -84,7 +84,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -106,6 +107,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -466,21 +468,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -490,53 +492,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -546,11 +548,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -587,11 +589,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -601,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1698,6 +1700,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1720,6 +1731,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1727,6 +1742,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1790,13 +1806,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1820,6 +1840,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 550ea673..f1865573 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index fe8d848a..638891f1 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -286,6 +286,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7e1eba78..a487fe66 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fce9997f..02a24b4d 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -211,7 +211,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4b76312b..cbd147e6 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -83,7 +83,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -105,6 +106,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -465,21 +467,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -489,53 +491,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -545,11 +547,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -586,11 +588,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -600,7 +602,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1697,6 +1699,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1719,6 +1730,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1726,6 +1741,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1789,13 +1805,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1819,6 +1839,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 7187f687..c4975398 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8b98e5f9..2172dee5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -285,6 +285,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 0feff79c..66a97f5d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 7e9ddb90..0813dca9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -212,7 +212,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); } OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index daf5051d..20234e22 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -84,7 +84,8 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -106,6 +107,7 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -466,21 +468,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { LONGINT *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -490,53 +492,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -546,11 +548,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -587,11 +589,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -601,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1698,6 +1700,15 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } +static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) +{ + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &*obj); + (*obj)->mode = 5; + (*obj)->typ = typ; +} + static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1720,6 +1731,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_ainttyp); + P(OPT_int8typ); + P(OPT_int16typ); + P(OPT_int32typ); + P(OPT_int64typ); P(OPT_realtyp); P(OPT_lrltyp); P(OPT_settyp); @@ -1727,6 +1742,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -1790,13 +1806,17 @@ export void *OPT__init(void) OPT_OpenScope(0, NIL); OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); + OPT_undftyp->BaseTyp = OPT_undftyp; OPT_InitStruct(&OPT_notyp, 12); OPT_InitStruct(&OPT_stringtyp, 10); OPT_InitStruct(&OPT_niltyp, 11); - OPT_undftyp->BaseTyp = OPT_undftyp; OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1820,6 +1840,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 550ea673..f1865573 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import SHORTINT OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index fe8d848a..638891f1 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -286,6 +286,10 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; + OPT_int8typ->strobj->linkadr = 2; + OPT_int16typ->strobj->linkadr = 2; + OPT_int32typ->strobj->linkadr = 2; + OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7e1eba78..a487fe66 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_LIntSize; + OPT_ainttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 849c04e9..b8244fd3 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -128,6 +128,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.ainttyp^.strobj) + OR (obj = OPT.int8typ^.strobj) + OR (obj = OPT.int16typ^.strobj) + OR (obj = OPT.int32typ^.strobj) + OR (obj = OPT.int64typ^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 62a0d4b7..cf4c39ac 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -156,9 +156,12 @@ VAR bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, ainttyp*, + int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + LIntObj: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) @@ -1135,6 +1138,13 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterDerivedType(name: OPS.Name; typ: Struct; VAR obj: Object); + BEGIN + Insert(name, obj); + obj.mode := Typ; + obj.typ := typ; + END EnterDerivedType; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1142,14 +1152,19 @@ END Import; END EnterProc; BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; - InitStruct(undftyp, Undef); InitStruct(notyp, NoTyp); - InitStruct(stringtyp, String); InitStruct(niltyp, NilTyp); - undftyp^.BaseTyp := undftyp; + InitStruct(undftyp, Undef); undftyp^.BaseTyp := undftyp; + InitStruct(notyp, NoTyp); + InitStruct(stringtyp, String); + InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); + EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1174,6 +1189,10 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); + (* Create LINT type as TYPE LINT = SYSTEM.INT64 *) + EnterDerivedType("LINT", int64typ, LIntObj); + + EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 529c1aa9..7518f811 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -206,6 +206,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; OPT.ainttyp^.strobj^.linkadr := PredefinedType; + OPT.int8typ^.strobj^.linkadr := PredefinedType; + OPT.int16typ^.strobj^.linkadr := PredefinedType; + OPT.int32typ^.strobj^.linkadr := PredefinedType; + OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 216533a1..25f0aa59 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.ainttyp.size := OPM.LIntSize; + OPT.ainttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize; From 5033d09f3216b6211ac26cbd3d34f2581abd445b Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 27 Aug 2016 18:49:52 +0100 Subject: [PATCH 003/140] Record constant size in symbol tables, make full is now successful. --- src/compiler/OPB.Mod | 52 ++++++++---------------------- src/compiler/OPM.cmdln.Mod | 8 +++++ src/compiler/OPP.Mod | 12 +++---- src/compiler/OPT.Mod | 65 ++++++++++++++++++++++++++++---------- src/compiler/Vishap.Mod | 8 +++-- src/system/SYSTEM.h | 17 ++++++---- 6 files changed, 92 insertions(+), 70 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 6da12c5e..cfb983b5 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -105,41 +105,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.conval := OPT.NewConst(); x^.conval^.setval := {}; RETURN x END EmptySet; - - (* Integer size support *) - - PROCEDURE SignedByteSize(n: LONGINT): INTEGER; - (* Returns number of bytes required to represent signed value n *) - VAR b: INTEGER; - BEGIN - IF n < 0 THEN n := -(n+1) END; (* Positive value in the range 0 - 7F.. *) - b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; - RETURN b - END SignedByteSize; - - PROCEDURE ShorterSize(i: LONGINT): LONGINT; - BEGIN IF i >= OPM.LIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.SIntSize END - END ShorterSize; - - PROCEDURE LongerSize(i: LONGINT): LONGINT; - BEGIN IF i <= OPM.SIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.LIntSize END - END LongerSize; - - PROCEDURE IntType(size: LONGINT): OPT.Struct; - (* Selects smallest standard integer type for given size in bytes *) - VAR result: OPT.Struct; - BEGIN - IF size <= OPT.sinttyp.size THEN result := OPT.sinttyp - ELSIF size <= OPT.inttyp.size THEN result := OPT.inttyp - ELSE - result := OPT.linttyp - END; - IF size > OPT.linttyp.size THEN err(203) END; (* Number too large *) - RETURN result - END IntType; - PROCEDURE SetIntType(node: OPT.Node); - BEGIN node.typ := IntType(SignedByteSize(node.conval.intval)) + VAR b: INTEGER; n: LONGINT; + BEGIN + (* Determine number of bytes required to represent constant value *) + IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; + b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; + node.typ := OPT.IntType(b) END SetIntType; PROCEDURE NewIntConst*(intval: LONGINT): OPT.Node; @@ -494,7 +466,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.SInt, OPT.Int, OPT.LInt: IF g IN OPT.intSet THEN - IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := IntType(x.typ.size) END + IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ @@ -633,7 +605,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF f IN OPT.intSet THEN IF g IN OPT.intSet THEN IF f > g THEN SetIntType(x); - IF x^.typ^.form > g THEN err(203); x^.conval^.intval := 1 END + IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END ELSIF g IN OPT.realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc ELSE (*g = OPT.Char*) k := x^.conval^.intval; @@ -1034,13 +1006,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (x.typ.size > OPM.SIntSize) THEN Convert(x, IntType(ShorterSize(x.typ.size))) + ELSIF f IN OPT.intSet THEN + typ := OPT.NextType(x.typ, -1); + IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) ELSE err(111) END |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (x.typ.size < OPM.LIntSize) THEN Convert(x, IntType(LongerSize(x.typ.size))) + ELSIF f IN OPT.intSet THEN + typ := OPT.NextType(x.typ, 1); + IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) ELSIF f = OPT.Char THEN Convert(x, OPT.linttyp) ELSE err(111) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 74c0f5dc..d7cb5c29 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -565,6 +565,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END AlignSize; *) + + + + (* Integer size support *) + PROCEDURE SignedMaximum*(bytecount: LONGINT): LONGINT; VAR result: LONGINT; BEGIN @@ -580,6 +585,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) + + + PROCEDURE GetProperties(); (* VAR base: LONGINT; *) BEGIN diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 56f2a3d0..4e53ad05 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -665,16 +665,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ProcedureDeclaration; - PROCEDURE CaseLabelList(VAR lab: OPT.Node; LabelForm: INTEGER; VAR n: INTEGER; VAR tab: CaseTable); + PROCEDURE CaseLabelList(VAR lab: OPT.Node; LabelTyp: OPT.Struct; VAR n: INTEGER; VAR tab: CaseTable); VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 - END ; + END; IF f IN OPT.intSet THEN - IF LabelForm < f THEN err(60) END - ELSIF LabelForm # f THEN err(60) + IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END + ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; @@ -719,7 +719,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP IF sym < OPS.bar THEN - CaseLabelList(lab, x^.typ^.form, n, tab); + CaseLabelList(lab, x^.typ, n, tab); CheckSym(OPS.colon); StatSeq(y); OPB.Construct(OPT.Ncasedo, lab, y); OPB.Link(cases, lastcase, lab) END ; @@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF (y^.typ^.form < OPT.SInt) OR (y^.typ^.form > x^.left^.typ^.form) THEN err(113) + ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113) END ; OPB.Link(stat, last, x); IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cf4c39ac..65f51dd2 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -160,14 +160,14 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; - LIntObj: Object; - nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; + NextSize: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST @@ -206,10 +206,37 @@ VAR extsf, sfpresent: BOOLEAN; symExtended, symNew: BOOLEAN; + + + PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; +PROCEDURE IntType*(size: LONGINT): Struct; +(* Selects smallest standard integer type for given size in bytes *) + VAR i: INTEGER; +BEGIN + i := 1; WHILE (NextSize[i].size < size) & (NextSize[i+1] # NIL) DO INC(i) END; + RETURN NextSize[i]; +END IntType; + +PROCEDURE NextType*(x: Struct; dir: INTEGER): Struct; + VAR i: INTEGER; +BEGIN + ASSERT(x.form IN intSet); + ASSERT((dir = 1) OR (dir = -1)); + (* Not sure if StPar0 (which calls this) always gets the baseiest type. This + ASSERT will tell me. *) + ASSERT(x.BaseTyp = undftyp); + WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; + i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; + ASSERT(i < LEN(NextSize)-1); + RETURN NextSize[i+dir] +END NextType; + + + PROCEDURE NewConst*(): Const; VAR const: Const; BEGIN NEW(const); RETURN const @@ -812,7 +839,12 @@ BEGIN ELSE obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; IF tag <= Pointer THEN (* Constant *) - obj^.mode := Con; obj^.typ := impCtxt.ref[tag]; obj^.conval := NewConst(); InConstant(tag, obj^.conval) + obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); + IF tag IN intSet THEN + obj.typ := IntType(OPM.SymRInt()) + ELSE + obj^.typ := impCtxt.ref[tag]; + END ELSIF tag >= Sxpro THEN obj^.conval := NewConst(); obj^.conval^.intval := -1; @@ -1033,7 +1065,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval) + LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1138,13 +1170,6 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; - PROCEDURE EnterDerivedType(name: OPS.Name; typ: Struct; VAR obj: Object); - BEGIN - Insert(name, obj); - obj.mode := Typ; - obj.typ := typ; - END EnterDerivedType; - PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1160,7 +1185,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.LIntSize, ainttyp); + EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); @@ -1189,10 +1214,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); - (* Create LINT type as TYPE LINT = SYSTEM.INT64 *) - EnterDerivedType("LINT", int64typ, LIntObj); - - EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1231,7 +1252,17 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[String] := stringtyp; impCtxt.ref[NilTyp] := niltyp; impCtxt.ref[NoTyp] := notyp; - impCtxt.ref[Pointer] := sysptrtyp + impCtxt.ref[Pointer] := sysptrtyp; + + NextSize[1] := sinttyp; + NextSize[2] := inttyp; + NextSize[3] := linttyp; + + NextSize[5] := int8typ; + NextSize[6] := int16typ; + NextSize[7] := int32typ; + NextSize[8] := int64typ + END OPT. Objects: diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 25f0aa59..6d306e5e 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -6,7 +6,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPV, OPC, OPM, extTools, Strings, vt100; - VAR mname : ARRAY 256 OF CHAR; (* noch *) + VAR mname: ARRAY 256 OF CHAR; (* noch *) PROCEDURE Module*(VAR done: BOOLEAN); @@ -61,7 +61,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.ainttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize; + OPT.booltyp.size := OPM.BoolSize END PropagateElementaryTypeSizes; @@ -129,5 +129,7 @@ BEGIN Platform.SetInterruptHandler(Trap); Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); - OPB.typSize := OPV.TypSize; OPT.typSize := OPV.TypSize; Translate + OPB.typSize := OPV.TypSize; + OPT.typSize := OPV.TypSize; + Translate END Vishap. diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 35620b9b..216af910 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod From 7d7579a36d5100945d7ff646522831749d73612a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 29 Aug 2016 17:47:54 +0100 Subject: [PATCH 004/140] Remove unused AlignSize proc, and clean sym files before compiler build. --- src/compiler/OPM.cmdln.Mod | 18 ------------------ src/tools/make/vishap.make | 1 + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index d7cb5c29..07b5b89f 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -548,24 +548,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END VerboseListSizes; - (* - PROCEDURE AlignSize*(size: LONGINT): INTEGER; - VAR align: INTEGER; - BEGIN - IF size < Alignment THEN - IF size > 8 THEN align := 16 - ELSIF size > 4 THEN align := 8 - ELSIF size > 2 THEN align := 4 - ELSE align := SHORT(size) - END - ELSE - align := Alignment - END; - RETURN align - END AlignSize; - *) - - (* Integer size support *) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 17bb1b95..838b5ef7 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -96,6 +96,7 @@ translate: @printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ALIGNMENT: %s\n" $(ALIGNMENT) @mkdir -p $(BUILDDIR) + @rm -f $(BUILDDIR)/*.sym cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../Configuration.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Platform$(PLATFORM).Mod From a33e38cf6c1a018696413480eebe8ae5eaf0911e Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 29 Aug 2016 18:34:46 +0100 Subject: [PATCH 005/140] Add OutSize and InTyp procedures for integer symbol handling. --- src/compiler/OPT.Mod | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 65f51dd2..e1b33ac3 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -229,7 +229,9 @@ BEGIN (* Not sure if StPar0 (which calls this) always gets the baseiest type. This ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); + (* WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; + *) i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; ASSERT(i < LEN(NextSize)-1); RETURN NextSize[i+dir] @@ -701,6 +703,26 @@ BEGIN RETURN obj END InTProc; + +PROCEDURE InTyp(tag: LONGINT): Struct; + VAR size: LONGINT; +BEGIN + IF tag IN intSet THEN + size := OPM.SymRInt(); + (* + IF size = 123456789 THEN (* Expected magic number while testing *) + size := OPM.SymRInt(); + ELSE + OPM.LogWLn; OPM.LogWStr("Missing constant magic number. size = "); OPM.LogWNum(size,1); + END; + *) + RETURN IntType(size) + ELSE + RETURN impCtxt.ref[tag] + END +END InTyp; + + PROCEDURE InStruct(VAR typ: Struct); VAR mno: SHORTINT; ref: INTEGER; tag: LONGINT; name: OPS.Name; t: Struct; obj, last, fld, old, dummy: Object; @@ -781,7 +803,7 @@ BEGIN ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END; IF ref = impCtxt.minr THEN - WHILE (ref < impCtxt.nofr) (*OR ((ref >= Int8) & (ref <= Int64))*) DO + WHILE (ref < impCtxt.nofr) DO t := impCtxt.ref[ref]; FPrintStr(t); obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) IF obj^.name # "" THEN FPrintObj(obj) END; @@ -840,11 +862,7 @@ BEGIN obj := NewObj(); obj^.mnolev := -mno; obj^.vis := external; IF tag <= Pointer THEN (* Constant *) obj^.mode := Con; obj^.conval := NewConst(); InConstant(tag, obj^.conval); - IF tag IN intSet THEN - obj.typ := IntType(OPM.SymRInt()) - ELSE - obj^.typ := impCtxt.ref[tag]; - END + obj^.typ := InTyp(tag) ELSIF tag >= Sxpro THEN obj^.conval := NewConst(); obj^.conval^.intval := -1; @@ -1015,10 +1033,18 @@ END Import; END END OutTProcs; + + PROCEDURE OutSize(size: LONGINT); + BEGIN + (* OPM.SymWInt(123456789); *) + OPM.SymWInt(size) + END OutSize; + + PROCEDURE OutStr(typ: Struct); (* OPV.TypeAlloc already applied *) VAR strobj: Object; BEGIN - IF (typ^.ref < expCtxt.ref) (*OR (typ^.ref >= Int8) & (typ^.ref <= Int64)*) THEN OPM.SymWInt(-typ^.ref) + IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1065,7 +1091,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) + LInt: OPM.SymWInt(obj^.conval^.intval); OutSize(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) From b3c71fb2f0b78403b72ae499125cc348b4456250 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 30 Aug 2016 19:01:24 +0100 Subject: [PATCH 006/140] Include int size in .sym files, fix __IN for out of range values, better naming. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 268 +++++++++++---------------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 14 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 144 +++++++++----- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 19 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 268 +++++++++++---------------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 14 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 144 +++++++++----- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 19 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 268 +++++++++++---------------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 14 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 144 +++++++++----- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 19 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 268 +++++++++++---------------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 14 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 144 +++++++++----- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 19 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 268 +++++++++++---------------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 14 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 144 +++++++++----- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 19 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPT.Mod | 61 +++--- src/compiler/OPV.Mod | 2 +- src/system/SYSTEM.h | 2 +- src/test/confidence/testresult.sh | 4 +- 205 files changed, 1353 insertions(+), 1325 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index cc4cc8bd..375896e6 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 496a4a87..069b901c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index bc1d11eb..7241c31a 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6326549f..9e1c6dfd 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 77a9b68f..b890523b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 52012a3c..41ad5883 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 9a5617f1..f5aabe8a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index cc4cc8bd..375896e6 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 496a4a87..069b901c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index bc1d11eb..7241c31a 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6326549f..9e1c6dfd 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 77a9b68f..b890523b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f7a3fdd3..c40f0930 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d178499a..99931953 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8539a1e2..166df1dc 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b091f1f7..e30e1366 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 6cd166ef..70e9a7e2 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index a0813c94..6c86c19c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 86914f24..3a575916 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 8bcec40e..4135c1d4 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d3529141..1eb56133 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 7827d119..7e4094a1 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e006bde8..51f3204d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9a0517b5..8431e4a2 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index cb07c606..ce3f00ec 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,9 +35,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -54,8 +52,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -225,68 +221,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (SYSTEM_INT64)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (SYSTEM_INT64)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -430,16 +378,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -452,54 +400,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -508,7 +456,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -574,13 +522,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -597,9 +545,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -613,7 +561,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -641,7 +589,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -662,7 +610,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -674,7 +622,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -687,7 +635,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -700,7 +648,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -709,7 +657,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -726,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -922,7 +870,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1179,7 +1127,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1220,15 +1168,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1239,29 +1187,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1278,11 +1226,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1394,7 +1342,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1413,7 +1361,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1436,7 +1384,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1454,7 +1402,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1464,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1487,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1496,7 +1444,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1507,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1515,16 +1463,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1533,7 +1481,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1543,7 +1491,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1895,8 +1843,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1906,8 +1859,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2044,13 +2002,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2067,9 +2025,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2085,7 +2043,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2096,7 +2054,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2121,7 +2079,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2143,7 +2101,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2169,7 +2127,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2200,9 +2158,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2219,7 +2177,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2229,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2253,7 +2211,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2299,7 +2257,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index f2056569..ccef7627 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0813dca9..a5276b17 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index aa92d405..de932c60 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 3bc1b6d2..0e43a013 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index f11b56ba..e94f0303 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3a345c1f..63b71ce5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -25,7 +25,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1164,7 +1164,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1181,10 +1181,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1263,7 +1263,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c0c9c3dd..fb0cf655 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 1f9f2a46..e2d48c61 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 4b760b22..ea28a764 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 20234e22..b028d164 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -85,11 +85,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -107,7 +107,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -129,10 +128,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -148,6 +149,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -156,6 +158,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -468,21 +498,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -492,53 +522,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -548,11 +578,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -589,11 +619,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -603,7 +633,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -947,6 +977,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -957,7 +1000,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1082,7 +1125,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1151,9 +1194,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1397,6 +1440,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1494,6 +1540,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1700,15 +1747,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1742,8 +1780,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1812,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1840,7 +1878,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1878,5 +1915,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f1865573..9878e30b 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,12 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 638891f1..f74e0890 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b0551679..43ab4681 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7ecd9794..7637b515 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 832aaa35..0fee3539 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 660cd605..a5a93902 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 3102ce18..76bda39d 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2df49d25..bd57ef4e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9505fe03..aa97eeac 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0e0b4725..cd9388a6 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 3086fb00..b591e699 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index a487fe66..19624204 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8489752b..5493978e 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index a5af5a7d..8ce5a106 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fce52835..72df4f99 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 9e5aed51..4523936a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 0e0401e3..efcf43ab 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index eb6374ea..65ae6d58 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b0d48f0a..947863a2 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 38a63260..33303334 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 52a0ced0..3d09ab84 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 2c462da9..0e7cb823 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 966fb2ca..5b20dd10 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7e437f34..85814163 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index cca2fc74..5fcaf193 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d05f688c..4247d33d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index d76a50a2..148c062a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 78c8d49e..85b1ec59 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 60b37750..9a06ac24 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -34,9 +34,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,8 +51,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -224,68 +220,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (int)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (int)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -429,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -451,54 +399,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -507,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -573,13 +521,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -596,9 +544,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -612,7 +560,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -640,7 +588,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -661,7 +609,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -673,7 +621,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -686,7 +634,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -699,7 +647,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -708,7 +656,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -725,7 +673,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -921,7 +869,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1178,7 +1126,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1219,15 +1167,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1238,29 +1186,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1277,11 +1225,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1393,7 +1341,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1412,7 +1360,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1435,7 +1383,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1453,7 +1401,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1463,7 +1411,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1486,7 +1434,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1495,7 +1443,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1506,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1514,16 +1462,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1532,7 +1480,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1542,7 +1490,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1894,8 +1842,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (int)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1905,8 +1858,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (int)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2043,13 +2001,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2024,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2042,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2053,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2078,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2100,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2157,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2176,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2298,7 +2256,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index e7a96131..81b3745b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 02a24b4d..8a3a54cf 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 7aea7283..dcd53d63 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 88c3bd4d..65ebb8b0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 3c2be746..a61c632e 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a0c19958..5620c5ec 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -24,7 +24,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1163,7 +1163,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1180,10 +1180,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1262,7 +1262,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 6c24817c..be6b6252 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 85c8b275..1f721944 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 313c0ac7..ecd93034 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cbd147e6..8efa4803 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -84,11 +84,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -106,7 +106,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -128,10 +127,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -147,6 +148,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -155,6 +157,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -467,21 +497,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -491,53 +521,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -547,11 +577,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -588,11 +618,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -602,7 +632,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -946,6 +976,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -956,7 +999,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1081,7 +1124,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1150,9 +1193,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1396,6 +1439,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1493,6 +1539,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1699,15 +1746,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1741,8 +1779,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1811,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1839,7 +1877,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1877,5 +1914,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index c4975398..f6206e42 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -92,12 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2172dee5..03b675a9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 122fda4a..6926d6ac 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6204567c..13bb2453 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index b4e3ecf5..8bb15073 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 11c99924..4ee29f7d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b0497a9c..0a81ebf4 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 15aeff29..0c372b8b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 385096bc..0dbfdb8e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f7a3fdd3..c40f0930 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d178499a..99931953 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 66a97f5d..e8b1e4d1 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 59b8db27..a8573f9a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6ae0cd7a..6dfe7b1d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 2ef65e7b..d2141803 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 39837586..38d2da7b 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index e0edabd9..5eb4f70e 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 413ae867..770cf66d 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8539a1e2..166df1dc 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/26] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b091f1f7..e30e1366 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index e0344732..332ebd52 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index a0813c94..6c86c19c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index db7f4cd9..4fa9852c 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 12178ad1..a0a4c4f3 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d3529141..1eb56133 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 7827d119..7e4094a1 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e006bde8..51f3204d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9a0517b5..8431e4a2 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index cb07c606..ce3f00ec 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -35,9 +35,7 @@ export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); -static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -54,8 +52,6 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -static LONGINT OPB_ShorterSize (LONGINT i); -static INTEGER OPB_SignedByteSize (LONGINT n); export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); @@ -225,68 +221,20 @@ OPT_Node OPB_EmptySet (void) return _o_result; } -static INTEGER OPB_SignedByteSize (LONGINT n) +static void OPB_SetIntType (OPT_Node node) { - INTEGER _o_result; INTEGER b; - if (n < 0) { - n = -(n + 1); + LONGINT n; + if (node->conval->intval >= 0) { + n = node->conval->intval; + } else { + n = -(node->conval->intval + 1); } b = 1; while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = b; - return _o_result; -} - -static LONGINT OPB_ShorterSize (LONGINT i) -{ - LONGINT _o_result; - if (i >= (SYSTEM_INT64)OPM_LIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_SIntSize; - return _o_result; - } - __RETCHK; -} - -static LONGINT OPB_LongerSize (LONGINT i) -{ - LONGINT _o_result; - if (i <= (SYSTEM_INT64)OPM_SIntSize) { - _o_result = OPM_IntSize; - return _o_result; - } else { - _o_result = OPM_LIntSize; - return _o_result; - } - __RETCHK; -} - -static OPT_Struct OPB_IntType (LONGINT size) -{ - OPT_Struct _o_result; - OPT_Struct result = NIL; - if (size <= OPT_sinttyp->size) { - result = OPT_sinttyp; - } else if (size <= OPT_inttyp->size) { - result = OPT_inttyp; - } else { - result = OPT_linttyp; - } - if (size > OPT_linttyp->size) { - OPB_err(203); - } - _o_result = result; - return _o_result; -} - -static void OPB_SetIntType (OPT_Node node) -{ - node->typ = OPB_IntType(OPB_SignedByteSize(node->conval->intval)); + node->typ = OPT_IntType(b); } OPT_Node OPB_NewIntConst (LONGINT intval) @@ -430,16 +378,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__57 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__57 *lnk; +} *TypTest__57_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__58 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__58 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -452,54 +400,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__57_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); + (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__57_s->guard) { + if ((*TypTest__57_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__57_s->x; + node->obj = *TypTest__57_s->obj; + *TypTest__57_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__57_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__57 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__57_s; + TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__58((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -508,7 +456,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__57_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -574,13 +522,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__30 { - struct MOp__30 *lnk; -} *MOp__30_s; +static struct MOp__28 { + struct MOp__28 *lnk; +} *MOp__28_s; -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -597,9 +545,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__30 _s; - _s.lnk = MOp__30_s; - MOp__30_s = &_s; + struct MOp__28 _s; + _s.lnk = MOp__28_s; + MOp__28_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -613,7 +561,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(98); @@ -641,7 +589,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(97); @@ -662,7 +610,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -674,7 +622,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -687,7 +635,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } } else { OPB_err(111); @@ -700,7 +648,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(127); } @@ -709,7 +657,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__31(op, typ, z); + z = NewOp__29(op, typ, z); } else { OPB_err(219); } @@ -726,7 +674,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__30_s = _s.lnk; + MOp__28_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -922,7 +870,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { - x->typ = OPB_IntType(x->typ->size); + x->typ = OPT_IntType(x->typ->size); } } else if (g == 7) { x->typ = OPT_realtyp; @@ -1179,7 +1127,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if (__IN(g, 0x70)) { if (f > g) { OPB_SetIntType(*x); - if ((int)(*x)->typ->form > g) { + if ((*x)->typ->size > typ->size) { OPB_err(203); (*x)->conval->intval = 1; } @@ -1220,15 +1168,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__40 { +static struct Op__38 { INTEGER *f, *g; - struct Op__40 *lnk; -} *Op__40_s; + struct Op__38 *lnk; +} *Op__38_s; -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1239,29 +1187,29 @@ static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; - if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__40_s->g = 10; + *Op__38_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__40_s->f = 10; + *Op__38_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1278,11 +1226,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__40 _s; + struct Op__38 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__40_s; - Op__40_s = &_s; + _s.lnk = Op__38_s; + Op__38_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1394,7 +1342,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 2: @@ -1413,7 +1361,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 3: do_ = 1; @@ -1436,7 +1384,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 4: @@ -1454,7 +1402,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1464,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1487,7 +1435,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 7: @@ -1496,7 +1444,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } break; case 8: @@ -1507,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1515,16 +1463,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__43(&z, &y)) { + if (__IN(f, 0x6bff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__43(&z, &y)) { + if (__IN(f, 0x01f9) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1533,7 +1481,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__41(op, typ, &z, y); + NewOp__39(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1543,7 +1491,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__40_s = _s.lnk; + Op__38_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1895,8 +1843,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size > (SYSTEM_INT64)OPM_SIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, -1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1906,8 +1859,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && x->typ->size < (SYSTEM_INT64)OPM_LIntSize)) { - OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); + } else if (__IN(f, 0x70)) { + typ = OPT_ShorterOrLongerType(x->typ, 1); + if (typ == NIL) { + OPB_err(111); + } else { + OPB_Convert(&x, typ); + } } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -2044,13 +2002,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__52 { + struct StPar1__52 *lnk; +} *StPar1__52_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2067,9 +2025,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__52 _s; + _s.lnk = StPar1__52_s; + StPar1__52_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2085,7 +2043,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2096,7 +2054,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2121,7 +2079,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__53(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2143,7 +2101,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__53(19, 18, p, x); } else { OPB_err(111); } @@ -2169,7 +2127,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__53(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2200,9 +2158,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__53(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__53(12, 28, p, x); } p->typ = p->left->typ; } @@ -2219,7 +2177,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__53(19, fctno, p, x); } else { OPB_err(111); } @@ -2229,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__53(12, 26, p, x); } else { OPB_err(111); } @@ -2253,7 +2211,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__53(19, 30, p, x); } else { OPB_err(111); } @@ -2299,7 +2257,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__52_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index f2056569..ccef7627 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0813dca9..a5276b17 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index aa92d405..de932c60 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 3bc1b6d2..0e43a013 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index f11b56ba..e94f0303 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3a345c1f..63b71ce5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -25,7 +25,7 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); static void OPP_CheckMark (SHORTINT *vis); static void OPP_CheckSym (INTEGER s); static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); @@ -1164,7 +1164,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; INTEGER i, f; @@ -1181,10 +1181,10 @@ static void OPP_CaseLabelList (OPT_Node *lab, INTEGER LabelForm, INTEGER *n, OPP xval = 1; } if (__IN(f, 0x70)) { - if (LabelForm < f) { + if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelForm != f) { + } else if ((int)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { @@ -1263,7 +1263,7 @@ static void CasePart__31 (OPT_Node *x) n = 0; for (;;) { if (OPP_sym < 40) { - OPP_CaseLabelList(&lab, (*x)->typ->form, &n, tab); + OPP_CaseLabelList(&lab, (*x)->typ, &n, tab); OPP_CheckSym(20); OPP_StatSeq(&y); OPB_Construct(17, &lab, y); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (y->typ->form < 4 || y->typ->form > x->left->typ->form) { + } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c0c9c3dd..fb0cf655 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 1f9f2a46..e2d48c61 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 4b760b22..ea28a764 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 20234e22..b028d164 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -85,11 +85,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -static OPT_Object OPT_LIntObj; export SHORTINT OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; +static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -107,7 +107,6 @@ export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj); static void OPT_EnterProc (OPS_Name name, INTEGER num); static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -129,10 +128,12 @@ static OPT_Object OPT_InObj (SHORTINT mno); static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (SHORTINT mno); +static OPT_Struct OPT_InTyp (LONGINT tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export OPT_Struct OPT_IntType (LONGINT size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (SHORTINT class); @@ -148,6 +149,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); static void OPT_err (INTEGER n); @@ -156,6 +158,34 @@ static void OPT_err (INTEGER n) OPM_err(n); } +OPT_Struct OPT_IntType (LONGINT size) +{ + OPT_Struct _o_result; + INTEGER i; + i = 1; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + i += 1; + } + _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + return _o_result; +} + +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +{ + OPT_Struct _o_result; + INTEGER i; + __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(dir == 1 || dir == -1, 0); + __ASSERT(x->BaseTyp == OPT_undftyp, 0); + i = 0; + while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + i += 1; + } + __ASSERT(i < 19, 0); + _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + return _o_result; +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -468,21 +498,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__12 { LONGINT *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__12 *lnk; +} *FPrintStr__12_s; -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) { LONGINT i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__13(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -492,53 +522,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } if (btyp->form == 13 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__15(btyp, fld, adr); i += 1; } } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, ((LONGINT)(256))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__15(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__17 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, ((LONGINT)(13))); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__17(obj->right); } } @@ -548,11 +578,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; LONGINT pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__12_s; + FPrintStr__12_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -589,11 +619,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__17(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -603,7 +633,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__12_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -947,6 +977,19 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } +static OPT_Struct OPT_InTyp (LONGINT tag) +{ + OPT_Struct _o_result; + if (__IN(tag, 0x70)) { + _o_result = OPT_IntType(OPM_SymRInt()); + return _o_result; + } else { + _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + return _o_result; + } + __RETCHK; +} + static void OPT_InStruct (OPT_Struct *typ) { SHORTINT mno; @@ -957,7 +1000,7 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; tag = OPM_SymRInt(); if (tag != 34) { - *typ = OPT_impCtxt.ref[__X(-tag, ((LONGINT)(255)))]; + *typ = OPT_InTyp(-tag); } else { ref = OPT_impCtxt.nofr; OPT_impCtxt.nofr += 1; @@ -1082,7 +1125,7 @@ static void OPT_InStruct (OPT_Struct *typ) } if (ref == OPT_impCtxt.minr) { while (ref < OPT_impCtxt.nofr) { - t = OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))]; + t = OPT_InTyp(ref); OPT_FPrintStr(t); obj = t->strobj; if (obj->name[0] != 0x00) { @@ -1151,9 +1194,9 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->vis = 1; if (tag <= 13) { obj->mode = 3; - obj->typ = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); + obj->typ = OPT_InTyp(tag); } else if (tag >= 31) { obj->conval = OPT_NewConst(); obj->conval->intval = -1; @@ -1397,6 +1440,9 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); + if (__IN(typ->ref, 0x70)) { + OPM_SymWInt(typ->size); + } } else { OPM_SymWInt(((LONGINT)(34))); typ->ref = OPT_expCtxt.ref; @@ -1494,6 +1540,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 4: case 5: case 6: OPM_SymWInt(obj->conval->intval); + OPM_SymWInt(obj->typ->size); break; case 9: OPM_SymWSet(obj->conval->setval); @@ -1700,15 +1747,6 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterDerivedType (OPS_Name name, OPT_Struct typ, OPT_Object *obj) -{ - OPS_Name name__copy; - __DUPARR(name, OPS_Name); - OPT_Insert(name, &*obj); - (*obj)->mode = 5; - (*obj)->typ = typ; -} - static void OPT_EnterProc (OPS_Name name, INTEGER num) { OPT_Object obj = NIL; @@ -1742,8 +1780,8 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); - P(OPT_LIntObj); __ENUMP(OPT_GlbMod, 64, P); + __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1812,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 11); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_LIntSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); @@ -1840,7 +1878,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterDerivedType((CHAR*)"LINT", OPT_int64typ, &OPT_LIntObj); OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1878,5 +1915,12 @@ export void *OPT__init(void) OPT_impCtxt.ref[11] = OPT_niltyp; OPT_impCtxt.ref[12] = OPT_notyp; OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_IntTypes[1] = OPT_sinttyp; + OPT_IntTypes[2] = OPT_inttyp; + OPT_IntTypes[3] = OPT_linttyp; + OPT_IntTypes[5] = OPT_int8typ; + OPT_IntTypes[6] = OPT_int16typ; + OPT_IntTypes[7] = OPT_int32typ; + OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f1865573..9878e30b 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,12 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import OPT_Struct OPT_IntType (LONGINT size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (SHORTINT class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); import void OPT_OpenScope (SHORTINT level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 638891f1..f74e0890 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b0551679..43ab4681 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 875aa4b4..679e8b8d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1c350cbf..aa08a76c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 660cd605..a5a93902 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 3102ce18..76bda39d 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 35620b9b..343404a4 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -60,12 +60,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// Unsigned variants are for use by shift and rotate macros. - -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) @@ -80,9 +74,20 @@ typedef unsigned char U_SHORTINT; typedef unsigned long U_LONGINT; #endif +// Unsigned variants are for use by shift and rotate macros. + +typedef unsigned char U_SYSTEM_BYTE; +typedef unsigned char U_CHAR; +typedef unsigned char U_SHORTINT; + typedef U_LONGINT SET; typedef U_LONGINT U_SET; +typedef SYSTEM_CARD8 U_SYSTEM_INT8; +typedef SYSTEM_CARD16 U_SYSTEM_INT16; +typedef SYSTEM_CARD32 U_SYSTEM_INT32; +typedef SYSTEM_CARD64 U_SYSTEM_INT64; + // OS Memory allocation interfaces are in PlatformXXX.Mod @@ -178,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2df49d25..bd57ef4e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9505fe03..aa97eeac 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0e0b4725..cd9388a6 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 3086fb00..b591e699 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index a487fe66..19624204 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8489752b..5493978e 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index a5af5a7d..8ce5a106 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fce52835..72df4f99 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 9e5aed51..4523936a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 0e0401e3..efcf43ab 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index eb6374ea..65ae6d58 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/26] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index cfb983b5..000e1aef 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1007,7 +1007,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f IN OPT.intSet THEN - typ := OPT.NextType(x.typ, -1); + typ := OPT.ShorterOrLongerType(x.typ, -1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) ELSE err(111) @@ -1015,7 +1015,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f IN OPT.intSet THEN - typ := OPT.NextType(x.typ, 1); + typ := OPT.ShorterOrLongerType(x.typ, 1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) ELSIF f = OPT.Char THEN Convert(x, OPT.linttyp) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index e1b33ac3..efaac954 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -166,7 +166,7 @@ VAR SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - NextSize: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) CONST @@ -217,11 +217,11 @@ PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) VAR i: INTEGER; BEGIN - i := 1; WHILE (NextSize[i].size < size) & (NextSize[i+1] # NIL) DO INC(i) END; - RETURN NextSize[i]; + i := 1; WHILE (IntTypes[i].size < size) & (IntTypes[i+1] # NIL) DO INC(i) END; + RETURN IntTypes[i]; END IntType; -PROCEDURE NextType*(x: Struct; dir: INTEGER): Struct; +PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form IN intSet); @@ -232,10 +232,10 @@ BEGIN (* WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; *) - i := 0; WHILE (NextSize[i] # x) & (i < LEN(NextSize)) DO INC(i) END; - ASSERT(i < LEN(NextSize)-1); - RETURN NextSize[i+dir] -END NextType; + i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; + ASSERT(i < LEN(IntTypes)-1); + RETURN IntTypes[i+dir] +END ShorterOrLongerType; @@ -705,18 +705,9 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; - VAR size: LONGINT; BEGIN IF tag IN intSet THEN - size := OPM.SymRInt(); - (* - IF size = 123456789 THEN (* Expected magic number while testing *) - size := OPM.SymRInt(); - ELSE - OPM.LogWLn; OPM.LogWStr("Missing constant magic number. size = "); OPM.LogWNum(size,1); - END; - *) - RETURN IntType(size) + RETURN IntType(OPM.SymRInt()) ELSE RETURN impCtxt.ref[tag] END @@ -728,8 +719,7 @@ PROCEDURE InStruct(VAR typ: Struct); t: Struct; obj, last, fld, old, dummy: Object; BEGIN tag := OPM.SymRInt(); - IF tag # Sstruct THEN - typ := impCtxt.ref[-tag] + IF tag # Sstruct THEN typ := InTyp(-tag) ELSE ref := impCtxt.nofr; INC(impCtxt.nofr); IF ref < impCtxt.minr THEN impCtxt.minr := ref END; @@ -804,7 +794,7 @@ BEGIN END; IF ref = impCtxt.minr THEN WHILE (ref < impCtxt.nofr) DO - t := impCtxt.ref[ref]; FPrintStr(t); + t := InTyp(ref); FPrintStr(t); obj := t^.strobj; (* obj^.typ^.strobj = obj, else obj^.fprint differs (alias) *) IF obj^.name # "" THEN FPrintObj(obj) END; old := impCtxt.old[ref]; @@ -998,7 +988,7 @@ END Import; END END OutFlds; - PROCEDURE OutSign(result: Struct; par: Object); + PROCEDURE OutSign(result: Struct; par: Object); (* Procedure signature *) BEGIN OutStr(result); WHILE par # NIL DO @@ -1010,7 +1000,7 @@ END Import; OPM.SymWInt(Send) END OutSign; - PROCEDURE OutTProcs(typ: Struct; obj: Object); + PROCEDURE OutTProcs(typ: Struct; obj: Object); (* Type bound procedures *) BEGIN IF obj # NIL THEN OutTProcs(typ, obj^.left); @@ -1033,18 +1023,11 @@ END Import; END END OutTProcs; - - PROCEDURE OutSize(size: LONGINT); - BEGIN - (* OPM.SymWInt(123456789); *) - OPM.SymWInt(size) - END OutSize; - - PROCEDURE OutStr(typ: Struct); (* OPV.TypeAlloc already applied *) VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); + IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1091,7 +1074,7 @@ END Import; Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | SInt, Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OutSize(obj.typ.size) + LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1280,14 +1263,14 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - NextSize[1] := sinttyp; - NextSize[2] := inttyp; - NextSize[3] := linttyp; + IntTypes[1] := sinttyp; + IntTypes[2] := inttyp; + IntTypes[3] := linttyp; - NextSize[5] := int8typ; - NextSize[6] := int16typ; - NextSize[7] := int32typ; - NextSize[8] := int64typ + IntTypes[5] := int8typ; + IntTypes[6] := int16typ; + IntTypes[7] := int32typ; + IntTypes[8] := int64typ END OPT. diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7518f811..a3e2272d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -624,7 +624,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; - ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; + ELSE OPM.LogWStr("unhandled case in OPV.expr, subclass = "); OPM.LogWNum(subclass, 0); OPM.LogWLn; END ; expr(l, MinPrec); OPM.WriteString(Comma); diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 216af910..343404a4 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -183,7 +183,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) (((s)>>(x))&1) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) diff --git a/src/test/confidence/testresult.sh b/src/test/confidence/testresult.sh index bdfcccfe..2dfd8a34 100755 --- a/src/test/confidence/testresult.sh +++ b/src/test/confidence/testresult.sh @@ -7,8 +7,8 @@ fi # Compare generated code if [ -f new.asm ] -#then egrep '^[0-9 ]{4} ([0-9a-f]{4}| ) [0-9A-F]{2}[0-9A-F ]{6}' new.asm|cut -c 11- >new.$FLAVOUR.$BRANCH.s -then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm>new.$FLAVOUR.$BRANCH.s +#then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm>new.$FLAVOUR.$BRANCH.s +then sed -n '/^ *[0-9]\+ \([0-9a-f]\{4\}\| \) [0-9A-F]\{2\}[0-9A-F ]\{6\}/s/^ *[0-9]\+ ....//p' new.asm | sed 's/_m.[0-9]\+/_m.xxx/' >new.$FLAVOUR.$BRANCH.s if [ -f old.$FLAVOUR.$BRANCH.s -a old.$FLAVOUR.$BRANCH.s -nt ../planned-binary-change ] then From 0508097ffe00338444ba0a28f50cc5fc43910e0d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 17:15:44 +0100 Subject: [PATCH 007/140] Base expression casting on C int size, remove dependencies on form=LInt. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 20 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 152 +++---- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 32 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 18 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 94 ++-- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 629 ++++++++++++++------------- bootstrap/unix-44/OPC.h | 3 +- bootstrap/unix-44/OPM.c | 354 +++++++-------- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 92 ++-- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 16 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 280 ++++++------ bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 460 ++++++++++---------- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 78 ++-- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 36 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 18 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 172 ++++---- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 36 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 62 +-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 100 ++--- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 20 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 152 +++---- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 32 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 18 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 94 ++-- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 629 ++++++++++++++------------- bootstrap/unix-48/OPC.h | 3 +- bootstrap/unix-48/OPM.c | 354 +++++++-------- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 92 ++-- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 16 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 280 ++++++------ bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 460 ++++++++++---------- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 78 ++-- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 36 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 18 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 172 ++++---- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 36 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 62 +-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 100 ++--- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 18 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 148 +++---- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 34 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 18 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 74 ++-- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 617 +++++++++++++------------- bootstrap/unix-88/OPC.h | 3 +- bootstrap/unix-88/OPM.c | 344 +++++++-------- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 92 ++-- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 8 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 280 ++++++------ bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 456 +++++++++---------- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 68 +-- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 22 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 4 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 168 +++---- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 36 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 62 +-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 100 ++--- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 20 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 152 +++---- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 32 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 18 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 94 ++-- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 629 ++++++++++++++------------- bootstrap/windows-48/OPC.h | 3 +- bootstrap/windows-48/OPM.c | 354 +++++++-------- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 92 ++-- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 16 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 280 ++++++------ bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 460 ++++++++++---------- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 70 +-- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 36 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 18 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 172 ++++---- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 36 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 62 +-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 100 ++--- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 18 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 148 +++---- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 34 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 18 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 74 ++-- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 617 +++++++++++++------------- bootstrap/windows-88/OPC.h | 3 +- bootstrap/windows-88/OPM.c | 344 +++++++-------- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 92 ++-- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 8 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 280 ++++++------ bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 456 +++++++++---------- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 62 +-- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 22 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 4 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 168 +++---- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 36 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 62 +-- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 100 ++--- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 20 +- src/compiler/OPM.cmdln.Mod | 6 + src/compiler/OPT.Mod | 3 +- src/compiler/OPV.Mod | 55 ++- 199 files changed, 6800 insertions(+), 6540 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 41ad5883..58a4ec95 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f5aabe8a..34a403f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 375896e6..124f7163 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 069b901c..05991786 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 7241c31a..61089cbd 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9e1c6dfd..6ff2920b 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } @@ -350,8 +350,8 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } @@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms) { LONGINT s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } @@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; @@ -782,7 +782,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index b890523b..4c7f2849 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 70e9a7e2..bb971366 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 3a575916..01a8d9ef 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4135c1d4..17323792 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7637b515..6e34dddd 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,8 +263,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -273,17 +273,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -301,10 +301,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -530,7 +530,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) { INTEGER _o_result; - *n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -614,7 +614,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) INTEGER _o_result; INTEGER r; r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { _o_result = Platform_err(); return _o_result; @@ -675,52 +675,52 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49); + Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); break; case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32); + Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); break; case -8: - Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Value out of range.", 20); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -10: - Platform_errstring((CHAR*)"NIL access.", (LONGINT)12); + Platform_errstring((CHAR*)"NIL access.", 12); break; case -11: - Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17); + Platform_errstring((CHAR*)"Alignment error.", 17); break; case -12: - Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16); + Platform_errstring((CHAR*)"Divide by zero.", 16); break; case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31); + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); break; case -14: - Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27); + Platform_errstring((CHAR*)"Invalid function argument.", 27); break; case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -734,9 +734,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -747,11 +747,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; @@ -783,7 +783,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256))); + Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 0fee3539..ca58fbe8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 947863a2..eed3c4f0 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 33303334..90696149 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 3d09ab84..01806847 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -30,7 +30,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n) k = 10; } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -89,9 +89,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -115,7 +115,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 0e7cb823..fad0f676 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5b20dd10..a0e79aca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -216,15 +216,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -242,7 +242,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -304,7 +304,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -518,8 +518,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -808,12 +808,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((int)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1055,6 +1055,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 85814163..fdaec6b0 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 5fcaf193..e42a752c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -116,7 +116,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4247d33d..4d5c5b4e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 148c062a..9f39f448 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" @@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 85b1ec59..1707868f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 9a06ac24..73416071 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((__IN(f, 0x70) && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int)OPM_MaxSet) { + if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) case 4: if (__IN(f, 0x70)) { if (yval->intval != 0) { - xval->intval = __MOD(xval->intval, yval->intval); + xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int)__ENTIER(r); + (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int)OPM_MaxSet) { + if (0 > k || k > OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int)OPM_MaxSet) { + if (0 > l || l > OPM_MaxSet) { OPB_err(202); } } @@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int)OPM_MaxSet)) { + if ((0 <= k && k <= OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (x->typ->size != (int)OPM_LIntSize) { + if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 81b3745b..385a9146 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 8a3a54cf..494d985f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -62,6 +62,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -178,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -191,10 +192,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -203,18 +204,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -290,7 +291,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -308,8 +309,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -318,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -336,17 +337,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -363,10 +364,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -436,7 +437,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -453,7 +454,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -485,11 +486,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -501,8 +502,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -512,19 +513,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -537,7 +538,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -545,16 +546,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -586,7 +587,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -594,9 +595,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -630,31 +631,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -709,7 +710,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -742,7 +743,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -758,19 +759,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -814,34 +815,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (int)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -872,7 +873,7 @@ LONGINT OPC_SizeAlignment (LONGINT size) { LONGINT _o_result; LONGINT alignment; - if (size < (int)OPM_Alignment) { + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -909,23 +910,23 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); - } else if (align == (int)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); - } else if (align == (int)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + if (align == OPM_IntSize) { + OPM_WriteString((CHAR*)"INTEGER", 8); + } else if (align == OPM_LIntSize) { + OPM_WriteString((CHAR*)"LONGINT", 8); + } else if (align == OPM_LRealSize) { + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -969,7 +970,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -978,7 +979,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (int)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -999,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1008,16 +1009,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1033,17 +1034,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1058,7 +1059,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1066,25 +1067,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1094,7 +1095,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1114,7 +1115,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1125,11 +1126,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1140,10 +1141,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1153,8 +1154,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1168,15 +1169,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1194,25 +1195,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1264,14 +1265,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1280,20 +1281,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1303,10 +1304,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1329,9 +1330,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1347,8 +1348,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1366,31 +1367,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1399,17 +1400,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1425,49 +1426,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1479,9 +1480,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1491,25 +1492,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1522,24 +1523,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1553,7 +1554,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1566,7 +1567,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1578,31 +1579,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1619,12 +1620,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1633,31 +1634,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1667,14 +1668,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1682,19 +1683,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1706,7 +1707,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1715,12 +1716,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1731,7 +1732,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1754,9 +1755,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1767,9 +1768,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1781,17 +1782,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1801,26 +1802,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1829,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1849,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1872,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1881,42 +1882,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1925,9 +1952,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1957,7 +1986,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 32; @@ -1980,14 +2009,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2005,8 +2034,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2021,45 +2050,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index dcd53d63..4243328e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 65ebb8b0..c3bece55 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -276,12 +276,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -532,27 +532,27 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT); + __GET((SYSTEM_ADRINT)&real, l, LONGINT); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT); + __GET((SYSTEM_ADRINT)&lr, l, LONGINT); + __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR(i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK(i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int)__ENTIER(r)); + OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -961,9 +961,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -975,10 +975,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -987,11 +987,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1032,15 +1032,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a61c632e..f93bcd98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5620c5ec..f44a2167 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -932,8 +932,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -949,7 +949,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index be6b6252..0ddbe4c3 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 1f721944..2a093f8e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -188,7 +188,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -199,8 +199,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) { - OPS_intval = OPS_intval * 10 + (int)d; + if (OPS_intval <= __DIV(2147483647 - d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index ecd93034..46e05201 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8efa4803..c81989cb 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, 256); _o_result = ext; return _o_result; } @@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -281,13 +281,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1874,11 +1874,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f6206e42..3e352ca3 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 03b675a9..75adb37c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -36,9 +36,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -86,7 +87,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (int)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -117,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -196,27 +197,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -258,7 +259,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -338,8 +339,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -408,8 +409,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -423,8 +424,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -439,7 +440,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -463,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -471,12 +472,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -486,29 +503,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -516,7 +531,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -527,14 +542,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -552,12 +567,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -569,12 +584,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -599,7 +614,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -609,7 +624,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -636,25 +651,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + while (i < __ASHR(d->typ->size - 4, 2)) { + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -672,33 +687,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -711,15 +726,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -732,8 +747,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -742,6 +757,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -756,81 +780,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -870,9 +888,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -893,16 +911,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -912,31 +930,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -952,13 +970,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -977,84 +995,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1062,9 +1080,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1074,7 +1092,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1087,16 +1105,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1105,28 +1123,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1142,7 +1160,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1171,7 +1189,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1182,9 +1200,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1200,13 +1218,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1220,7 +1238,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1252,22 +1270,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1297,44 +1315,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1377,7 +1391,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1403,11 +1417,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1420,13 +1434,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1436,9 +1450,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1447,11 +1461,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1464,43 +1478,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1508,15 +1522,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1526,7 +1540,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1542,9 +1556,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1557,7 +1571,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1567,11 +1581,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1580,13 +1594,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1595,39 +1609,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1638,8 +1652,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 6926d6ac..0299d34b 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 13bb2453..273d1182 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -253,7 +253,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -280,8 +280,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -290,17 +290,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -318,10 +318,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -334,8 +334,8 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) { - *d = (__ASHL((int)(int)__MOD(ye, 100), 9) + __ASHL((int)(mo + 1), 5)) + (int)da; - *t = (__ASHL((int)ho, 12) + __ASHL((int)mi, 6)) + (int)se; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } void Platform_GetClock (LONGINT *t, LONGINT *d) @@ -349,14 +349,14 @@ LONGINT Platform_Time (void) LONGINT _o_result; LONGINT ms; ms = Platform_GetTickCount(); - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -559,7 +559,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -664,7 +664,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -703,7 +703,7 @@ static void Platform_errposint (LONGINT l) if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } static void Platform_errint (LONGINT l) @@ -719,37 +719,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -763,9 +763,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -776,11 +776,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; @@ -812,7 +812,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 8bb15073..d0a62b87 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4ee29f7d..f2a4b1e4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } k = 0; if (n > 9) { - i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int)__ENTIER(x - i * (LONGREAL)1000000000); + i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } while (k < 9) { - d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48); + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } } else { - i = (int)__ENTIER(x); + i = (SYSTEM_INT32)__ENTIER(x); } - while (k < (int)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } @@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO CHAR by; i = 0; l = b__len; - while ((int)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0a81ebf4..6eeb5a87 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0c372b8b..ec6697bf 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) INTEGER i; __DUP(s, s__len, CHAR); i = 0; - while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); @@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = dest__len - 1; if (pos < 0) { pos = 0; } @@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0dbfdb8e..43656e74 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c40f0930..129aa156 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" @@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13); + Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); return; } else { n -= 1; @@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int)i) { + while (n > i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((int)(e - 1023) * 77, 8); + e = __ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) @@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 99931953..be79016b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index e8b1e4d1..7c16c24d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -94,7 +94,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -104,21 +104,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a8573f9a..7a91fc31 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6dfe7b1d..4a787a17 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2141803..cfb79ac9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -102,11 +102,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 38d2da7b..fb0797f3 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 5eb4f70e..dfe62efa 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" @@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -252,7 +252,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 770cf66d..73d985c9 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 166df1dc..5a7e6896 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index e30e1366..b38a0aa6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 332ebd52..af2ecbd7 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { INTEGER error; - error = Platform_Write(Platform_StdOut, (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -31,7 +31,7 @@ void Console_Char (CHAR ch) if (Console_pos == 128) { Console_Flush(); } - Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch; + Console_line[__X(Console_pos, 128)] = ch; Console_pos += 1; if (ch == 0x0a) { Console_Flush(); @@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } } if (i < 0) { - s[__X(k, ((LONGINT)(32)))] = '-'; + s[__X(k, 32)] = '-'; k += 1; } while (n > k) { @@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n) } while (k > 0) { k -= 1; - Console_Char(s[__X(k, ((LONGINT)(32)))]); + Console_Char(s[__X(k, 32)]); } } @@ -90,9 +90,9 @@ void Console_Ln (void) void Console_Bool (BOOLEAN b) { if (b) { - Console_String((CHAR*)"TRUE", (LONGINT)5); + Console_String((CHAR*)"TRUE", 5); } else { - Console_String((CHAR*)"FALSE", (LONGINT)6); + Console_String((CHAR*)"FALSE", 6); } } @@ -116,7 +116,7 @@ void Console_Read (CHAR *ch) LONGINT n; INTEGER error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, ((LONGINT)(1)), &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 6c86c19c..22d598fb 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4fa9852c..5f7d65a2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) { __DUP(s, s__len, CHAR); Console_Ln(); - Console_String((CHAR*)"-- ", (LONGINT)4); + Console_String((CHAR*)"-- ", 4); Console_String(s, s__len); - Console_String((CHAR*)": ", (LONGINT)3); + Console_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, ((LONGINT)(101))); + Console_String(f->registerName, 101); } else { - Console_String(f->workName, ((LONGINT)(101))); + Console_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", (LONGINT)8); - Console_Int(f->fd, ((LONGINT)(1))); + Console_String((CHAR*)"f.fd = ", 8); + Console_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", (LONGINT)12); - Console_Int(errcode, ((LONGINT)(1))); + Console_String((CHAR*)" errcode = ", 12); + Console_Int(errcode, 1); } Console_Ln(); __HALT(99); @@ -217,15 +217,15 @@ static void Files_Create (Files_File f) CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { - Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101))); + Files_GetTempName(f->registerName, 101, (void*)f->workName, 101); f->tempFile = 1; } else if (f->state == 2) { - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } - error = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); - error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd); + error = Platform_Unlink((void*)f->workName, 101); + error = Platform_New((void*)f->workName, 101, &f->fd); done = error == 0; if (done) { f->next = Files_files; @@ -243,7 +243,7 @@ static void Files_Create (Files_File f) } else { __MOVE("file not created", err, 17); } - Files_Err(err, ((LONGINT)(32)), f, error); + Files_Err(err, 32, f, error); } } } @@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } f->pos = buf->org + buf->size; buf->chg = 0; error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ); if (error != 0) { - Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error); + Files_Err((CHAR*)"error identifying file", 23, f, error); } } } @@ -305,7 +305,7 @@ void Files_Close (Files_File f) } error = Platform_Sync(f->fd); if (error != 0) { - Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error); + Files_Err((CHAR*)"error writing file", 19, f, error); } Files_CloseOSFile(f); } @@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); f->workName[0] = 0x00; - __COPY(name, f->registerName, ((LONGINT)(101))); + __COPY(name, f->registerName, 101); f->fd = -1; f->state = 1; f->len = 0; @@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) if (name[0] != 0x00) { if (Files_HasDir((void*)name, name__len)) { dir[0] = 0x00; - __COPY(name, path, ((LONGINT)(256))); + __COPY(name, path, 256); } else { pos = 0; - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_ScanPath(&pos, (void*)dir, 256); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } for (;;) { - error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRW((void*)path, 256, &fd); done = error == 0; if ((!done && Platform_TooManyFiles(error))) { - Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error); + Files_Err((CHAR*)"too many files open", 20, f, error); } if ((!done && Platform_Inaccessible(error))) { - error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd); + error = Platform_OldRO((void*)path, 256, &fd); done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20); + Console_String((CHAR*)"Warning: Files.Old ", 20); Console_String(name, name__len); - Console_String((CHAR*)" error = ", (LONGINT)10); - Console_Int(error, ((LONGINT)(0))); + Console_String((CHAR*)" error = ", 10); + Console_Int(error, 0); Console_Ln(); } if (done) { @@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->pos = 0; f->swapper = -1; error = Platform_Size(fd, &f->len); - __COPY(name, f->workName, ((LONGINT)(101))); + __COPY(name, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; f->identity = identity; @@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) __DEL(name); return _o_result; } else { - Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256))); - Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256))); + Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); + Files_ScanPath(&pos, (void*)dir, 256); } } } else { @@ -519,8 +519,8 @@ void Files_Purge (Files_File f) i += 1; } if (f->fd != -1) { - error = Platform_Truncate(f->fd, ((LONGINT)(0))); - error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet); + error = Platform_Truncate(f->fd, 0); + error = Platform_Seek(f->fd, 0, Platform_SeekSet); } f->pos = 0; f->len = 0; @@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) if (f->pos != org) { error = Platform_Seek(f->fd, org, Platform_SeekSet); } - error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n); + error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n); if (error != 0) { - Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error); + Files_Err((CHAR*)"read from file not done", 24, f, error); } f->pos = org + n; buf->size = n; @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min); + __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1))); + Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT *res = 3; return; } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n); + error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT error = Platform_Unlink((void*)old, old__len); *res = 0; } else { - Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error); + Files_Err((CHAR*)"cannot move file", 17, NIL, error); } } } else { @@ -809,12 +809,12 @@ void Files_Register (Files_File f) } Files_Close(f); if (f->registerName[0] != 0x00) { - Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode); + Files_Rename(f->workName, 101, f->registerName, 101, &errcode); if (errcode != 0) { - __COPY(f->registerName, file, ((LONGINT)(104))); + __COPY(f->registerName, file, 104); __HALT(99); } - __COPY(f->registerName, f->workName, ((LONGINT)(101))); + __COPY(f->registerName, f->workName, 101); f->registerName[0] = 0x00; f->tempFile = 0; } @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len); + __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); } } @@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); - *x = (int)b[0] + __ASHL((int)b[1], 8); + Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); + *x = b[0] + __ASHL(b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - *x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; LONGINT l; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24); - *x = (SET)l; + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = __VAL(SET, l); } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) { CHAR b[4]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); - Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4))); + Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); + Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) { CHAR b[8]; - Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); - Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8))); + Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); + Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((int)ch >= 128) { - n += __ASH((SYSTEM_INT64)((int)ch - 128), s); + while (ch >= 128) { + n += __ASH((SYSTEM_INT64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s); + n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) CHAR b[2]; b[0] = (CHAR)x; b[1] = (CHAR)__ASHR(x, 8); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2))); + Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) b[1] = (CHAR)__ASHR(x, 8); b[2] = (CHAR)__ASHR(x, 16); b[3] = (CHAR)__ASHR(x, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = (LONGINT)x; + i = __VAL(LONGINT, x); b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); b[3] = (CHAR)__ASHR(i, 24); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) { CHAR b[4]; - Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4))); + Files_FlipBytes((void*)&x, 4, (void*)b, 4); + Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) { CHAR b[8]; - Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8))); - Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8))); + Files_FlipBytes((void*)&x, 8, (void*)b, 8); + Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) @@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len while (x[i] != 0x00) { i += 1; } - Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1); + Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) @@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o) if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { - res = Platform_Unlink((void*)f->workName, ((LONGINT)(101))); + res = Platform_Unlink((void*)f->workName, 101); } } } @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1)); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; @@ -1056,6 +1056,6 @@ export void *Files__init(void) Files_tempno = -1; Heap_FileCount = 0; Files_HOME[0] = 0x00; - Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024); __ENDMOD; } diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a0a4c4f3..fa7db0e9 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1eb56133..a8a51e7c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -117,7 +117,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(((LONGINT)(-9))); + Heap_PlatformHalt(-9); } } @@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) } m->types = 0; m->cmds = NIL; - __COPY(name, m->name, ((LONGINT)(20))); + __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) } else { __NEW(c, Heap_CmdDesc); } - __COPY(name, c->name, ((LONGINT)(24))); + __COPY(name, c->name, 24); c->cmd = cmd; c->next = m->cmds; m->cmds = c; @@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); + tag = (__VAL(LONGINT, new) + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark(__VAL(LONGINT, p)); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (LONGINT)(SYSTEM_ADRINT)&frame; + sp = (SYSTEM_ADRINT)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align; + inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; if (sp > stack0) { inc = -inc; } @@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack) i22 += 23; i23 += 24; if ((i0 == -99 && i15 == 24)) { - Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000))); + Heap_MarkStack(32, (void*)cand, 10000); break; } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = __VAL(LONGINT, obj); f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { - Heap_heap = Heap_NewChunk(((LONGINT)(256000))); + Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); __PUT(Heap_heap, 0, LONGINT); Heap_allocated = 0; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 7e4094a1..eebee23c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 51f3204d..5929cd57 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_resMsg[0] = 0x00; } else { Modules_res = 1; - __COPY(name, Modules_importing, ((LONGINT)(20))); + __COPY(name, Modules_importing, 20); __MOVE(" module \"", Modules_resMsg, 10); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } _o_result = m; __DEL(name); @@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); - __COPY(name, Modules_importing, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20))); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len); - Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12); + __COPY(name, Modules_importing, 20); + Modules_Append((void*)Modules_resMsg, 256, mod->name, 20); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); + Modules_Append((void*)Modules_resMsg, 256, name, name__len); + Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); _o_result = NIL; __DEL(name); return _o_result; diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8431e4a2..03458258 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ce3f00ec..c3322a77 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len) x->conval->intval = -1; x->conval->intval2 = len; x->conval->ext = OPT_NewExt(); - __COPY(str, *x->conval->ext, ((LONGINT)(256))); + __COPY(str, *x->conval->ext, 256); _o_result = x; return _o_result; } @@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int)__CAP((CHAR)z->conval->intval); + z->conval->intval = __CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_booltyp; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37); - OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37); + OPM_LogWNum(*ConstOp__13_s->f, 0); OPM_LogWLn(); break; } @@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; - OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*y, OPB_NewIntConst(0)); } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } } _o_result = ok; @@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_booltyp; } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13); + OPM_LogWStr((CHAR*)"ELSE in Op()", 13); OPM_LogWLn(); OPB_err(108); typ = OPT_undftyp; @@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); - OPM_LogWNum(op, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32); + OPM_LogWNum(op, 0); OPM_LogWLn(); break; } @@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22); + OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); } y = ynode->typ; f = x->form; g = y->form; if (OPM_Verbose) { - OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10); - OPM_LogWNum(y->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"y.form = ", 10); + OPM_LogWNum(y->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", (LONGINT)5); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"f = ", 5); + OPM_LogWNum(f, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", (LONGINT)5); - OPM_LogWNum(g, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"g = ", 5); + OPM_LogWNum(g, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18); - OPM_LogWNum(ynode->typ->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); + OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { @@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(0); break; case 3: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; case 4: case 5: case 6: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: - x = OPB_NewIntConst(((LONGINT)(0))); + x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; case 7: @@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewBoolConst(1); break; case 3: - x = OPB_NewIntConst(((LONGINT)(255))); + x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; case 4: case 5: case 6: @@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 12: if (x->class != 8) { OPB_err(110); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { OPB_err(111); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } break; case 21: @@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39); - OPM_LogWNum(fctno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39); + OPM_LogWNum(fctno, 0); OPM_LogWLn(); break; } @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!__IN(f, 0x70) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int)x->conval->intval; + L = (SYSTEM_INT32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } } else { if (((fctno == 13 || fctno == 14) && parno == 1)) { - OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1)))); + OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1)); p->subcl = fctno; p->right->typ = p->left->typ; } else if ((fctno == 17 && parno == 1)) { @@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) } else if (fctno == 32) { if (parno == 1) { x = NIL; - OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0)); x->conval = OPT_NewConst(); x->conval->intval = OPM_errpos; OPB_Construct(15, &p, x); @@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; - OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); + OPB_Index(&*x, OPB_NewIntConst(0)); } if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index ccef7627..0b71f987 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a5276b17..57fdcb05 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -63,6 +63,7 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); +export void OPC_IntLiteral (LONGINT n, LONGINT size); export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static INTEGER OPC_Length (CHAR *s, LONGINT s__len); @@ -179,7 +180,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int)s[__X(i, s__len)]; + h = 3 * h + s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -192,10 +193,10 @@ void OPC_Ident (OPT_Object obj) mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - h = OPC_PerfectHash((void*)obj->name, ((LONGINT)(256))); - if (OPC_hashtab[__X(h, ((LONGINT)(105)))] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, ((LONGINT)(105)))], ((LONGINT)(36)))], obj->name) == 0) { + OPM_WriteStringVar((void*)obj->name, 256); + h = OPC_PerfectHash((void*)obj->name, 256); + if (OPC_hashtab[__X(h, 105)] >= 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { OPM_Write('_'); } } @@ -204,18 +205,18 @@ void OPC_Ident (OPT_Object obj) if (mode == 13) { OPC_Ident(obj->link->typ->strobj); } else if (level < 0) { - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-level, 64)]->name, 256); if (OPM_currFile == 0) { - OPT_GlbMod[__X(-level, ((LONGINT)(64)))]->vis = 1; + OPT_GlbMod[__X(-level, 64)]->vis = 1; } } else { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); + OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { - OPM_WriteString((CHAR*)"SYSTEM_", (LONGINT)8); + OPM_WriteString((CHAR*)"SYSTEM_", 8); } - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)obj->name, 256); } } @@ -291,7 +292,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); } else { - OPM_WriteString((CHAR*)")()", (LONGINT)4); + OPM_WriteString((CHAR*)")()", 4); } break; } else if (comp == 2) { @@ -309,8 +310,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) void OPC_Andent (OPT_Struct typ) { if (typ->strobj == NIL || typ->align >= 65536) { - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPC_Str1((CHAR*)"__#", (LONGINT)4, __ASHR(typ->align, 16)); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPC_Str1((CHAR*)"__#", 4, __ASHR(typ->align, 16)); } else { OPC_Ident(typ->strobj); } @@ -337,17 +338,17 @@ static void OPC_DeclareBase (OPT_Object dcl) } obj = typ->strobj; if (typ->form == 12) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { - OPM_WriteString((CHAR*)" { /* ", (LONGINT)7); + OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); OPC_Indent(1); } else { @@ -364,10 +365,10 @@ static void OPC_DeclareBase (OPT_Object dcl) nofdims += 1; typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); + OPM_WriteString((CHAR*)"struct ", 8); OPC_BegBlk(); OPC_BegStat(); - OPC_Str1((CHAR*)"LONGINT len[#]", (LONGINT)15, nofdims); + OPC_Str1((CHAR*)"LONGINT len[#]", 15, nofdims); OPC_EndStat(); OPC_BegStat(); __NEW(obj, OPT_ObjDesc); @@ -437,7 +438,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) LONGINT n, i; if ((typ->form == 13 && typ->sysflag == 0)) { OPM_WriteInt(adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -454,7 +455,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPC_PutPtrOffsets(fld->typ, adr + fld->adr, &*cnt); } else { OPM_WriteInt(adr + fld->adr); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); *cnt += 1; if (__MASK(*cnt, -16) == 0) { OPM_WriteLn(); @@ -486,11 +487,11 @@ static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj) OPC_InitTProcs(typ, obj->left); if (obj->mode == 13) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITBP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITBP(", 10); OPC_Ident(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(obj); - OPC_Str1((CHAR*)", #)", (LONGINT)5, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #)", 5, __ASHR(obj->adr, 16)); OPC_EndStat(); } OPC_InitTProcs(typ, obj->right); @@ -502,8 +503,8 @@ static void OPC_PutBase (OPT_Struct typ) if (typ != NIL) { OPC_PutBase(typ->BaseTyp); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)", ", 3); } } @@ -513,19 +514,19 @@ static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamNa INTEGER dim; if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); } dim = 1; typ = par->typ->BaseTyp; while (typ->comp == 3) { if (ansiDefine) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); } else { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } if (showParamName) { OPC_Ident(par); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); } typ = typ->BaseTyp; @@ -538,7 +539,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPM_Write('('); while (par != NIL) { if (macro) { - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)par->name, 256); } else { if ((par->mode == 1 && par->typ->form == 7)) { OPM_Write('_'); @@ -546,16 +547,16 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) OPC_Ident(par); } if (par->typ->comp == 3) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_LenList(par, 0, 1); } else if ((par->mode == 2 && par->typ->comp == 4)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteStringVar((void*)par->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteStringVar((void*)par->name, 256); + OPM_WriteString((CHAR*)"__typ", 6); } par = par->link; if (par != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -587,7 +588,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) if (OPM_currFile == 0) { if (obj->vis == 1) { OPC_DefineTProcTypes(obj); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); *empty = 0; OPC_ProcHeader(obj, 0); } @@ -595,9 +596,9 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) *empty = 0; OPC_DefineTProcTypes(obj); if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -631,31 +632,31 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) if (obj != NIL) { OPC_DefineTProcMacros(obj->left, &*empty); if ((((obj->mode == 13 && obj == OPC_BaseTProc(obj))) && (OPM_currFile != 0 || obj->vis == 1))) { - OPM_WriteString((CHAR*)"#define __", (LONGINT)11); + OPM_WriteString((CHAR*)"#define __", 11); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); - OPM_WriteString((CHAR*)" __SEND(", (LONGINT)9); + OPM_WriteString((CHAR*)" __SEND(", 9); if (obj->link->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); } else { OPC_Ident(obj->link); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } - OPC_Str1((CHAR*)", #, ", (LONGINT)6, __ASHR(obj->adr, 16)); + OPC_Str1((CHAR*)", #, ", 6, __ASHR(obj->adr, 16)); if (obj->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(obj->typ->strobj); } - OPM_WriteString((CHAR*)"(*)", (LONGINT)4); + OPM_WriteString((CHAR*)"(*)", 4); if (OPC_ansi) { OPC_AnsiParamList(obj->link, 0); } else { - OPM_WriteString((CHAR*)"()", (LONGINT)3); + OPM_WriteString((CHAR*)"()", 3); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); OPM_WriteLn(); @@ -710,7 +711,7 @@ static void OPC_DefineType (OPT_Struct str) } } if ((obj != NIL && OPC_Undefined(obj))) { - OPM_WriteString((CHAR*)"typedef", (LONGINT)8); + OPM_WriteString((CHAR*)"typedef", 8); OPM_WriteLn(); OPM_Write(0x09); OPC_Indent(1); @@ -743,7 +744,7 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; - while ((*x)[__X(i + 1, ((LONGINT)(256)))] == y[__X(i, y__len)]) { + while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } r = y[__X(i, y__len)] == 0x00; @@ -759,19 +760,19 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; - if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", (LONGINT)8) || OPC_Prefixed(ext, (CHAR*)"import ", (LONGINT)8)))) { - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); + if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { + OPM_WriteString((CHAR*)"#define ", 9); OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int)(*obj->conval->ext)[0]; + _for__9 = (*obj->conval->ext)[0]; i = i; while (i <= _for__9) { - OPM_Write((*obj->conval->ext)[__X(i, ((LONGINT)(256)))]); + OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } OPM_WriteLn(); @@ -815,34 +816,34 @@ void OPC_TDescDecl (OPT_Struct typ) LONGINT nofptrs; OPT_Object o = NIL; OPC_BegStat(); - OPM_WriteString((CHAR*)"__TDESC(", (LONGINT)9); + OPM_WriteString((CHAR*)"__TDESC(", 9); OPC_Andent(typ); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->n + 1); - OPC_Str1((CHAR*)", #) = {__TDFLDS(", (LONGINT)18, OPC_NofPtrs(typ)); + OPC_Str1((CHAR*)", #", 4, typ->n + 1); + OPC_Str1((CHAR*)", #) = {__TDFLDS(", 18, OPC_NofPtrs(typ)); OPM_Write('"'); if (typ->strobj != NIL) { - OPM_WriteStringVar((void*)typ->strobj->name, ((LONGINT)(256))); + OPM_WriteStringVar((void*)typ->strobj->name, 256); } OPM_Write('"'); - OPC_Str1((CHAR*)", #), {", (LONGINT)8, typ->size); + OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; - OPC_PutPtrOffsets(typ, ((LONGINT)(0)), &nofptrs); - OPC_Str1((CHAR*)"#}}", (LONGINT)4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_PutPtrOffsets(typ, 0, &nofptrs); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); OPC_EndStat(); } void OPC_InitTDesc (OPT_Struct typ) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__INITYP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__INITYP(", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->BaseTyp != NIL) { OPC_Andent(typ->BaseTyp); } else { OPC_Andent(typ); } - OPC_Str1((CHAR*)", #)", (LONGINT)5, typ->extlev); + OPC_Str1((CHAR*)", #)", 5, typ->extlev); OPC_EndStat(); if (typ->strobj != NIL) { OPC_InitTProcs(typ->strobj, typ->link); @@ -911,22 +912,22 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO gap -= (adr - off) + align; OPC_BegStat(); if (align == (SYSTEM_INT64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", (LONGINT)8); + OPM_WriteString((CHAR*)"INTEGER", 8); } else if (align == (SYSTEM_INT64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", (LONGINT)8); + OPM_WriteString((CHAR*)"LONGINT", 8); } else if (align == (SYSTEM_INT64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGREAL", 9); } - OPC_Str1((CHAR*)" _prvt#", (LONGINT)8, *n); + OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; OPC_EndStat(); *curAlign = align; } if (gap > 0) { OPC_BegStat(); - OPC_Str1((CHAR*)"char _prvt#", (LONGINT)12, *n); + OPC_Str1((CHAR*)"char _prvt#", 12, *n); *n += 1; - OPC_Str1((CHAR*)"[#]", (LONGINT)4, gap); + OPC_Str1((CHAR*)"[#]", 4, gap); OPC_EndStat(); } } @@ -970,7 +971,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * base = fld->typ; fld = fld->link; while ((((((((fld != NIL && fld->mode == 4)) && fld->typ == base)) && fld->adr == *off)) && ((OPM_currFile == 1 || fld->vis != 0) || fld->typ->strobj == NIL))) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_DeclareObj(fld, 0); *off = fld->adr + fld->typ->size; fld = fld->link; @@ -1000,7 +1001,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int)obj->vis != lastvis) { + if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1009,16 +1010,16 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) lastvis = obj->vis; OPC_BegStat(); if ((vis == 1 && obj->vis != 0)) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((obj->mnolev == 0 && vis == 0)) { if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } } if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { - OPM_WriteString((CHAR*)"double", (LONGINT)7); + OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); } @@ -1034,17 +1035,17 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_EndStat(); OPC_BegStat(); base = OPT_linttyp; - OPM_WriteString((CHAR*)"LONGINT ", (LONGINT)9); + OPM_WriteString((CHAR*)"LONGINT ", 9); OPC_LenList(obj, 0, 1); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); base = NIL; } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { - OPM_WriteString((CHAR*)" = NIL", (LONGINT)7); + OPM_WriteString((CHAR*)" = NIL", 7); } } obj = obj->link; @@ -1059,7 +1060,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) CHAR name[32]; OPM_Write('('); if (obj == NIL || obj->mode == 13) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { for (;;) { OPC_DeclareBase(obj); @@ -1067,25 +1068,25 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_Write(' '); OPC_DeclareObj(obj, 0); } else { - __COPY(obj->name, name, ((LONGINT)(32))); + __COPY(obj->name, name, 32); obj->name[0] = 0x00; OPC_DeclareObj(obj, 0); - __COPY(name, obj->name, ((LONGINT)(256))); + __COPY(name, obj->name, 256); } if (obj->typ->comp == 3) { - OPM_WriteString((CHAR*)", LONGINT ", (LONGINT)11); + OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", (LONGINT)12); + OPM_WriteString((CHAR*)", LONGINT *", 12); if (showParamNames) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } } if (obj->link == NIL || obj->link->mode == 13) { break; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); obj = obj->link; } } @@ -1095,7 +1096,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) { if (proc->typ == OPT_notyp) { - OPM_WriteString((CHAR*)"void", (LONGINT)5); + OPM_WriteString((CHAR*)"void", 5); } else { OPC_Ident(proc->typ->strobj); } @@ -1115,7 +1116,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPC_IdentList(proc->link, 2); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"();", (LONGINT)4); + OPM_WriteString((CHAR*)"();", 4); OPM_WriteLn(); } } @@ -1126,11 +1127,11 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) OPC_ProcPredefs(obj->left, vis); if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } OPC_ProcHeader(obj, 0); } @@ -1141,10 +1142,10 @@ static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) static void OPC_Include (CHAR *name, LONGINT name__len) { __DUP(name, name__len, CHAR); - OPM_WriteString((CHAR*)"#include ", (LONGINT)10); + OPM_WriteString((CHAR*)"#include ", 10); OPM_Write('"'); OPM_WriteStringVar((void*)name, name__len); - OPM_WriteString((CHAR*)".h", (LONGINT)3); + OPM_WriteString((CHAR*)".h", 3); OPM_Write('"'); OPM_WriteLn(); __DEL(name); @@ -1154,8 +1155,8 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->vis >= vis)) { - OPC_Include(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } @@ -1169,15 +1170,15 @@ static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) if (vis == 0 || typ->ref < 255) { OPC_BegStat(); if (vis == 1) { - OPM_WriteString((CHAR*)"import ", (LONGINT)8); + OPM_WriteString((CHAR*)"import ", 8); } else if ((typ->strobj != NIL && typ->strobj->mnolev > 0)) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } else { - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", (LONGINT)10); + OPM_WriteString((CHAR*)"LONGINT *", 10); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); } n = n->link; @@ -1195,25 +1196,25 @@ void OPC_GenHdr (OPT_Node n) OPC_GenDynTypes(n, 1); OPM_WriteLn(); OPC_ProcPredefs(OPT_topScope->right, 1); - OPM_WriteString((CHAR*)"import ", (LONGINT)8); - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"import ", 8); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPC_EndStat(); OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", (LONGINT)7); + OPM_WriteString((CHAR*)"#endif", 7); OPM_WriteLn(); } static void OPC_GenHeaderMsg (void) { INTEGER i; - OPM_WriteString((CHAR*)"/* ", (LONGINT)4); - OPM_WriteString((CHAR*)"voc", (LONGINT)4); + OPM_WriteString((CHAR*)"/* ", 4); + OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, ((LONGINT)(41))); + OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; while (i <= 63) { @@ -1265,14 +1266,14 @@ static void OPC_GenHeaderMsg (void) OPM_Write('v'); break; default: - OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", (LONGINT)126); + OPM_LogWStr((CHAR*)"( more options defined in OPM than checked in OPC.GenHeaderMsg, if you are a compiler developer, add them to OPC.GenHeaderMsg", 126); OPM_LogWLn(); break; } } i += 1; } - OPM_WriteString((CHAR*)" */", (LONGINT)4); + OPM_WriteString((CHAR*)" */", 4); OPM_WriteLn(); } @@ -1281,20 +1282,20 @@ void OPC_GenHdrIncludes (void) OPM_currFile = 2; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#ifndef ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#ifndef ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define ", (LONGINT)9); - OPM_WriteStringVar((void*)OPM_modName, ((LONGINT)(32))); - OPM_WriteString((CHAR*)"__h", (LONGINT)4); + OPM_WriteString((CHAR*)"#define ", 9); + OPM_WriteStringVar((void*)OPM_modName, 32); + OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); } @@ -1304,10 +1305,10 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", (LONGINT)14); + OPM_WriteString((CHAR*)"#define LARGE", 14); OPM_WriteLn(); } - OPC_Include((CHAR*)"SYSTEM", (LONGINT)7); + OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); OPC_DefAnonRecs(n); @@ -1330,9 +1331,9 @@ static void OPC_RegCmds (OPT_Object obj) if ((obj->mode == 7 && obj->history != 4)) { if ((((obj->vis != 0 && obj->link == NIL)) && obj->typ == OPT_notyp)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__REGCMD(\"", (LONGINT)11); - OPM_WriteStringVar((void*)obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"\", ", (LONGINT)4); + OPM_WriteString((CHAR*)"__REGCMD(\"", 11); + OPM_WriteStringVar((void*)obj->name, 256); + OPM_WriteString((CHAR*)"\", ", 4); OPC_Ident(obj); OPM_Write(')'); OPC_EndStat(); @@ -1348,8 +1349,8 @@ static void OPC_InitImports (OPT_Object obj) OPC_InitImports(obj->left); if ((obj->mode == 11 && obj->mnolev != 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"__MODULE_IMPORT(", (LONGINT)17); - OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"__MODULE_IMPORT(", 17); + OPM_WriteStringVar((void*)OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); OPM_Write(')'); OPC_EndStat(); } @@ -1367,31 +1368,31 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", (LONGINT)32); + OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", (LONGINT)17); + OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", (LONGINT)13); + OPM_WriteString((CHAR*)"void (*P)();", 13); } OPM_WriteLn(); OPC_BegBlk(); } OPC_BegStat(); if (typ->form == 13) { - OPM_WriteString((CHAR*)"P(", (LONGINT)3); + OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(&", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENUMR(&", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPM_WriteString((CHAR*)", 1, P)", (LONGINT)8); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPM_WriteString((CHAR*)", 1, P)", 8); } else if (typ->comp == 2) { n = typ->n; typ = typ->BaseTyp; @@ -1400,17 +1401,17 @@ void OPC_GenEnumPtrs (OPT_Object var) typ = typ->BaseTyp; } if (typ->form == 13) { - OPM_WriteString((CHAR*)"__ENUMP(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPC_Str1((CHAR*)", #, P)", 8, n); } else if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__ENUMR(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENUMR(", 9); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPC_Str1((CHAR*)", #", (LONGINT)4, typ->size); - OPC_Str1((CHAR*)", #, P)", (LONGINT)8, n); + OPM_WriteString((CHAR*)"__typ", 6); + OPC_Str1((CHAR*)", #", 4, typ->size); + OPC_Str1((CHAR*)", #, P)", 8, n); } } OPC_EndStat(); @@ -1426,49 +1427,49 @@ void OPC_GenEnumPtrs (OPT_Object var) void OPC_EnterBody (void) { OPM_WriteLn(); - OPM_WriteString((CHAR*)"export ", (LONGINT)8); + OPM_WriteString((CHAR*)"export ", 8); if (OPC_mainprog) { if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", (LONGINT)32); + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { - OPM_WriteString((CHAR*)"main(argc, argv)", (LONGINT)17); + OPM_WriteString((CHAR*)"main(argc, argv)", 17); OPM_WriteLn(); OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", (LONGINT)23); + OPM_WriteString((CHAR*)"int argc; char **argv;", 23); OPM_WriteLn(); } } else { - OPM_WriteString((CHAR*)"void *", (LONGINT)7); - OPM_WriteString(OPM_modName, ((LONGINT)(32))); - OPM_WriteString(OPC_BodyNameExt, ((LONGINT)(13))); + OPM_WriteString((CHAR*)"void *", 7); + OPM_WriteString(OPM_modName, 32); + OPM_WriteString(OPC_BodyNameExt, 13); OPM_WriteLn(); } OPC_BegBlk(); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__INIT(argc, argv)", (LONGINT)19); + OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { - OPM_WriteString((CHAR*)"__DEFMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); if ((OPC_mainprog && 0)) { OPC_BegStat(); - OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", (LONGINT)94); + OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__REGMAIN(\"", (LONGINT)12); + OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { - OPM_WriteString((CHAR*)"__REGMOD(\"", (LONGINT)11); + OPM_WriteString((CHAR*)"__REGMOD(\"", 11); } - OPM_WriteString(OPM_modName, ((LONGINT)(32))); + OPM_WriteString(OPM_modName, 32); if (OPC_GlbPtrs) { - OPM_WriteString((CHAR*)"\", EnumPtrs)", (LONGINT)13); + OPM_WriteString((CHAR*)"\", EnumPtrs)", 13); } else { - OPM_WriteString((CHAR*)"\", 0)", (LONGINT)6); + OPM_WriteString((CHAR*)"\", 0)", 6); } OPC_EndStat(); if (__STRCMP(OPM_modName, "SYSTEM") != 0) { @@ -1480,9 +1481,9 @@ void OPC_ExitBody (void) { OPC_BegStat(); if (OPC_mainprog) { - OPM_WriteString((CHAR*)"__FINI;", (LONGINT)8); + OPM_WriteString((CHAR*)"__FINI;", 8); } else { - OPM_WriteString((CHAR*)"__ENDMOD;", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENDMOD;", 10); } OPM_WriteLn(); OPC_EndBlk(); @@ -1492,25 +1493,25 @@ void OPC_DefineInter (OPT_Object proc) { OPT_Object scope = NIL; scope = proc->scope; - OPM_WriteString((CHAR*)"static ", (LONGINT)8); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"static ", 8); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPC_BegBlk(); OPC_IdentList(proc->link, 3); OPC_IdentList(scope->scope, 3); OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); OPM_Write('*'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); OPC_EndBlk0(); OPM_Write(' '); OPM_Write('*'); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPM_WriteLn(); OPC_ProcPredefs(scope->right, 0); @@ -1523,24 +1524,24 @@ void OPC_EnterProc (OPT_Object proc) OPT_Struct typ = NIL; INTEGER dim; if (proc->vis != 1) { - OPM_WriteString((CHAR*)"static ", (LONGINT)8); + OPM_WriteString((CHAR*)"static ", 8); } OPC_ProcHeader(proc, 1); OPC_BegBlk(); if (proc->typ != OPT_notyp) { OPC_BegStat(); OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", (LONGINT)12); + OPM_WriteString((CHAR*)" _o_result;", 12); OPM_WriteLn(); } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"struct ", (LONGINT)8); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); + OPM_WriteString((CHAR*)"struct ", 8); + OPM_WriteStringVar((void*)scope->name, 256); OPM_Write(' '); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } var = proc->link; @@ -1554,7 +1555,7 @@ void OPC_EnterProc (OPT_Object proc) } OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)"__copy", (LONGINT)7); + OPM_WriteString((CHAR*)"__copy", 7); OPC_EndStat(); } var = var->link; @@ -1567,7 +1568,7 @@ void OPC_EnterProc (OPT_Object proc) OPC_Ident(var->typ->strobj); OPM_Write(' '); OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", (LONGINT)5); + OPM_WriteString((CHAR*)" = _", 5); OPC_Ident(var); OPC_EndStat(); } @@ -1579,31 +1580,31 @@ void OPC_EnterProc (OPT_Object proc) if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { - OPM_WriteString((CHAR*)"__DUPARR(", (LONGINT)10); + OPM_WriteString((CHAR*)"__DUPARR(", 10); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (var->typ->strobj == NIL) { OPM_Mark(200, var->typ->txtpos); } else { OPC_Ident(var->typ->strobj); } } else { - OPM_WriteString((CHAR*)"__DUP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DUP(", 7); OPC_Ident(var); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); typ = var->typ->BaseTyp; dim = 1; while (typ->comp == 3) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); OPM_WriteInt(dim); typ = typ->BaseTyp; dim += 1; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->strobj == NIL) { OPM_Mark(200, typ->txtpos); } else { @@ -1620,12 +1621,12 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (__IN(var->typ->comp, 0x0c)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); } @@ -1634,31 +1635,31 @@ void OPC_EnterProc (OPT_Object proc) typ = var->typ; dim = 0; do { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } typ = typ->BaseTyp; } while (!(typ->comp != 3)); } else if ((var->mode == 2 && var->typ->comp == 4)) { - OPM_WriteString((CHAR*)"; ", (LONGINT)3); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"; ", 3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)"__typ", 6); + OPM_WriteString((CHAR*)" = ", 4); OPC_Ident(var); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } OPC_EndStat(); } @@ -1668,14 +1669,14 @@ void OPC_EnterProc (OPT_Object proc) while (var != NIL) { if (!var->leaf) { OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); OPC_Ident(var); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); if (var->typ->comp != 2) { OPM_Write('&'); } else { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPC_Ident(var); OPC_EndStat(); @@ -1683,19 +1684,19 @@ void OPC_EnterProc (OPT_Object proc) var = var->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"lnk", 4); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); OPC_BegStat(); - OPM_WriteStringVar((void*)scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteStringVar((void*)scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); OPM_Write('&'); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } } @@ -1707,7 +1708,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) indent = eoBlock; if ((implicitRet && proc->typ != OPT_notyp)) { OPM_Write(0x09); - OPM_WriteString((CHAR*)"__RETCHK;", (LONGINT)10); + OPM_WriteString((CHAR*)"__RETCHK;", 10); OPM_WriteLn(); } else if (!eoBlock || implicitRet) { if (!proc->scope->leaf) { @@ -1716,12 +1717,12 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteStringVar((void*)proc->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); + OPM_WriteStringVar((void*)proc->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)" = ", 4); + OPM_WriteString((CHAR*)"_s", 3); OPM_Write('.'); - OPM_WriteString((CHAR*)"lnk", (LONGINT)4); + OPM_WriteString((CHAR*)"lnk", 4); OPC_EndStat(); } var = proc->link; @@ -1732,7 +1733,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) } else { indent = 1; } - OPM_WriteString((CHAR*)"__DEL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DEL(", 7); OPC_Ident(var); OPM_Write(')'); OPC_EndStat(); @@ -1755,9 +1756,9 @@ void OPC_CompleteIdent (OPT_Object obj) if (obj->adr == 1) { if (obj->typ->comp == 4) { OPC_Ident(obj); - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); } else { - OPM_WriteString((CHAR*)"((", (LONGINT)3); + OPM_WriteString((CHAR*)"((", 3); OPC_Ident(obj->typ->strobj); OPM_Write(')'); OPC_Ident(obj); @@ -1768,9 +1769,9 @@ void OPC_CompleteIdent (OPT_Object obj) if ((obj->mode != 2 && comp != 3)) { OPM_Write('*'); } - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s", (LONGINT)3); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"_s", 3); + OPM_WriteString((CHAR*)"->", 3); OPC_Ident(obj); } else { OPC_Ident(obj); @@ -1782,17 +1783,17 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int)ap->mnolev != OPM_level) { - OPM_WriteStringVar((void*)ap->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"_s->", (LONGINT)5); + if (ap->mnolev != OPM_level) { + OPM_WriteStringVar((void*)ap->scope->name, 256); + OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); } else { OPC_Ident(ap); } - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (ap->typ->strobj != NIL) { OPC_Ident(ap->typ->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else { OPC_Andent(ap->typ); } @@ -1802,26 +1803,26 @@ void OPC_Cmp (INTEGER rel) { switch (rel) { case 9: - OPM_WriteString((CHAR*)" == ", (LONGINT)5); + OPM_WriteString((CHAR*)" == ", 5); break; case 10: - OPM_WriteString((CHAR*)" != ", (LONGINT)5); + OPM_WriteString((CHAR*)" != ", 5); break; case 11: - OPM_WriteString((CHAR*)" < ", (LONGINT)4); + OPM_WriteString((CHAR*)" < ", 4); break; case 12: - OPM_WriteString((CHAR*)" <= ", (LONGINT)5); + OPM_WriteString((CHAR*)" <= ", 5); break; case 13: - OPM_WriteString((CHAR*)" > ", (LONGINT)4); + OPM_WriteString((CHAR*)" > ", 4); break; case 14: - OPM_WriteString((CHAR*)" >= ", (LONGINT)5); + OPM_WriteString((CHAR*)" >= ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", (LONGINT)34); - OPM_LogWNum(rel, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Cmp, rel = ", 34); + OPM_LogWNum(rel, 0); OPM_LogWLn(); break; } @@ -1830,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) static void OPC_CharacterLiteral (LONGINT c) { if (c < 32 || c > 126) { - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); OPM_WriteHex(c); } else { OPM_Write('\''); @@ -1850,7 +1851,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = (int)s[__X(i, s__len)]; + c = s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1873,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) void OPC_Case (LONGINT caseVal, INTEGER form) { CHAR ch; - OPM_WriteString((CHAR*)"case ", (LONGINT)6); + OPM_WriteString((CHAR*)"case ", 6); switch (form) { case 3: OPC_CharacterLiteral(caseVal); @@ -1882,42 +1883,68 @@ void OPC_Case (LONGINT caseVal, INTEGER form) OPM_WriteInt(caseVal); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", (LONGINT)36); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Case, form = ", 36); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } - OPM_WriteString((CHAR*)": ", (LONGINT)3); + OPM_WriteString((CHAR*)": ", 3); } void OPC_SetInclude (BOOLEAN exclude) { if (exclude) { - OPM_WriteString((CHAR*)" &= ~", (LONGINT)6); + OPM_WriteString((CHAR*)" &= ~", 6); } else { - OPM_WriteString((CHAR*)" |= ", (LONGINT)5); + OPM_WriteString((CHAR*)" |= ", 5); } } void OPC_Increment (BOOLEAN decrement) { if (decrement) { - OPM_WriteString((CHAR*)" -= ", (LONGINT)5); + OPM_WriteString((CHAR*)" -= ", 5); } else { - OPM_WriteString((CHAR*)" += ", (LONGINT)5); + OPM_WriteString((CHAR*)" += ", 5); } } void OPC_Halt (LONGINT n) { - OPC_Str1((CHAR*)"__HALT(#)", (LONGINT)10, n); + OPC_Str1((CHAR*)"__HALT(#)", 10, n); +} + +void OPC_IntLiteral (LONGINT n, LONGINT size) +{ + if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { + switch (size) { + case 2: + OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); + break; + case 4: + OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); + break; + case 8: + OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); + OPM_LogWNum(size, 1); + OPM_LogWLn(); + break; + } + OPM_WriteInt(n); + OPM_WriteString((CHAR*)"))", 3); + } else { + OPM_WriteInt(n); + } } void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); - OPM_WriteString((CHAR*)"__len", (LONGINT)6); + OPM_WriteString((CHAR*)"__len", 6); if (dim != 0) { OPM_WriteInt(dim); } @@ -1926,9 +1953,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) array = array->BaseTyp; dim -= 1; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(array->n); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + if (OPC_ansi) { + OPM_WriteInt(array->n); + } else { + OPC_IntLiteral(array->n, OPM_PointerSize); + } } } @@ -1958,7 +1987,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_WriteReal(con->realval, 0x00); break; case 9: - OPM_WriteString((CHAR*)"0x", (LONGINT)3); + OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; i = 64; @@ -1981,14 +2010,14 @@ void OPC_Constant (OPT_Const con, INTEGER form) } break; case 10: - OPC_StringLiteral(*con->ext, ((LONGINT)(256)), con->intval2 - 1); + OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; case 11: - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", (LONGINT)40); - OPM_LogWNum(form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPC.Constant, form = ", 40); + OPM_LogWNum(form, 0); OPM_LogWLn(); break; } @@ -2006,8 +2035,8 @@ static void Enter__49 (CHAR *s, LONGINT s__len) INTEGER h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, ((LONGINT)(105)))] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, ((LONGINT)(36)))], ((LONGINT)(9))); + OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } @@ -2022,45 +2051,45 @@ static void OPC_InitKeywords (void) n = 0; i = 0; while (i <= 104) { - OPC_hashtab[__X(i, ((LONGINT)(105)))] = -1; + OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"asm", (LONGINT)4); - Enter__49((CHAR*)"auto", (LONGINT)5); - Enter__49((CHAR*)"break", (LONGINT)6); - Enter__49((CHAR*)"case", (LONGINT)5); - Enter__49((CHAR*)"char", (LONGINT)5); - Enter__49((CHAR*)"const", (LONGINT)6); - Enter__49((CHAR*)"continue", (LONGINT)9); - Enter__49((CHAR*)"default", (LONGINT)8); - Enter__49((CHAR*)"do", (LONGINT)3); - Enter__49((CHAR*)"double", (LONGINT)7); - Enter__49((CHAR*)"else", (LONGINT)5); - Enter__49((CHAR*)"enum", (LONGINT)5); - Enter__49((CHAR*)"extern", (LONGINT)7); - Enter__49((CHAR*)"export", (LONGINT)7); - Enter__49((CHAR*)"float", (LONGINT)6); - Enter__49((CHAR*)"for", (LONGINT)4); - Enter__49((CHAR*)"fortran", (LONGINT)8); - Enter__49((CHAR*)"goto", (LONGINT)5); - Enter__49((CHAR*)"if", (LONGINT)3); - Enter__49((CHAR*)"import", (LONGINT)7); - Enter__49((CHAR*)"int", (LONGINT)4); - Enter__49((CHAR*)"long", (LONGINT)5); - Enter__49((CHAR*)"register", (LONGINT)9); - Enter__49((CHAR*)"return", (LONGINT)7); - Enter__49((CHAR*)"short", (LONGINT)6); - Enter__49((CHAR*)"signed", (LONGINT)7); - Enter__49((CHAR*)"sizeof", (LONGINT)7); - Enter__49((CHAR*)"static", (LONGINT)7); - Enter__49((CHAR*)"struct", (LONGINT)7); - Enter__49((CHAR*)"switch", (LONGINT)7); - Enter__49((CHAR*)"typedef", (LONGINT)8); - Enter__49((CHAR*)"union", (LONGINT)6); - Enter__49((CHAR*)"unsigned", (LONGINT)9); - Enter__49((CHAR*)"void", (LONGINT)5); - Enter__49((CHAR*)"volatile", (LONGINT)9); - Enter__49((CHAR*)"while", (LONGINT)6); + Enter__49((CHAR*)"asm", 4); + Enter__49((CHAR*)"auto", 5); + Enter__49((CHAR*)"break", 6); + Enter__49((CHAR*)"case", 5); + Enter__49((CHAR*)"char", 5); + Enter__49((CHAR*)"const", 6); + Enter__49((CHAR*)"continue", 9); + Enter__49((CHAR*)"default", 8); + Enter__49((CHAR*)"do", 3); + Enter__49((CHAR*)"double", 7); + Enter__49((CHAR*)"else", 5); + Enter__49((CHAR*)"enum", 5); + Enter__49((CHAR*)"extern", 7); + Enter__49((CHAR*)"export", 7); + Enter__49((CHAR*)"float", 6); + Enter__49((CHAR*)"for", 4); + Enter__49((CHAR*)"fortran", 8); + Enter__49((CHAR*)"goto", 5); + Enter__49((CHAR*)"if", 3); + Enter__49((CHAR*)"import", 7); + Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"long", 5); + Enter__49((CHAR*)"register", 9); + Enter__49((CHAR*)"return", 7); + Enter__49((CHAR*)"short", 6); + Enter__49((CHAR*)"signed", 7); + Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"static", 7); + Enter__49((CHAR*)"struct", 7); + Enter__49((CHAR*)"switch", 7); + Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"union", 6); + Enter__49((CHAR*)"unsigned", 9); + Enter__49((CHAR*)"void", 5); + Enter__49((CHAR*)"volatile", 9); + Enter__49((CHAR*)"while", 6); InitKeywords__48_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index de932c60..21b48db8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (INTEGER count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); +import void OPC_IntLiteral (LONGINT n, LONGINT size); import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); import LONGINT OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0e43a013..edc81f01 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int)s[__X(i, s__len)] - 48; + OPM_IntSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int)s[__X(i, s__len)] - 48; + OPM_PointerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int)s[__X(i, s__len)] - 48; + OPM_Alignment = s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); - Files_SetSearchPath((CHAR*)"", (LONGINT)1); + Files_SetSearchPath((CHAR*)"", 1); break; case 'F': *opt = *opt ^ 0x020000; @@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) *opt = *opt ^ 0x040000; break; default: - OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19); + OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); OPM_LogW(s[__X(i, s__len)]); - OPM_LogWStr((CHAR*)" ignored", (LONGINT)9); + OPM_LogWStr((CHAR*)" ignored", 9); OPM_LogWLn(); break; } @@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27); - OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41))); + OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7); + OPM_LogWStr((CHAR*)"Usage:", 7); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr((CHAR*)"voc", (LONGINT)4); - OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr((CHAR*)"voc", 4); + OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33); + OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36); + OPM_LogWStr((CHAR*)" m - generate code for main module", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63); + OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31); + OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43); + OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25); + OPM_LogWStr((CHAR*)" r - check value ranges", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35); + OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80); + OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48); + OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101); + OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67); + OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24); + OPM_LogWStr((CHAR*)" c - don't call linker", 24); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29); + OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57); + OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21); + OPM_LogWStr((CHAR*)" V - verbose output", 21); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48); + OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56); + OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39); + OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); _o_result = 0; return _o_result; } else { OPM_S = 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); OPM_glbopt = 0xe9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt); + OPM_ScanOptions((void*)s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } _o_result = 1; return _o_result; @@ -277,12 +277,12 @@ void OPM_InitOptions (void) CHAR s[256]; OPM_opt = OPM_glbopt; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt); + OPM_ScanOptions((void*)s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); } OPM_dontAsm = __IN(13, OPM_opt); OPM_dontLink = __IN(14, OPM_opt); @@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) return; } s[0] = 0x00; - Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256))); + Platform_GetArg(OPM_S, (void*)s, 256); __NEW(T, Texts_TextDesc); - Texts_Open(T, s, ((LONGINT)(256))); - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + Texts_Open(T, s, 256); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" ", 3); __COPY(s, mname, mname__len); - __COPY(s, OPM_SourceFileName, ((LONGINT)(256))); + __COPY(s, OPM_SourceFileName, 256); if (T->len == 0) { - OPM_LogWStr(s, ((LONGINT)(256))); - OPM_LogWStr((CHAR*)" not found.", (LONGINT)12); + OPM_LogWStr(s, 256); + OPM_LogWStr((CHAR*)" not found.", 12); OPM_LogWLn(); } else { - Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0); *done = 1; } OPM_S += 1; @@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n) CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"31m", (LONGINT)4); + vt100_SetAttr((CHAR*)"31m", 4); } - OPM_LogWStr((CHAR*)" err ", (LONGINT)7); + OPM_LogWStr((CHAR*)" err ", 7); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"35m", (LONGINT)4); + vt100_SetAttr((CHAR*)"35m", 4); } - OPM_LogWStr((CHAR*)" warning ", (LONGINT)11); + OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } - OPM_LogWNum(n, ((LONGINT)(1))); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128))); + OPM_LogWNum(n, 1); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWStr(errors_errors[__X(n, 350)], 128); } static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) @@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos) CHAR line[1023]; INTEGER i; CHAR ch; - f = Files_Old(OPM_SourceFileName, ((LONGINT)(256))); + f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); i = 0; Files_Read(&r, Files_Rider__typ, (void*)&ch); while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) { - line[__X(i, ((LONGINT)(1023)))] = ch; + line[__X(i, 1023)] = ch; i += 1; Files_Read(&r, Files_Rider__typ, (void*)&ch); } - line[__X(i, ((LONGINT)(1023)))] = 0x00; + line[__X(i, 1023)] = 0x00; OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4))); - OPM_LogWStr((CHAR*)": ", (LONGINT)3); - OPM_LogWStr(line, ((LONGINT)(1023))); + OPM_LogWNum(OPM_ErrorLineNumber, 4); + OPM_LogWStr((CHAR*)": ", 3); + OPM_LogWStr(line, 1023); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)7); + OPM_LogWStr((CHAR*)" ", 7); if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int)(pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos) OPM_lasterrpos = pos; OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" ", (LONGINT)3); + OPM_LogWStr((CHAR*)" ", 3); if (n < 249) { - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); OPM_LogErrMsg(n); } else if (n == 255) { - OPM_LogWStr((CHAR*)"pos", (LONGINT)4); - OPM_LogWNum(pos, ((LONGINT)(6))); - OPM_LogWStr((CHAR*)" pc ", (LONGINT)6); - OPM_LogWNum(OPM_breakpc, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)"pos", 4); + OPM_LogWNum(pos, 6); + OPM_LogWStr((CHAR*)" pc ", 6); + OPM_LogWNum(OPM_breakpc, 1); } else if (n == 254) { - OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13); + OPM_LogWStr((CHAR*)"pc not found", 13); } else { - OPM_LogWStr(OPM_objname, ((LONGINT)(64))); + OPM_LogWStr(OPM_objname, 64); if (n == 253) { - OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31); + OPM_LogWStr((CHAR*)" is new, compile with option e", 31); } else if (n == 252) { - OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37); + OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37); } else if (n == 251) { - OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57); + OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57); } else if (n == 250) { - OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45); + OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45); } else if (n == 249) { - OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49); + OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49); } } } @@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos) if (pos >= 0) { OPM_ShowLine(pos); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" pos", (LONGINT)6); - OPM_LogWNum(pos, ((LONGINT)(6))); + OPM_LogWStr((CHAR*)" pos", 6); + OPM_LogWNum(pos, 6); } OPM_LogErrMsg(n); if (pos < 0) { @@ -533,19 +533,19 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, __VAL(LONGINT, set)); } void OPM_FPrintReal (LONGINT *fp, REAL real) { INTEGER i; LONGINT l; - __GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER); + __GET((SYSTEM_ADRINT)&real, i, INTEGER); l = i; OPM_FPrint(&*fp, l); } @@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int)(*S).i; + *size = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int)(*S).i; + *align = (SYSTEM_INT32)(*S).i; Texts_Scan(&*S, S__typ); } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } } else { - OPM_Mark(-157, ((LONGINT)(-1))); + OPM_Mark(-157, -1); } __DEL(name); } @@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29); + OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14); - OPM_LogWNum(OPM_CharSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"CHAR ", 14); + OPM_LogWNum(OPM_CharSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14); - OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"BOOLEAN ", 14); + OPM_LogWNum(OPM_BoolSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14); - OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SHORTINT ", 14); + OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14); - OPM_LogWNum(OPM_IntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"INTEGER ", 14); + OPM_LogWNum(OPM_IntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14); - OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGINT ", 14); + OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", (LONGINT)14); - OPM_LogWNum(OPM_SetSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"SET ", 14); + OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14); - OPM_LogWNum(OPM_RealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"REAL ", 14); + OPM_LogWNum(OPM_RealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14); - OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"LONGREAL ", 14); + OPM_LogWNum(OPM_LRealSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14); - OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PTR ", 14); + OPM_LogWNum(OPM_PointerSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14); - OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"PROC ", 14); + OPM_LogWNum(OPM_ProcSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14); - OPM_LogWNum(OPM_RecSize, ((LONGINT)(4))); + OPM_LogWStr((CHAR*)"RECORD ", 14); + OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); OPM_LogWLn(); } @@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { CHAR ch; OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { - Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0))); + Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); if (ch != 0xf7) { OPM_err(-306); @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); } void OPM_SymWReal (REAL r) @@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void) void OPM_NewSym (CHAR *modName, LONGINT modName__len) { OPM_FileName fileName; - OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - OPM_newSFile = Files_New(fileName, ((LONGINT)(32))); + OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); + OPM_newSFile = Files_New(fileName, 32); if (OPM_newSFile != NIL) { - Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0))); + Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); } else { OPM_err(153); @@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) void OPM_Write (CHAR ch) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch); } void OPM_WriteString (CHAR *s, LONGINT s__len) @@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteStringVar (CHAR *s, LONGINT s__len) @@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) while (s[__X(i, s__len)] != 0x00) { i += 1; } - Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i); + Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR((int)i, 4); + digit = __ASHR((SYSTEM_INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int)i, -16); + digit = __MASK((SYSTEM_INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { s[1] = (CHAR)(87 + digit); } s[2] = 0x00; - OPM_WriteString(s, ((LONGINT)(3))); + OPM_WriteString(s, 3); } void OPM_WriteInt (LONGINT i) @@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i) if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); - OPM_WriteString((CHAR*)"-1)", (LONGINT)4); + OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, ((LONGINT)(20)))] = '-'; + s[__X(k, 20)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, ((LONGINT)(20)))]); + OPM_Write(s[__X(k, 20)]); } } } @@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) INTEGER i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { - OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7); + OPM_WriteString((CHAR*)"(REAL)", 7); } else { - OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11); + OPM_WriteString((CHAR*)"(LONGREAL)", 11); } OPM_WriteInt(__ENTIER(r)); } else { @@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23); } __NEW(T, Texts_TextDesc); - Texts_Open(T, (CHAR*)"", (LONGINT)1); + Texts_Open(T, (CHAR*)"", 1); Texts_Append(T, W.buf); - Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0))); + Texts_OpenReader(&R, Texts_Reader__typ, T, 0); i = 0; Texts_Read(&R, Texts_Reader__typ, &ch); while (ch != 0x00) { - s[__X(i, ((LONGINT)(32)))] = ch; + s[__X(i, 32)] = ch; i += 1; Texts_Read(&R, Texts_Reader__typ, &ch); } - s[__X(i, ((LONGINT)(32)))] = 0x00; + s[__X(i, 32)] = 0x00; i = 0; ch = s[0]; while ((ch != 'D' && ch != 0x00)) { i += 1; - ch = s[__X(i, ((LONGINT)(32)))]; + ch = s[__X(i, 32)]; } if (ch == 'D') { - s[__X(i, ((LONGINT)(32)))] = 'e'; + s[__X(i, 32)] = 'e'; } - OPM_WriteString(s, ((LONGINT)(32))); + OPM_WriteString(s, 32); } } void OPM_WriteLn (void) { - Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a); + Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) @@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) Files_Rider R1; CHAR buffer[4096]; if (F != NIL) { - Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0))); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_Set(&R1, Files_Rider__typ, F, 0); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); while (4096 - R1.res > 0) { - Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res); - Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096))); + Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res); + Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096); } } } @@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) { CHAR FName[32]; - __COPY(moduleName, OPM_modName, ((LONGINT)(32))); - OPM_HFile = Files_New((CHAR*)"", (LONGINT)1); + __COPY(moduleName, OPM_modName, 32); + OPM_HFile = Files_New((CHAR*)"", 1); if (OPM_HFile != NIL) { - Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3); - OPM_BFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3); + OPM_BFile = Files_New(FName, 32); if (OPM_BFile != NIL) { - Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0))); + Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0); } else { OPM_err(153); } - OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - OPM_HIFile = Files_New(FName, ((LONGINT)(32))); + OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3); + OPM_HIFile = Files_New(FName, 32); if (OPM_HIFile != NIL) { - Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0))); + Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0); } else { OPM_err(153); } @@ -960,9 +960,9 @@ void OPM_CloseFiles (void) CHAR FName[32]; INTEGER res; if (OPM_noerr) { - OPM_LogWStr((CHAR*)" ", (LONGINT)3); - OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0))); - OPM_LogWStr((CHAR*)" chars.", (LONGINT)8); + OPM_LogWStr((CHAR*)" ", 3); + OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); + OPM_LogWStr((CHAR*)" chars.", 8); } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { @@ -974,10 +974,10 @@ void OPM_CloseFiles (void) Files_Register(OPM_HIFile); Files_Register(OPM_BFile); } else { - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3); - Files_Delete(FName, ((LONGINT)(32)), &res); - OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5); - Files_Delete(FName, ((LONGINT)(32)), &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3); + Files_Delete(FName, 32, &res); + OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5); + Files_Delete(FName, 32, &res); Files_Register(OPM_BFile); } } @@ -986,11 +986,11 @@ void OPM_CloseFiles (void) OPM_HIFile = NIL; OPM_newSFile = NIL; OPM_oldSFile = NIL; - Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0))); - Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0))); + Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0); + Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0); + Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0); } static void EnumPtrs(void (*P)(void*)) @@ -1031,15 +1031,15 @@ export void *OPM__init(void) /* BEGIN */ Texts_OpenWriter(&OPM_W, Texts_Writer__typ); OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024))); - Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024))); - Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024))); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); + Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); + Files_SetSearchPath(OPM_OBERON, 1024); OPM_CharSize = 1; OPM_BoolSize = 1; OPM_SIntSize = 1; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e94f0303..5363c227 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 63b71ce5..c525c696 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -59,7 +59,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if ((int)OPP_sym == s) { + if (OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x) OPP_Expression(&*x); if ((*x)->class != 7) { OPP_err(50); - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); } } @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (int)sf; + *sysflag = (SYSTEM_INT32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ) OPT_Find(&id); if (id == NIL) { if (OPP_nofFwdPtr < 64) { - OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ; + OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ; OPP_nofFwdPtr += 1; } else { OPP_err(224); } (*typ)->link = OPT_NewObj(); - __COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256))); + __COPY(OPS_name, (*typ)->link->name, 256); (*typ)->BaseTyp = OPT_undftyp; OPS_Get(&OPP_sym); } else { @@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 18) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { if ((*x)->typ->form == 13) { @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (int)(*x)->obj->adr; + m = (SYSTEM_INT8)(*x)->obj->adr; n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x) *x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44); + OPM_LogWNum(OPS_numtyp, 0); OPM_LogWLn(); break; } @@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x) *x = NIL; } if (*x == NIL) { - *x = OPB_NewIntConst(((LONGINT)(1))); + *x = OPB_NewIntConst(1); (*x)->typ = OPT_undftyp; } } @@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *mode = 1; } - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckSym(38); OPP_CheckSym(20); if (OPP_sym == 38) { @@ -933,8 +933,8 @@ static void GetCode__19 (void) (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; if (OPP_sym == 37) { - while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) { - (*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))]; + while (OPS_str[__X(n, 256)] != 0x00) { + (*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)]; n += 1; } (*ext)[0] = (CHAR)n; @@ -950,7 +950,7 @@ static void GetCode__19 (void) n = 1; } OPS_Get(&OPP_sym); - (*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c; + (*ext)[__X(n, 256)] = (CHAR)c; } if (OPP_sym == 19) { OPS_Get(&OPP_sym); @@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void) } OPP_Receiver(&objMode, objName, &objTyp, &recTyp); if (OPP_sym == 38) { - __COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256))); + __COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256); OPP_CheckMark(&*ProcedureDeclaration__16_s->vis); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd); OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc); @@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) TProcDecl__23(); } else if (OPP_sym == 38) { OPT_Find(&fwd); - __COPY(OPS_name, name, ((LONGINT)(256))); + __COPY(OPS_name, name, 256); OPP_CheckMark(&vis); if ((vis != 0 && mode == 6)) { mode = 7; @@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int)LabelTyp->form != f) { + } else if (LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { OPP_err(60); } if (yval < xval) { @@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (i == 0) { break; } - if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) { - if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) { + if (tab[__X(i - 1, 128)].low <= yval) { + if (tab[__X(i - 1, 128)].high >= xval) { OPP_err(62); } break; } - tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))]; + tab[__X(i, 128)] = tab[__X(i - 1, 128)]; i -= 1; } - tab[__X(i, ((LONGINT)(128)))].low = xval; - tab[__X(i, ((LONGINT)(128)))].high = yval; + tab[__X(i, 128)].low = xval; + tab[__X(i, 128)].high = yval; *n += 1; } else { OPP_err(213); @@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x) } if (n > 0) { low = tab[0].low; - high = tab[__X(n - 1, ((LONGINT)(128)))].high; + high = tab[__X(n - 1, 128)].high; if (high - low > 512) { OPP_err(209); } @@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); OPP_ConstExpression(&z); } else { - z = OPB_NewIntConst(((LONGINT)(1))); + z = OPB_NewIntConst(1); } pos = OPM_errpos; x = OPB_NewLeaf(id); @@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_ConstExpression(&x); } else { OPP_err(9); - x = OPB_NewIntConst(((LONGINT)(1))); + x = OPB_NewIntConst(1); } obj->mode = 3; obj->typ = x->typ; @@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (__IN(obj->typ->comp, 0x1c)) { i = 0; while (i < OPP_nofFwdPtr) { - typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))]; + typ = OPP_FwdPtr[__X(i, 64)]; i += 1; if (__STRCMP(typ->link->name, obj->name) == 0) { typ->BaseTyp = obj->typ; @@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) } i = 0; while (i < OPP_nofFwdPtr) { - if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) { + if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) { OPP_err(128); } - OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL; + OPP_FwdPtr[__X(i, 64)] = NIL; i += 1; } OPT_topScope->adr = OPM_errpos; @@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); } else { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46); + OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15); - OPM_LogWNum(OPP_sym, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" sym: ", 15); + OPM_LogWNum(OPP_sym, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.name: ", 15); + OPM_LogWStr(OPS_name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15); - OPM_LogWStr(OPS_str, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)" OPS.str: ", 15); + OPM_LogWStr(OPS_str, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15); - OPM_LogWNum(OPS_numtyp, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15); + OPM_LogWNum(OPS_numtyp, 1); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15); - OPM_LogWNum(OPS_intval, ((LONGINT)(1))); + OPM_LogWStr((CHAR*)" OPS.intval: ", 15); + OPM_LogWNum(OPS_intval, 1); OPM_LogWLn(); OPP_err(16); } if (OPP_sym == 38) { - OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11); - OPM_LogWStr(OPS_name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"compiling ", 11); + OPM_LogWStr(OPS_name, 256); OPM_LogW('.'); OPT_Init(OPS_name, opt); OPS_Get(&OPP_sym); @@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt) OPS_Get(&OPP_sym); for (;;) { if (OPP_sym == 38) { - __COPY(OPS_name, aliasName, ((LONGINT)(256))); - __COPY(aliasName, impName, ((LONGINT)(256))); + __COPY(OPS_name, aliasName, 256); + __COPY(aliasName, impName, 256); OPS_Get(&OPP_sym); if (OPP_sym == 34) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { - __COPY(OPS_name, impName, ((LONGINT)(256))); + __COPY(OPS_name, impName, 256); OPS_Get(&OPP_sym); } else { OPP_err(38); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index fb0cf655..7a12f897 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e2d48c61..2ee978f2 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int)OPS_str[0]; + OPS_intval = OPS_str[0]; } else { *sym = 37; } @@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = (int)ch - 48; + _o_result = ch - 48; return _o_result; } else if (hex) { - _o_result = ((int)ch - 65) + 10; + _o_result = (ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ea28a764..a8dccfed 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b028d164..5861f882 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size) OPT_Struct _o_result; INTEGER i; i = 1; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) { + while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; } - _o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i, 20)]; return _o_result; } @@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; - while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) { + while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { i += 1; } __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))]; + _o_result = OPT_IntTypes[__X(i + dir, 20)]; return _o_result; } @@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); _o_result = ext; return _o_result; } @@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt) OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); OPT_SYSimported = 0; - __COPY(name, OPT_SelfName, ((LONGINT)(256))); - __COPY(name, OPT_topScope->name, ((LONGINT)(256))); + __COPY(name, OPT_SelfName, 256); + __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; OPT_newsf = __IN(4, opt); @@ -282,13 +282,13 @@ void OPT_Close (void) OPT_CloseScope(); i = 0; while (i < 64) { - OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL; + OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } i = 16; while (i < 255) { - OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL; - OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL; + OPT_impCtxt.ref[__X(i, 255)] = NIL; + OPT_impCtxt.old[__X(i, 255)] = NIL; i += 1; } } @@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) } ob1->left = NIL; ob1->right = NIL; - __COPY(name, ob1->name, ((LONGINT)(256))); + __COPY(name, ob1->name, 256); mnolev = OPT_topScope->mnolev; ob1->mnolev = mnolev; break; @@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int)ch); + OPM_FPrint(&*fp, ch); i += 1; } while (!(ch == 0x00)); } @@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp) { OPM_LogWLn(); if (btyp == NIL) { - OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12); + OPM_LogWStr((CHAR*)"btyp is nil", 12); OPM_LogWLn(); } - OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23); - OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256))); + OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23); + OPM_LogWStr(btyp->strobj->name, 256); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14); - OPM_LogWNum(btyp->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.form = ", 14); + OPM_LogWNum(btyp->form, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14); - OPM_LogWNum(btyp->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.comp = ", 14); + OPM_LogWNum(btyp->comp, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13); - OPM_LogWNum(btyp->mno, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.mno = ", 13); + OPM_LogWNum(btyp->mno, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16); - OPM_LogWNum(btyp->extlev, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16); + OPM_LogWNum(btyp->extlev, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14); - OPM_LogWNum(btyp->size, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.size = ", 14); + OPM_LogWNum(btyp->size, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15); - OPM_LogWNum(btyp->align, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.align = ", 15); + OPM_LogWNum(btyp->align, 0); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16); - OPM_LogWNum(btyp->txtpos, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16); + OPM_LogWNum(btyp->txtpos, 0); OPM_LogWLn(); } @@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ) btyp = typ->BaseTyp; strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); - OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256))); + OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); + OPT_FPrintName(&idfp, (void*)strobj->name, 256); } if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); @@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); @@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj) FPrintTProcs__17(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13))); + OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256))); + OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); } } FPrintTProcs__17(obj->right); @@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, ((LONGINT)(0)), 1); + FPrintFlds__13(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } @@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrintLReal(&fprint, obj->conval->realval); break; case 10: - OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; case 11: break; @@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int)(*ext)[0]; + m = (*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]); + OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) INTEGER i, j; CHAR ch; if (obj->mnolev != 0) { - __COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64))); + __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); i = 0; - while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) { + while (OPM_objname[__X(i, 64)] != 0x00) { i += 1; } - OPM_objname[__X(i, ((LONGINT)(64)))] = '.'; + OPM_objname[__X(i, 64)] = '.'; j = 0; i += 1; do { - ch = obj->name[__X(j, ((LONGINT)(256)))]; - OPM_objname[__X(i, ((LONGINT)(64)))] = ch; + ch = obj->name[__X(j, 256)]; + OPM_objname[__X(i, 64)] = ch; j += 1; i += 1; } while (!(ch == 0x00)); } else { - __COPY(obj->name, OPM_objname, ((LONGINT)(64))); + __COPY(obj->name, OPM_objname, 64); } if (errcode == 249) { if (OPM_noerr) { @@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno) *mno = OPT_impCtxt.glbmno[0]; } else { if (mn == 16) { - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) { OPT_err(154); } i = 0; - while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) { + while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) { i += 1; } if (i < OPT_nofGmod) { @@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno) } else { head = OPT_NewObj(); head->mode = 12; - __COPY(name, head->name, ((LONGINT)(256))); + __COPY(name, head->name, 256); *mno = OPT_nofGmod; head->mnolev = -*mno; if (OPT_nofGmod < 64) { - OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head; + OPT_GlbMod[__X(*mno, 64)] = head; OPT_nofGmod += 1; } else { OPT_err(227); } } - OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno; + OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno; OPT_impCtxt.nofm += 1; } else { - *mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))]; + *mno = OPT_impCtxt.glbmno[__X(-mn, 64)]; } } } @@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int)ch; + conval->intval = ch; break; case 4: case 5: case 6: conval->intval = OPM_SymRInt(); @@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) i = 0; do { OPM_SymRCh(&ch); - (*ext)[__X(i, ((LONGINT)(256)))] = ch; + (*ext)[__X(i, 256)] = ch; i += 1; } while (!(ch == 0x00)); conval->intval2 = i; @@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval = 0; break; default: - OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37); - OPM_LogWNum(f, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37); + OPM_LogWNum(f, 0); OPM_LogWLn(); break; } @@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) } OPT_InStruct(&new->typ); new->adr = OPM_SymRInt(); - OPT_InName((void*)new->name, ((LONGINT)(256))); + OPT_InName((void*)new->name, 256); last = new; tag = OPM_SymRInt(); } @@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void) obj->vis = 1; } OPT_InStruct(&obj->typ); - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = OPM_SymRInt(); } else { obj->mode = 4; @@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) obj->conval->intval = -1; OPT_InSign(mno, &obj->typ, &obj->link); obj->vis = 1; - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); obj->adr = __ASHL(OPM_SymRInt(), 16); } else { obj->mode = 13; @@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag) _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { - _o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))]; + _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; } __RETCHK; @@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_impCtxt.minr = ref; } OPT_InMod(&mno); - OPT_InName((void*)name, ((LONGINT)(256))); + OPT_InName((void*)name, 256); obj = OPT_NewObj(); if (name[0] == 0x00) { if (OPT_impCtxt.self) { old = NIL; } else { __MOVE("@", obj->name, 2); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); obj->name[0] = 0x00; } *typ = OPT_NewStr(0, 1); } else { - __COPY(name, obj->name, ((LONGINT)(256))); - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + __COPY(name, obj->name, 256); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (old != NIL) { OPT_FPrintObj(old); - OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp; + OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp; if (OPT_impCtxt.self) { *typ = OPT_NewStr(0, 1); } else { @@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ) *typ = OPT_NewStr(0, 1); } } - OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ; - OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old; + OPT_impCtxt.ref[__X(ref, 255)] = *typ; + OPT_impCtxt.old[__X(ref, 255)] = old; (*typ)->ref = ref + 255; (*typ)->mno = mno; (*typ)->allocated = 1; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int)OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ) OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: - OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ) if (obj->name[0] != 0x00) { OPT_FPrintObj(obj); } - old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))]; + old = OPT_impCtxt.old[__X(ref, 255)]; if (old != NIL) { t->strobj = old; if (OPT_impCtxt.self) { @@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ) if (old->history != 5) { if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } } } else if (old->fprint != obj->fprint) { old->history = 2; - } else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + } else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 3; } else if (old->vis == 0) { old->history = 1; @@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ) old->history = 0; } } else { - if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) { + if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) { old->history = 5; } if (old->fprint != obj->fprint) { @@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int)OPM_SymRInt(); + s = (SYSTEM_INT32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { - OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymRCh(&(*ext)[__X(i, 256)]); i += 1; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32); - OPM_LogWNum(tag, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32); + OPM_LogWNum(tag, 0); OPM_LogWLn(); break; } @@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno) } OPT_InStruct(&obj->typ); } - OPT_InName((void*)obj->name, ((LONGINT)(256))); + OPT_InName((void*)obj->name, 256); } OPT_FPrintObj(obj); if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) { OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255); } if (tag != 19) { - OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old); + OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old); if (OPT_impCtxt.self) { if (old != NIL) { if (old->vis == 0) { @@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; OPT_impCtxt.reffp = 0; - OPM_OldSym((void*)name, ((LONGINT)(256)), &*done); + OPM_OldSym((void*)name, 256, &*done); if (*done) { OPT_InMod(&mno); OPT_impCtxt.nextTag = OPM_SymRInt(); @@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) } OPT_Insert(aliasName, &obj); obj->mode = 11; - obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right; - OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj; + obj->scope = OPT_GlbMod[__X(mno, 64)]->right; + OPT_GlbMod[__X(mno, 64)]->link = obj; obj->mnolev = -mno; obj->typ = OPT_notyp; OPM_CloseOldSym(); @@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) static void OPT_OutMod (INTEGER mno) { - if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) { - OPM_SymWInt(((LONGINT)(16))); - OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm; + if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { + OPM_SymWInt(16); + OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm; OPT_expCtxt.nofm += 1; - OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256))); + OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256); } else { - OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]); + OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]); } } @@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_SymWInt(((LONGINT)(27))); + OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; } @@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { if (fld->vis == 2) { - OPM_SymWInt(((LONGINT)(26))); + OPM_SymWInt(26); } else { - OPM_SymWInt(((LONGINT)(25))); + OPM_SymWInt(25); } OPT_OutStr(fld->typ); - OPT_OutName((void*)fld->name, ((LONGINT)(256))); + OPT_OutName((void*)fld->name, 256); OPM_SymWInt(fld->adr); } else { OPT_OutHdFld(fld->typ, fld, fld->adr + adr); @@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par) OPT_OutStr(result); while (par != NIL) { if (par->mode == 1) { - OPM_SymWInt(((LONGINT)(23))); + OPM_SymWInt(23); } else { - OPM_SymWInt(((LONGINT)(24))); + OPM_SymWInt(24); } OPT_OutStr(par->typ); OPM_SymWInt(par->adr); - OPT_OutName((void*)par->name, ((LONGINT)(256))); + OPT_OutName((void*)par->name, 256); par = par->link; } - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); } static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) @@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj) } if (obj->vis != 0) { if (obj->vis != 0) { - OPM_SymWInt(((LONGINT)(29))); + OPM_SymWInt(29); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); OPM_SymWInt(__ASHR(obj->adr, 16)); } else { - OPM_SymWInt(((LONGINT)(30))); + OPM_SymWInt(30); OPM_SymWInt(__ASHR(obj->adr, 16)); } } @@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->size); } } else { - OPM_SymWInt(((LONGINT)(34))); + OPM_SymWInt(34); typ->ref = OPT_expCtxt.ref; OPT_expCtxt.ref += 1; if (OPT_expCtxt.ref >= 255) { @@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_OutMod(typ->mno); strobj = typ->strobj; if ((strobj != NIL && strobj->name[0] != 0x00)) { - OPT_OutName((void*)strobj->name, ((LONGINT)(256))); + OPT_OutName((void*)strobj->name, 256); switch (strobj->history) { case 2: OPT_FPrintErr(strobj, 252); @@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWCh(0x00); } if (typ->sysflag != 0) { - OPM_SymWInt(((LONGINT)(35))); + OPM_SymWInt(35); OPM_SymWInt(typ->sysflag); } switch (typ->form) { case 13: - OPM_SymWInt(((LONGINT)(36))); + OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; case 14: - OPM_SymWInt(((LONGINT)(40))); + OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; case 15: switch (typ->comp) { case 2: - OPM_SymWInt(((LONGINT)(37))); + OPM_SymWInt(37); OPT_OutStr(typ->BaseTyp); OPM_SymWInt(typ->n); break; case 3: - OPM_SymWInt(((LONGINT)(38))); + OPM_SymWInt(38); OPT_OutStr(typ->BaseTyp); break; case 4: - OPM_SymWInt(((LONGINT)(39))); + OPM_SymWInt(39); if (typ->BaseTyp == NIL) { OPT_OutStr(OPT_notyp); } else { @@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->align); OPM_SymWInt(typ->n); OPT_nofhdfld = 0; - OPT_OutFlds(typ->link, ((LONGINT)(0)), 1); + OPT_OutFlds(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(223, typ->txtpos); } OPT_OutTProcs(typ, typ->link); - OPM_SymWInt(((LONGINT)(18))); + OPM_SymWInt(18); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39); - OPM_LogWNum(typ->comp, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39); + OPM_LogWNum(typ->comp, 0); OPM_LogWLn(); break; } break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39); - OPM_LogWNum(typ->form, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39); + OPM_LogWNum(typ->form, 0); OPM_LogWLn(); break; } @@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj) OPM_SymWLReal(obj->conval->realval); break; case 10: - OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256))); + OPT_OutName((void*)*obj->conval->ext, 256); break; case 11: break; @@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj) OPT_FPrintErr(obj, 251); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42); - OPM_LogWNum(obj->history, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42); + OPM_LogWNum(obj->history, 0); OPM_LogWLn(); break; } switch (obj->mode) { case 3: OPT_OutConstant(obj); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 5: if (obj->typ->strobj == obj) { - OPM_SymWInt(((LONGINT)(19))); + OPM_SymWInt(19); OPT_OutStr(obj->typ); } else { - OPM_SymWInt(((LONGINT)(20))); + OPM_SymWInt(20); OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); } break; case 1: if (obj->vis == 2) { - OPM_SymWInt(((LONGINT)(22))); + OPM_SymWInt(22); } else { - OPM_SymWInt(((LONGINT)(21))); + OPM_SymWInt(21); } OPT_OutStr(obj->typ); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) { OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref); } break; case 7: - OPM_SymWInt(((LONGINT)(31))); + OPM_SymWInt(31); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 10: - OPM_SymWInt(((LONGINT)(32))); + OPM_SymWInt(32); OPT_OutSign(obj->typ, obj->link); - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; case 9: - OPM_SymWInt(((LONGINT)(33))); + OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int)(*ext)[0]; + j = (*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { - OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]); + OPM_SymWCh((*ext)[__X(i, 256)]); i += 1; } - OPT_OutName((void*)obj->name, ((LONGINT)(256))); + OPT_OutName((void*)obj->name, 256); break; default: - OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38); - OPM_LogWNum(obj->mode, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38); + OPM_LogWNum(obj->mode, 0); OPM_LogWLn(); break; } @@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPT_Import((CHAR*)"@self", OPT_SelfName, &done); OPT_nofGmod = nofmod; if (OPM_noerr) { - OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_NewSym((void*)OPT_SelfName, 256); if (OPM_noerr) { - OPM_SymWInt(((LONGINT)(16))); - OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_SymWInt(16); + OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; OPT_expCtxt.ref = 16; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; while (i < 64) { - OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1; + OPT_expCtxt.locmno[__X(i, 64)] = -1; i += 1; } OPT_OutObj(OPT_topScope->right); @@ -1875,11 +1875,11 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); - OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0))); - OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1))); + OPT_EnterBoolConst((CHAR*)"FALSE", 0); + OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); OPT_EnterProc((CHAR*)"NEW", 1); OPT_EnterProc((CHAR*)"ABS", 2); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9878e30b..acf2e9e9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f74e0890..49956ac6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -37,9 +37,10 @@ static void OPV_Len (OPT_Node n, LONGINT dim); export void OPV_Module (OPT_Node prog); static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); static void OPV_NewArr (OPT_Node d, OPT_Node x); +static void OPV_ParIntLiteral (LONGINT n, LONGINT size); static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT size); +static void OPV_SizeCast (LONGINT from, LONGINT to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -118,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -197,27 +198,27 @@ static void OPV_Stamp (OPS_Name s) OPV_stamp += 1; i = 0; j = OPV_stamp; - while (s[__X(i, ((LONGINT)(256)))] != 0x00) { + while (s[__X(i, 256)] != 0x00) { i += 1; } if (i > 25) { i = 25; } - s[__X(i, ((LONGINT)(256)))] = '_'; - s[__X(i + 1, ((LONGINT)(256)))] = '_'; + s[__X(i, 256)] = '_'; + s[__X(i + 1, 256)] = '_'; i += 2; k = 0; do { - n[__X(k, ((LONGINT)(10)))] = (CHAR)((int)__MOD(j, 10) + 48); + n[__X(k, 10)] = (CHAR)((int)__MOD(j, 10) + 48); j = __DIV(j, 10); k += 1; } while (!(j == 0)); do { k -= 1; - s[__X(i, ((LONGINT)(256)))] = n[__X(k, ((LONGINT)(10)))]; + s[__X(i, 256)] = n[__X(k, 10)]; i += 1; } while (!(k == 0)); - s[__X(i, ((LONGINT)(256)))] = 0x00; + s[__X(i, 256)] = 0x00; } static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) @@ -259,7 +260,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } scope = obj->scope; scope->leaf = 1; - __COPY(obj->name, scope->name, ((LONGINT)(256))); + __COPY(obj->name, scope->name, 256); OPV_Stamp(scope->name); if (mode == 9) { obj->adr = 1; @@ -339,8 +340,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -409,8 +410,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", (LONGINT)55); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -424,8 +425,8 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", (LONGINT)43); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -440,7 +441,7 @@ static void OPV_Len (OPT_Node n, LONGINT dim) } if ((n->class == 3 && n->typ->comp == 3)) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->len[", (LONGINT)7); + OPM_WriteString((CHAR*)"->len[", 7); OPM_WriteInt(dim); OPM_Write(']'); } else { @@ -464,7 +465,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { if (__IN(n->typ->form, 0x0180)) { - OPM_WriteString((CHAR*)"__ENTIER(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); } else { @@ -472,12 +473,28 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT size) +static void OPV_SizeCast (LONGINT from, LONGINT to) { - if (size <= 4) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); - } else { - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", (LONGINT)15); + if ((from != to && (from > 4 || to > 4))) { + switch (to) { + case 1: + OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); + break; + case 2: + OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); + break; + case 4: + OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); + break; + case 8: + OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); + break; + default: + OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); + OPM_LogWNum(to, 1); + OPM_LogWLn(); + break; + } } } @@ -487,29 +504,27 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) from = n->typ->form; to = newtype->form; if (to == 9) { - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); } else if (__IN(to, 0x70)) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { - OPM_WriteString((CHAR*)"__SHORT", (LONGINT)8); + OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); } OPM_Write('('); OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); OPM_Write(')'); } else { - if (newtype->size != n->typ->size) { - OPV_SizeCast(newtype->size); - } + OPV_SizeCast(n->typ->size, newtype->size); OPV_Entier(n, 9); } } else if (to == 3) { if (__IN(2, OPM_opt)) { - OPM_WriteString((CHAR*)"__CHR", (LONGINT)6); + OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); } @@ -517,7 +532,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPV_Entier(n, -1); OPM_Write(')'); } else { - OPM_WriteString((CHAR*)"(CHAR)", (LONGINT)7); + OPM_WriteString((CHAR*)"(CHAR)", 7); OPV_Entier(n, 9); } } else { @@ -528,14 +543,14 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { if (n->typ->form == 13) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); } else if (__IN(n->class, 0x15)) { OPC_Andent(n->typ); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { - OPM_WriteString((CHAR*)"__TYPEOF(", (LONGINT)10); + OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n->left, -1); OPM_Write(')'); } else if (n->class == 5) { @@ -553,12 +568,12 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { - OPM_WriteString((CHAR*)"__XF(", (LONGINT)6); + OPM_WriteString((CHAR*)"__XF(", 6); } else { - OPM_WriteString((CHAR*)"__X(", (LONGINT)5); + OPM_WriteString((CHAR*)"__X(", 5); } OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(d, dim); OPM_Write(')'); } @@ -570,12 +585,12 @@ static void OPV_design (OPT_Node n, INTEGER prec) OPT_Struct typ = NIL; INTEGER class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__27; + INTEGER dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -600,7 +615,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 2: if (n->left->class == 3) { OPV_design(n->left->left, designPrec); - OPM_WriteString((CHAR*)"->", (LONGINT)3); + OPM_WriteString((CHAR*)"->", 3); } else { OPV_design(n->left, designPrec); OPM_Write('.'); @@ -610,7 +625,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 3: if (n->typ->comp == 3) { OPV_design(n->left, 10); - OPM_WriteString((CHAR*)"->data", (LONGINT)7); + OPM_WriteString((CHAR*)"->data", 7); } else { OPM_Write('*'); OPV_design(n->left, designPrec); @@ -637,25 +652,25 @@ static void OPV_design (OPT_Node n, INTEGER prec) while (x != d) { if (x->left != d) { OPV_Index(x, d, 7, i); - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); OPV_Len(d, i); - OPM_WriteString((CHAR*)" * (", (LONGINT)5); + OPM_WriteString((CHAR*)" * (", 5); i -= 1; } else { OPV_Index(x, d, -1, i); } x = x->left; } - _for__27 = dims; + _for__28 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__28) { OPM_Write(')'); i += 1; } if (n->typ->comp == 3) { OPM_Write(')'); while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; } @@ -673,33 +688,33 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->left->obj; if (__IN(3, OPM_opt)) { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"__GUARDR(", (LONGINT)10); - if ((int)obj->mnolev != OPM_level) { - OPM_WriteStringVar((void*)obj->scope->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__curr->", (LONGINT)9); + OPM_WriteString((CHAR*)"__GUARDR(", 10); + if (obj->mnolev != OPM_level) { + OPM_WriteStringVar((void*)obj->scope->name, 256); + OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); } else { OPC_Ident(obj); } } else { if (typ->BaseTyp->strobj == NIL) { - OPM_WriteString((CHAR*)"__GUARDA(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDA(", 10); } else { - OPM_WriteString((CHAR*)"__GUARDP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__GUARDP(", 10); } OPV_expr(n->left, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); } else { if (typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Ident(typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); OPC_CompleteIdent(obj); } else { OPM_Write('('); @@ -712,15 +727,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) case 6: if (__IN(3, OPM_opt)) { if (n->left->class == 1) { - OPM_WriteString((CHAR*)"__GUARDEQR(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n->left); } else { - OPM_WriteString((CHAR*)"__GUARDEQP(", (LONGINT)12); + OPM_WriteString((CHAR*)"__GUARDEQP(", 12); OPV_expr(n->left->left, -1); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); } else { @@ -733,8 +748,8 @@ static void OPV_design (OPT_Node n, INTEGER prec) } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", (LONGINT)39); - OPM_LogWNum(class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.design, class = ", 39); + OPM_LogWNum(class, 0); OPM_LogWLn(); break; } @@ -743,6 +758,15 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } +static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +{ + if (OPV_ansi) { + OPM_WriteInt(n); + } else { + OPC_IntLiteral(n, size); + } +} + static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; @@ -757,81 +781,75 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPM_Write('('); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)"*)", (LONGINT)3); + OPM_WriteString((CHAR*)"*)", 3); prec = 10; } if (!__IN(n->typ->comp, 0x0c)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { - OPM_WriteString((CHAR*)"(CHAR*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } else { if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { - OPM_WriteString((CHAR*)"(double)", (LONGINT)9); - prec = 9; - } else if ((form == 6 && n->typ->form < 6)) { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"(double)", 9); prec = 9; + } else if (__IN(form, 0x70)) { + OPV_SizeCast(n->typ->size, typ->size); } } } else if (OPV_ansi) { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); } } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((((((form == 6 && n->class == 7)) && n->conval->intval <= OPM_SignedMaximum(OPM_IntSize))) && n->conval->intval >= OPM_SignedMinimum(OPM_IntSize))) { - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPV_expr(n, prec); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + } else if ((__IN(form, 0x70) && n->class == 7)) { + OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); } if ((comp == 4 && mode == 2)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_TypeOf(n); } else if (comp == 3) { if (n->class == 7) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(n->conval->intval2); + OPM_WriteString((CHAR*)", ", 3); + OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); } else { aptyp = n->typ; dim = 0; while ((typ->comp == 3 && typ->BaseTyp->form != 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_Len(n, dim); typ = typ->BaseTyp; aptyp = aptyp->BaseTyp; dim += 1; } if ((typ->comp == 3 && typ->BaseTyp->form == 1)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); while (aptyp->comp == 3) { OPV_Len(n, dim); - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); dim += 1; aptyp = aptyp->BaseTyp; } - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); - OPM_WriteInt(aptyp->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); + OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); } } } n = n->link; fp = fp->link; if (n != NIL) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); } } OPM_Write(')'); @@ -871,9 +889,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Constant(n->conval, form); break; case 10: - OPM_WriteString((CHAR*)"__SETRNG(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SETRNG(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); break; @@ -894,16 +912,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 16: typ = n->obj->typ; if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"__IS(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IS(", 6); OPC_TypeOf(l->obj); } else { - OPM_WriteString((CHAR*)"__ISP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ISP(", 7); OPV_expr(l, -1); typ = typ->BaseTyp; } - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(typ); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(typ->extlev); OPM_Write(')'); break; @@ -913,31 +931,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 21: if (OPV_SideEffects(l)) { if (l->typ->form < 7) { - if (l->typ->form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (l->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__ABSF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ABSF(", 8); } else { - OPM_WriteString((CHAR*)"__ABSFD(", (LONGINT)9); + OPM_WriteString((CHAR*)"__ABSFD(", 9); } } else { - OPM_WriteString((CHAR*)"__ABS(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ABS(", 7); } OPV_expr(l, -1); OPM_Write(')'); break; case 22: - OPM_WriteString((CHAR*)"__CAP(", (LONGINT)7); + OPM_WriteString((CHAR*)"__CAP(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 23: - OPM_WriteString((CHAR*)"__ODD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ODD(", 7); OPV_expr(l, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADRINT)", (LONGINT)25); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -953,13 +971,13 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", (LONGINT)16); + OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); + OPM_WriteString((CHAR*)"__VAL(", 7); OPC_Ident(n->typ->strobj); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); OPM_Write(')'); } @@ -978,84 +996,84 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 28: case 3: case 4: switch (subclass) { case 15: - OPM_WriteString((CHAR*)"__IN(", (LONGINT)6); + OPM_WriteString((CHAR*)"__IN(", 6); break; case 17: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ASHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHL(", 8); } else { - OPM_WriteString((CHAR*)"__ASHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHR(", 8); } } else if (OPV_SideEffects(r)) { - OPM_WriteString((CHAR*)"__ASHF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ASHF(", 8); } else { - OPM_WriteString((CHAR*)"__ASH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ASH(", 7); } break; case 18: - OPM_WriteString((CHAR*)"__MASK(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MASK(", 8); break; case 26: - OPM_WriteString((CHAR*)"__BIT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__BIT(", 7); break; case 27: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__LSHL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHL(", 8); } else { - OPM_WriteString((CHAR*)"__LSHR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__LSHR(", 8); } } else { - OPM_WriteString((CHAR*)"__LSH(", (LONGINT)7); + OPM_WriteString((CHAR*)"__LSH(", 7); } break; case 28: if (r->class == 7) { if (r->conval->intval >= 0) { - OPM_WriteString((CHAR*)"__ROTL(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTL(", 8); } else { - OPM_WriteString((CHAR*)"__ROTR(", (LONGINT)8); + OPM_WriteString((CHAR*)"__ROTR(", 8); } } else { - OPM_WriteString((CHAR*)"__ROT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__ROT(", 7); } break; case 3: if (OPV_SideEffects(n)) { - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } - OPM_WriteString((CHAR*)"__DIVF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__DIVF(", 8); } else { - OPM_WriteString((CHAR*)"__DIV(", (LONGINT)7); + OPM_WriteString((CHAR*)"__DIV(", 7); } break; case 4: - if (form < 6) { - OPM_WriteString((CHAR*)"(int)", (LONGINT)6); + if (n->typ->size <= 4) { + OPM_WriteString((CHAR*)"(int)", 6); } if (OPV_SideEffects(n)) { - OPM_WriteString((CHAR*)"__MODF(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MODF(", 8); } else { - OPM_WriteString((CHAR*)"__MOD(", (LONGINT)7); + OPM_WriteString((CHAR*)"__MOD(", 7); } break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } if (__IN(subclass, 0x18000000)) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(l->typ->strobj); } OPM_Write(')'); @@ -1063,9 +1081,9 @@ static void OPV_expr (OPT_Node n, INTEGER prec) case 9: case 10: case 11: case 12: case 13: case 14: if (__IN(l->typ->form, 0x8400)) { - OPM_WriteString((CHAR*)"__STRCMP(", (LONGINT)10); + OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); OPM_Write(')'); OPC_Cmp(subclass); @@ -1075,7 +1093,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPC_Cmp(subclass); typ = l->typ; if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { - OPM_WriteString((CHAR*)"(void *) ", (LONGINT)10); + OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } @@ -1088,16 +1106,16 @@ static void OPV_expr (OPT_Node n, INTEGER prec) switch (subclass) { case 1: if (form == 9) { - OPM_WriteString((CHAR*)" & ", (LONGINT)4); + OPM_WriteString((CHAR*)" & ", 4); } else { - OPM_WriteString((CHAR*)" * ", (LONGINT)4); + OPM_WriteString((CHAR*)" * ", 4); } break; case 2: if (form == 9) { - OPM_WriteString((CHAR*)" ^ ", (LONGINT)4); + OPM_WriteString((CHAR*)" ^ ", 4); } else { - OPM_WriteString((CHAR*)" / ", (LONGINT)4); + OPM_WriteString((CHAR*)" / ", 4); if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { OPM_Write('('); OPC_Ident(n->typ->strobj); @@ -1106,28 +1124,28 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 5: - OPM_WriteString((CHAR*)" && ", (LONGINT)5); + OPM_WriteString((CHAR*)" && ", 5); break; case 6: if (form == 9) { - OPM_WriteString((CHAR*)" | ", (LONGINT)4); + OPM_WriteString((CHAR*)" | ", 4); } else { - OPM_WriteString((CHAR*)" + ", (LONGINT)4); + OPM_WriteString((CHAR*)" + ", 4); } break; case 7: if (form == 9) { - OPM_WriteString((CHAR*)" & ~", (LONGINT)5); + OPM_WriteString((CHAR*)" & ~", 5); } else { - OPM_WriteString((CHAR*)" - ", (LONGINT)4); + OPM_WriteString((CHAR*)" - ", 4); } break; case 8: - OPM_WriteString((CHAR*)" || ", (LONGINT)5); + OPM_WriteString((CHAR*)" || ", 5); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", (LONGINT)40); - OPM_LogWNum(subclass, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, subclass = ", 40); + OPM_LogWNum(subclass, 0); OPM_LogWLn(); break; } @@ -1143,7 +1161,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(l->obj); } OPC_Ident(proc); @@ -1172,7 +1190,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) LONGINT adr; if_ = n->left; while (if_ != NIL) { - OPM_WriteString((CHAR*)"if ", (LONGINT)4); + OPM_WriteString((CHAR*)"if ", 4); OPV_expr(if_->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1183,9 +1201,9 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if (typ->comp == 4) { OPC_BegStat(); OPC_Ident(if_->left->obj); - OPM_WriteString((CHAR*)" *", (LONGINT)3); - OPM_WriteString(obj->name, ((LONGINT)(256))); - OPM_WriteString((CHAR*)"__ = (void*)", (LONGINT)13); + OPM_WriteString((CHAR*)" *", 3); + OPM_WriteString(obj->name, 256); + OPM_WriteString((CHAR*)"__ = (void*)", 13); obj->adr = 0; OPC_CompleteIdent(obj); OPC_EndStat(); @@ -1201,13 +1219,13 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) if_ = if_->link; if ((if_ != NIL || n->right != NIL) || withtrap) { OPC_EndBlk0(); - OPM_WriteString((CHAR*)" else ", (LONGINT)7); + OPM_WriteString((CHAR*)" else ", 7); } else { OPC_EndBlk(); } } if (withtrap) { - OPM_WriteString((CHAR*)"__WITHCHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__WITHCHK", 10); OPC_EndStat(); } else if (n->right != NIL) { OPC_BegBlk(); @@ -1221,7 +1239,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPT_Node switchCase = NIL, label = NIL; LONGINT low, high; INTEGER form, i; - OPM_WriteString((CHAR*)"switch ", (LONGINT)8); + OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1253,22 +1271,22 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) OPC_Indent(1); OPV_stat(switchCase->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_EndStat(); OPC_Indent(-1); switchCase = switchCase->link; } OPC_BegStat(); - OPM_WriteString((CHAR*)"default: ", (LONGINT)10); + OPM_WriteString((CHAR*)"default: ", 10); if (n->right->conval->setval != 0x0) { OPC_Indent(1); OPM_WriteLn(); OPV_stat(n->right->right, outerProc); OPC_BegStat(); - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); OPC_Indent(-1); } else { - OPM_WriteString((CHAR*)"__CASECHK", (LONGINT)10); + OPM_WriteString((CHAR*)"__CASECHK", 10); } OPC_EndStat(); OPC_EndBlk(); @@ -1298,44 +1316,40 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) base = base->BaseTyp; } OPV_design(d, -1); - OPM_WriteString((CHAR*)" = __NEWARR(", (LONGINT)13); + OPM_WriteString((CHAR*)" = __NEWARR(", 13); while (base->comp == 2) { nofdim += 1; base = base->BaseTyp; } if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); - OPM_WriteString((CHAR*)"__typ", (LONGINT)6); + OPM_WriteString((CHAR*)"__typ", 6); } else if (base->form == 13) { - OPM_WriteString((CHAR*)"POINTER__typ", (LONGINT)13); + OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { - OPM_WriteString((CHAR*)"NIL", (LONGINT)4); + OPM_WriteString((CHAR*)"NIL", 4); } - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPM_WriteString((CHAR*)"((LONGINT)(", (LONGINT)12); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); - OPM_WriteString((CHAR*)"))", (LONGINT)3); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(OPC_BaseAlignment(base)); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdyn); while (typ != base) { - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPM_WriteString((CHAR*)"(LONGINT)(", (LONGINT)11); - OPV_expr(x, -1); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); + OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); OPV_expr(x, 10); + OPM_WriteString((CHAR*)"))", 3); } x = x->link; } else { - OPM_WriteString((CHAR*)"(LONGINT)", (LONGINT)10); - OPM_WriteInt(typ->n); + OPC_IntLiteral(typ->n, OPM_PointerSize); } typ = typ->BaseTyp; } @@ -1378,7 +1392,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_DefineTDescs(n->right); OPC_EnterBody(); OPV_InitTDescs(n->right); - OPM_WriteString((CHAR*)"/* BEGIN */", (LONGINT)12); + OPM_WriteString((CHAR*)"/* BEGIN */", 12); OPM_WriteLn(); OPV_stat(n->right, outerProc); OPC_ExitBody(); @@ -1404,11 +1418,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) l = n->left; r = n->right; if (l->typ->comp == 2) { - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(r, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(l, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); if (r->typ == OPT_stringtyp) { OPM_WriteInt(r->conval->intval2); } else { @@ -1421,13 +1435,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_design(l, -1); l->obj->adr = 1; if (r->typ->form != 11) { - OPM_WriteString((CHAR*)" = (void*)", (LONGINT)11); + OPM_WriteString((CHAR*)" = (void*)", 11); } else { - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } } else { OPV_design(l, -1); - OPM_WriteString((CHAR*)" = ", (LONGINT)4); + OPM_WriteString((CHAR*)" = ", 4); } if (l->typ == r->typ) { OPV_expr(r, -1); @@ -1437,9 +1451,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_Write(')'); OPV_expr(r, -1); } else if (l->typ->comp == 4) { - OPM_WriteString((CHAR*)"*(", (LONGINT)3); + OPM_WriteString((CHAR*)"*(", 3); OPC_Andent(l->typ); - OPM_WriteString((CHAR*)"*)&", (LONGINT)4); + OPM_WriteString((CHAR*)"*)&", 4); OPV_expr(r, 9); } else { OPV_expr(r, -1); @@ -1448,11 +1462,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 1: if (n->left->typ->BaseTyp->comp == 4) { - OPM_WriteString((CHAR*)"__NEW(", (LONGINT)7); + OPM_WriteString((CHAR*)"__NEW(", 7); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); - OPM_WriteString((CHAR*)")", (LONGINT)2); + OPM_WriteString((CHAR*)")", 2); } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { OPV_NewArr(n->left, n->right); } @@ -1465,43 +1479,43 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 15: case 16: OPV_expr(n->left, -1); OPC_SetInclude(n->subcl == 16); - OPM_WriteString((CHAR*)"__SETOF(", (LONGINT)9); + OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); OPM_Write(')'); break; case 18: - OPM_WriteString((CHAR*)"__COPY(", (LONGINT)8); + OPM_WriteString((CHAR*)"__COPY(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); - OPV_Len(n->left, ((LONGINT)(0))); + OPM_WriteString((CHAR*)", ", 3); + OPV_Len(n->left, 0); OPM_Write(')'); break; case 31: - OPM_WriteString((CHAR*)"__MOVE(", (LONGINT)8); + OPM_WriteString((CHAR*)"__MOVE(", 8); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right->link, -1); OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"__GET(", (LONGINT)7); + OPM_WriteString((CHAR*)"__GET(", 7); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->left->typ->strobj); OPM_Write(')'); break; case 25: - OPM_WriteString((CHAR*)"__PUT(", (LONGINT)7); + OPM_WriteString((CHAR*)"__PUT(", 7); OPV_expr(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPC_Ident(n->right->typ->strobj); OPM_Write(')'); break; @@ -1509,15 +1523,15 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_err(200); break; case 30: - OPM_WriteString((CHAR*)"__SYSNEW(", (LONGINT)10); + OPM_WriteString((CHAR*)"__SYSNEW(", 10); OPV_design(n->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPV_expr(n->right, -1); OPM_Write(')'); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", (LONGINT)40); - OPM_LogWNum(n->subcl, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.subcl = ", 40); + OPM_LogWNum(n->subcl, 0); OPM_LogWLn(); break; } @@ -1527,7 +1541,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->left->subcl == 1) { proc = OPV_SuperProc(n); } else { - OPM_WriteString((CHAR*)"__", (LONGINT)3); + OPM_WriteString((CHAR*)"__", 3); proc = OPC_BaseTProc(n->left->obj); } OPC_Ident(proc); @@ -1543,9 +1557,9 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); } else if (OPV_assert) { - OPM_WriteString((CHAR*)"__ASSERT(", (LONGINT)10); + OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); - OPM_WriteString((CHAR*)", ", (LONGINT)3); + OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(n->left->right->right->conval->intval); OPM_Write(')'); OPC_EndStat(); @@ -1558,7 +1572,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 22: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"while ", (LONGINT)7); + OPM_WriteString((CHAR*)"while ", 7); OPV_expr(n->left, 12); OPM_Write(' '); OPC_BegBlk(); @@ -1568,11 +1582,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 23: OPV_exit.level += 1; - OPM_WriteString((CHAR*)"do ", (LONGINT)4); + OPM_WriteString((CHAR*)"do ", 4); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk0(); - OPM_WriteString((CHAR*)" while (!", (LONGINT)10); + OPM_WriteString((CHAR*)" while (!", 10); OPV_expr(n->right, 9); OPM_Write(')'); OPV_exit.level -= 1; @@ -1581,13 +1595,13 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) saved = OPV_exit; OPV_exit.level = 0; OPV_exit.label = -1; - OPM_WriteString((CHAR*)"for (;;) ", (LONGINT)10); + OPM_WriteString((CHAR*)"for (;;) ", 10); OPC_BegBlk(); OPV_stat(n->left, outerProc); OPC_EndBlk(); if (OPV_exit.label != -1) { OPC_BegStat(); - OPM_WriteString((CHAR*)"exit__", (LONGINT)7); + OPM_WriteString((CHAR*)"exit__", 7); OPM_WriteInt(OPV_exit.label); OPM_Write(':'); OPC_EndStat(); @@ -1596,39 +1610,39 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 25: if (OPV_exit.level == 0) { - OPM_WriteString((CHAR*)"break", (LONGINT)6); + OPM_WriteString((CHAR*)"break", 6); } else { if (OPV_exit.label == -1) { OPV_exit.label = OPV_nofExitLabels; OPV_nofExitLabels += 1; } - OPM_WriteString((CHAR*)"goto exit__", (LONGINT)12); + OPM_WriteString((CHAR*)"goto exit__", 12); OPM_WriteInt(OPV_exit.label); } break; case 26: if (OPM_level == 0) { if (OPV_mainprog) { - OPM_WriteString((CHAR*)"__FINI", (LONGINT)7); + OPM_WriteString((CHAR*)"__FINI", 7); } else { - OPM_WriteString((CHAR*)"__ENDMOD", (LONGINT)9); + OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", (LONGINT)13); + OPM_WriteString((CHAR*)"_o_result = ", 13); if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { - OPM_WriteString((CHAR*)"(void*)", (LONGINT)8); + OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", (LONGINT)2); + OPM_WriteString((CHAR*)";", 2); OPM_WriteLn(); OPC_BegStat(); OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", (LONGINT)17); + OPM_WriteString((CHAR*)"return _o_result", 17); } else { - OPM_WriteString((CHAR*)"return", (LONGINT)7); + OPM_WriteString((CHAR*)"return", 7); } } break; @@ -1639,8 +1653,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_Halt(n->right->conval->intval); break; default: - OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", (LONGINT)40); - OPM_LogWNum(n->class, ((LONGINT)(0))); + OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); + OPM_LogWNum(n->class, 0); OPM_LogWLn(); break; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43ab4681..351ef416 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 679e8b8d..f66fdf2c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = __VAL(Platform_ArgVecPtr, argvadr); Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -254,7 +254,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le CHAR buf[4096]; INTEGER res; __DUP(var, var__len, CHAR); - res = Platform_getenv(var, var__len, (void*)buf, ((LONGINT)(4096))); + res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); _o_result = 1; @@ -281,8 +281,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; - __COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len); + av = __VAL(Platform_ArgVec, Platform_ArgVector); + __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -291,17 +291,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) CHAR s[64]; LONGINT k, d, i; s[0] = 0x00; - Platform_GetArg(n, (void*)s, ((LONGINT)(64))); + Platform_GetArg(n, (void*)s, 64); i = 0; if (s[0] == '-') { i = 1; } k = 0; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int)s[__X(i, ((LONGINT)(64)))] - 48; + d = s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -319,10 +319,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) { i += 1; - Platform_GetArg(i, (void*)arg, ((LONGINT)(256))); + Platform_GetArg(i, (void*)arg, 256); } _o_result = i; __DEL(s); @@ -357,7 +357,7 @@ LONGINT Platform_Time (void) void Platform_Delay (LONGINT ms) { while (ms > 30000) { - Platform_sleep(((LONGINT)(30000))); + Platform_sleep(30000); ms = ms - 30000; } if (ms > 0) { @@ -560,7 +560,7 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) INTEGER _o_result; INTEGER result; *n = 0; - result = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -665,7 +665,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) _o_result = Platform_err(); return _o_result; } - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); _o_result = 0; return _o_result; } @@ -720,37 +720,37 @@ static void Platform_DisplayHaltCode (LONGINT code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", (LONGINT)57); + Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); break; case -2: - Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20); + Platform_errstring((CHAR*)"Index out of range.", 20); break; case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49); + Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); break; case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47); + Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); break; case -5: - Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19); + Platform_errstring((CHAR*)"Type guard failed.", 19); break; case -6: - Platform_errstring((CHAR*)"Type equality failed.", (LONGINT)22); + Platform_errstring((CHAR*)"Type equality failed.", 22); break; case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", (LONGINT)34); + Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); break; case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", (LONGINT)41); + Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); break; case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60); + Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", (LONGINT)31); + Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); break; case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60); + Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); break; default: break; @@ -764,9 +764,9 @@ void Platform_Halt (LONGINT code) if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); } - Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20); + Platform_errstring((CHAR*)"Terminated by Halt(", 20); Platform_errint(code); - Platform_errstring((CHAR*)"). ", (LONGINT)4); + Platform_errstring((CHAR*)"). ", 4); if (code < 0) { Platform_DisplayHaltCode(code); } @@ -777,11 +777,11 @@ void Platform_Halt (LONGINT code) void Platform_AssertFail (LONGINT code) { INTEGER e; - Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19); + Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14); + Platform_errstring((CHAR*)" ASSERT code ", 14); Platform_errint(code); - Platform_errstring((CHAR*)".", (LONGINT)2); + Platform_errstring((CHAR*)".", 2); } Platform_errln(); Platform_exit(__VAL(INTEGER, code)); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { INTEGER i; i = 1; - __GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; @@ -813,7 +813,7 @@ export void *Platform__init(void) Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); Platform_CWD[0] = 0x00; - Platform_getCurrentDirectory((void*)Platform_CWD, ((LONGINT)(4096))); + Platform_getCurrentDirectory((void*)Platform_CWD, 4096); Platform_PID = Platform_getpid(); Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index aa08a76c..45566c5d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index a5a93902..0652d6b4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ INTEGER Reals_Expo (REAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ INTEGER Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; - __GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((SYSTEM_ADRINT)x + 3, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((SYSTEM_ADRINT)x + 2, c, CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - __GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER); + __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -124,20 +124,20 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while ((SYSTEM_INT64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); i += 1; } } void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1); } void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) { - Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); + Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 76bda39d..9836b502 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bd57ef4e..ad6ecbeb 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -113,7 +113,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int)dest__len - 1; + destLen = (SYSTEM_INT32)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index aa97eeac..f836f9f9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cd9388a6..01c67abc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" @@ -232,7 +232,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); - __COPY(name, F->name, ((LONGINT)(32))); + __COPY(name, F->name, 32); _o_result = F; return _o_result; } @@ -399,15 +399,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t e->file = ((Texts_Alien)E)->file; e->org = ((Texts_Alien)E)->org; e->span = ((Texts_Alien)E)->span; - __COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, e->mod, 32); + __COPY(((Texts_Alien)E)->proc, e->proc, 32); (*msg__).e = (Texts_Elem)e; } else __WITHCHK; } else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { if (__IS(msg__typ, Texts_IdentifyMsg, 1)) { Texts_IdentifyMsg *msg__ = (void*)msg; - __COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32))); - __COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32))); + __COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32); + __COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32); (*msg__).mod[31] = 0x01; } else __WITHCHK; } else if (__IS(msg__typ, Texts_FileMsg, 1)) { @@ -747,7 +747,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -781,21 +781,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) } if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') { do { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63)); - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i; (*S).class = 1; } else if (ch == '"') { Texts_Read((void*)&*S, S__typ, &ch); while ((((ch != '"' && ch >= ' ')) && i != 63)) { - (*S).s[__X(i, ((LONGINT)(64)))] = ch; + (*S).s[__X(i, 64)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } - (*S).s[__X(i, ((LONGINT)(64)))] = 0x00; + (*S).s[__X(i, 64)] = 0x00; (*S).len = i + 1; Texts_Read((void*)&*S, S__typ, &ch); (*S).class = 2; @@ -810,7 +810,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) hex = 0; j = 0; for (;;) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); if (ch < '0') { @@ -819,10 +819,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int)ch - 7); + ch = (CHAR)(ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int)ch - 39); + ch = (CHAR)(ch - 39); } else { break; } @@ -834,13 +834,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (int)d[__X(j, ((LONGINT)(32)))] - 48; + k = d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -852,7 +852,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Texts_Read((void*)&*S, S__typ, &ch); h = i; while (('0' <= ch && ch <= '9')) { - d[__X(i, ((LONGINT)(32)))] = ch; + d[__X(i, 32)] = ch; i += 1; Texts_Read((void*)&*S, S__typ, &ch); } @@ -861,12 +861,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y; + y = (d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -893,12 +893,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48); + x = x * (REAL)10 + (d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x; + x = (d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)((int)d[__X(j, ((LONGINT)(32)))] - 48); + k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -965,8 +965,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) (*W).fnt = Texts_FontsDefault; (*W).col = 15; (*W).voff = 0; - (*W).file = Files_New((CHAR*)"", (LONGINT)1); - Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0))); + (*W).file = Files_New((CHAR*)"", 1); + Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", (LONGINT)22); + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1064,7 +1064,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = x; } do { - a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1077,7 +1077,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]); + Texts_Write(&*W, W__typ, a[__X(i, 22)]); } while (!(i == 0)); } @@ -1091,16 +1091,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) do { y = __MASK(x, -16); if (y < 10) { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48); + a[__X(i, 20)] = (CHAR)(y + 48); } else { - a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55); + a[__X(i, 20)] = (CHAR)(y + 55); } x = __ASHR(x, 4); i += 1; } while (!(i == 8)); do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]); + Texts_Write(&*W, W__typ, a[__X(i, 20)]); } while (!(i == 0)); } @@ -1111,13 +1111,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) CHAR d[9]; e = Reals_Expo(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1154,13 +1154,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) x = x * 1.0000000e-001; e += 1; } - Reals_Convert(x, n, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, n, (void*)d, 9); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]); + Texts_Write(&*W, W__typ, d[__X(n, 9)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'E'); if (e < 0) { @@ -1197,7 +1197,7 @@ static void dig__54 (INTEGER n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; - Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]); + Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]); n -= 1; } } @@ -1223,7 +1223,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN Texts_Write(&*W, W__typ, '0'); seq__56(' ', k + 1); } else if (e == 255) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); seq__56(' ', n - 4); } else { e = __ASHR((e - 127) * 77, 8); @@ -1255,7 +1255,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN } e += 1; i = k + e; - Reals_Convert(x, i, (void*)d, ((LONGINT)(9))); + Reals_Convert(x, i, (void*)d, 9); if (e > 0) { seq__56(' ', ((n - e) - k) - 2); Texts_Write(&*W, W__typ, sign); @@ -1278,10 +1278,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { INTEGER i; CHAR d[8]; - Reals_ConvertH(x, (void*)d, ((LONGINT)(8))); + Reals_ConvertH(x, (void*)d, 8); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]); + Texts_Write(&*W, W__typ, d[__X(i, 8)]); i += 1; } while (!(i == 8)); } @@ -1293,13 +1293,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER CHAR d[16]; e = Reals_ExpoL(x); if (e == 0) { - Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4); + Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4); do { Texts_Write(&*W, W__typ, ' '); n -= 1; } while (!(n <= 3)); } else if (e == 2047) { - Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5); + Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5); while (n > 4) { Texts_Write(&*W, W__typ, ' '); n -= 1; @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (int)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1336,13 +1336,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER x = 1.00000000000000e-001 * x; e += 1; } - Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16))); + Reals_ConvertL(x, n, (void*)d, 16); n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); Texts_Write(&*W, W__typ, '.'); do { n -= 1; - Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(n, 16)]); } while (!(n == 0)); Texts_Write(&*W, W__typ, 'D'); if (e < 0) { @@ -1362,10 +1362,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { INTEGER i; CHAR d[16]; - Reals_ConvertHL(x, (void*)d, ((LONGINT)(16))); + Reals_ConvertHL(x, (void*)d, 16); i = 0; do { - Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]); + Texts_Write(&*W, W__typ, d[__X(i, 16)]); i += 1; } while (!(i == 16)); } @@ -1424,13 +1424,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT Files_Read(&*r, r__typ, (void*)&eno); if (eno > *Load0__16_s->ecnt) { *Load0__16_s->ecnt = eno; - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); - Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32); + Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32); } org = Files_Pos(&*r, r__typ); - M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32); if (M != NIL) { - Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32))); + Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32); if (Cmd != NIL) { (*Cmd)(); } @@ -1456,8 +1456,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT a->file = *Load0__16_s->f; a->org = org; a->span = span; - __COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32))); - __COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32))); + __COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32); + __COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32); *e = (Texts_Elem)a; } } @@ -1501,8 +1501,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) while (fno != 0) { if (fno > fcnt) { fcnt = fno; - Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32))); - fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32))); + Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32); + fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32); } Files_Read(&msg.r, Files_Rider__typ, (void*)&col); Files_Read(&msg.r, Files_Rider__typ, (void*)&voff); @@ -1557,9 +1557,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { - f = Files_New((CHAR*)"", (LONGINT)1); + f = Files_New((CHAR*)"", 1); } - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Read(&r, Files_Rider__typ, (void*)&tag); Files_Read(&r, Files_Rider__typ, (void*)&version); if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) { @@ -1571,7 +1571,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) u->col = 15; __NEW(p, Texts_PieceDesc); if ((tag == 0xf7 && version == 0x07)) { - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28))); + Files_Set(&r, Files_Rider__typ, f, 28); Files_ReadLInt(&r, Files_Rider__typ, &hlen); Files_Set(&r, Files_Rider__typ, f, 22 + hlen); Files_ReadLInt(&r, Files_Rider__typ, &T->len); @@ -1617,21 +1617,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E Files_Rider r1; LONGINT org, span; SHORTINT eno; - __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); - __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32))); + __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); + __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; - while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) { + while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) { eno += 1; } Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ)); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); - Files_WriteLInt(&*r, r__typ, ((LONGINT)(0))); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); + Files_WriteLInt(&*r, r__typ, 0); Files_Write(&*r, r__typ, eno); if (eno == *Store__39_s->ecnt) { *Store__39_s->ecnt += 1; - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32))); - Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32))); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32); + Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32); } (*Store__39_s->msg).pos = pos; org = Files_Pos(&*r, r__typ); @@ -1666,7 +1666,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) org = Files_Pos(&*r, r__typ); msg.id = 1; msg.r = *r; - Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0))); + Files_WriteLInt(&msg.r, Files_Rider__typ, 0); u = T->head->next; pos = 0; delta = 0; @@ -1680,15 +1680,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) iden.mod[0] = 0x01; } if (iden.mod[0] != 0x00) { - fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt; + fnts[__X(fcnt, 32)] = u->fnt; fno = 1; - while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) { + while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) { fno += 1; } Files_Write(&msg.r, Files_Rider__typ, fno); if (fno == fcnt) { fcnt += 1; - Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32))); + Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32); } Files_Write(&msg.r, Files_Rider__typ, u->col); Files_Write(&msg.r, Files_Rider__typ, u->voff); @@ -1737,12 +1737,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org); delta = ((Texts_Piece)u)->len; while (delta > 1024) { - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024))); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024); delta -= 1024; } - Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); - Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta); + Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta); + Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta); } } else __WITHCHK; } else { @@ -1756,7 +1756,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) } __GUARDEQR(r, r__typ, Files_Rider) = msg.r; if (T->notify != NIL) { - (*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0))); + (*T->notify)(T, 3, 0, 0); } Store__39_s = _s.lnk; } @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); - Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0))); + Files_Set(&r, Files_Rider__typ, f, 0); Files_Write(&r, Files_Rider__typ, 0xf0); Files_Write(&r, Files_Rider__typ, 0x01); Texts_Store(&r, Files_Rider__typ, T); @@ -1777,13 +1777,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) while (name[__X(i, name__len)] != 0x00) { i += 1; } - __COPY(name, bak, ((LONGINT)(64))); - bak[__X(i, ((LONGINT)(64)))] = '.'; - bak[__X(i + 1, ((LONGINT)(64)))] = 'B'; - bak[__X(i + 2, ((LONGINT)(64)))] = 'a'; - bak[__X(i + 3, ((LONGINT)(64)))] = 'k'; - bak[__X(i + 4, ((LONGINT)(64)))] = 0x00; - Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res); + __COPY(name, bak, 64); + bak[__X(i, 64)] = '.'; + bak[__X(i + 1, 64)] = 'B'; + bak[__X(i + 2, 64)] = 'a'; + bak[__X(i + 3, 64)] = 'k'; + bak[__X(i + 4, 64)] = 0x00; + Files_Rename(name, name__len, bak, 64, &res); Files_Register(f); __DEL(name); } diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b591e699..699c0323 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 19624204..ffe27b0f 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -34,31 +34,31 @@ void Vishap_Module (BOOLEAN *done) OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256))); + OPM_OpenFiles((void*)OPT_SelfName, 256); OPC_Init(); OPV_Module(p); if (OPM_noerr) { if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16); + OPM_LogWStr((CHAR*)" Main program.", 16); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"32m", (LONGINT)4); + vt100_SetAttr((CHAR*)"32m", 4); } - OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19); + OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!OPM_notColorOutput) { - vt100_SetAttr((CHAR*)"0m", (LONGINT)3); + vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24); + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); OPM_RegisterNewSym(); } } @@ -95,7 +95,7 @@ void Vishap_Translate (void) modulesobj[0] = 0x00; if (OPM_OpenPar()) { for (;;) { - OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256))); + OPM_Init(&done, (void*)Vishap_mname, 256); if (!done) { return; } @@ -105,21 +105,21 @@ void Vishap_Translate (void) Vishap_Module(&done); if (!done) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); OPM_LogWLn(); Platform_Exit(1); } if (!OPM_dontAsm) { if (OPM_dontLink) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); + extTools_Assemble(OPM_modName, 32); } else { if (!(OPM_mainProg || OPM_mainLinkStat)) { - extTools_Assemble(OPM_modName, ((LONGINT)(32))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048))); - Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048))); + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048))); + extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); } } } @@ -134,7 +134,7 @@ static void Vishap_Trap (INTEGER sig) Platform_Exit(0); } else { if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35); + OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); OPM_LogWLn(); } Platform_Exit(2); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5493978e..57e3252c 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 8ce5a106..abc550ac 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 72df4f99..4e7d428f 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -36,14 +36,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); - Console_String((CHAR*)"-- failed: status ", (LONGINT)19); - Console_Int(status, ((LONGINT)(1))); - Console_String((CHAR*)", exitcode ", (LONGINT)12); - Console_Int(exitcode, ((LONGINT)(1))); - Console_String((CHAR*)".", (LONGINT)2); + Console_String((CHAR*)"-- failed: status ", 19); + Console_Int(status, 1); + Console_String((CHAR*)", exitcode ", 12); + Console_Int(exitcode, 1); + Console_String((CHAR*)".", 2); Console_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47); + Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); Console_Ln(); } if (status != 0) { @@ -61,11 +61,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023))); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023); __DEL(moduleName); } @@ -74,21 +74,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); __MOVE("gcc -g", cmd, 7); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); + Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); + Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023); } - Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023))); - Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023))); - extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); + Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); + Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); + Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -103,11 +103,11 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023))); - Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023))); - Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023))); + Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4523936a..b5b2af96 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index efcf43ab..037caf04 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" @@ -69,12 +69,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); - b[__X(e, ((LONGINT)(21)))] = 0x00; - vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1); + b[__X(e, 21)] = 0x00; + vt100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } @@ -83,9 +83,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, ((LONGINT)(9))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9))); - Console_String(cmd, ((LONGINT)(9))); + __COPY(vt100_CSI, cmd, 9); + Strings_Append(letter, letter__len, (void*)cmd, 9); + Console_String(cmd, 9); __DEL(letter); } @@ -94,11 +94,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -107,11 +107,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2))); - __COPY(vt100_CSI, cmd, ((LONGINT)(7))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7))); - Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7))); - Console_String(cmd, ((LONGINT)(7))); + vt100_IntToStr(n, (void*)nstr, 2); + __COPY(vt100_CSI, cmd, 7); + Strings_Append(letter, letter__len, (void*)cmd, 7); + Strings_Append(nstr, 2, (void*)cmd, 7); + Console_String(cmd, 7); __DEL(letter); } @@ -120,124 +120,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5))); - vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5))); - __COPY(vt100_CSI, cmd, ((LONGINT)(12))); - Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12))); - Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12))); - Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12))); - Console_String(cmd, ((LONGINT)(12))); + vt100_IntToStr(n, (void*)nstr, 5); + vt100_IntToStr(m, (void*)mstr, 5); + __COPY(vt100_CSI, cmd, 12); + Strings_Append(nstr, 5, (void*)cmd, 12); + Strings_Append((CHAR*)";", 2, (void*)cmd, 12); + Strings_Append(mstr, 5, (void*)cmd, 12); + Strings_Append(letter, letter__len, (void*)cmd, 12); + Console_String(cmd, 12); __DEL(letter); } void vt100_CUU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"A", 2); } void vt100_CUD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"B", 2); } void vt100_CUF (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"C", 2); } void vt100_CUB (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"D", 2); } void vt100_CNL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"E", 2); } void vt100_CPL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"F", 2); } void vt100_CHA (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"G", 2); } void vt100_CUP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"H", 2); } void vt100_ED (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"J", 2); } void vt100_EL (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"K", 2); } void vt100_SU (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"S", 2); } void vt100_SD (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"T", 2); } void vt100_HVP (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"f", 2); } void vt100_SGR (INTEGER n) { - vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq(n, (CHAR*)"m", 2); } void vt100_SGR2 (INTEGER n, INTEGER m) { - vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2); + vt100_EscSeq2(n, m, (CHAR*)"m", 2); } void vt100_DSR (INTEGER n) { - vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2); + vt100_EscSeq(6, (CHAR*)"n", 2); } void vt100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", (LONGINT)2); + vt100_EscSeq0((CHAR*)"s", 2); } void vt100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", (LONGINT)2); + vt100_EscSeq0((CHAR*)"u", 2); } void vt100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25l", 5); } void vt100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5); + vt100_EscSeq0((CHAR*)"\?25h", 5); } void vt100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, ((LONGINT)(16))); - Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16))); - Console_String(tmpstr, ((LONGINT)(16))); + __COPY(vt100_CSI, tmpstr, 16); + Strings_Append(attr, attr__len, (void*)tmpstr, 16); + Console_String(tmpstr, 16); __DEL(attr); } @@ -253,7 +253,7 @@ export void *vt100__init(void) __REGCMD("RCP", vt100_RCP); __REGCMD("SCP", vt100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, ((LONGINT)(5))); - Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5))); + __COPY("\033", vt100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 65ae6d58..0b63640a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index b8244fd3..ea629ba1 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1260,14 +1260,30 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1("__HALT(#)", n) END Halt; + PROCEDURE IntLiteral*(n, size: LONGINT); + BEGIN + IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN + CASE size OF + |2: OPM.WriteString("((SYSTEM_INT16)("); + |4: OPM.WriteString("((SYSTEM_INT32)("); + |8: OPM.WriteString("((SYSTEM_INT64)("); + ELSE OPM.LogWStr("Unhandled case in OPC.IntLiteral, size = "); OPM.LogWNum(size,1); OPM.LogWLn; + END; + OPM.WriteInt(n); + OPM.WriteString("))") + ELSE + OPM.WriteInt(n) + END + END IntLiteral; + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); BEGIN IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) - WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(array^.n); OPM.WriteString("))"); + WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 07b5b89f..10ee8ebb 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -74,6 +74,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; + (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + CIntSize* = 4; + CIntMax* = 7FFFFFFFH; + CIntMin* = -CIntMax - 1; + + SFext = ".sym"; (* symbol file extension *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index efaac954..4b1eda69 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1219,7 +1219,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp); +(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) + EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index a3e2272d..997fdccb 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -295,10 +295,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END Entier; - PROCEDURE SizeCast(size: LONGINT); + PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF size <= 4 THEN OPM.WriteString("(int)") - ELSE OPM.WriteString("(SYSTEM_INT64)") + IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + CASE to OF + |1: OPM.WriteString("(SYSTEM_INT8)"); + |2: OPM.WriteString("(SYSTEM_INT16)"); + |4: OPM.WriteString("(SYSTEM_INT32)"); + |8: OPM.WriteString("(SYSTEM_INT64)"); + ELSE OPM.LogWStr("Unhandled case in OPC.SizeCast, to = "); OPM.LogWNum(to,1); OPM.LogWLn; + END END END SizeCast; @@ -312,8 +318,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) ELSE - IF newtype.size # n.typ.size THEN SizeCast(newtype.size) END; - Entier(n, 9) + SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); @@ -443,6 +448,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF prec > designPrec THEN OPM.Write(CloseParen) END END design; + PROCEDURE ParIntLiteral(n, size: LONGINT); + BEGIN + (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) + IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END + END ParIntLiteral; + PROCEDURE ActualPar(n: OPT.Node; fp: OPT.Object); VAR typ, aptyp: OPT.Struct; comp, form, mode, prec, dim: INTEGER; BEGIN @@ -465,8 +476,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - ELSIF (form = OPT.LInt) & (n^.typ^.form < OPT.LInt) THEN (* integral promotion *) + (* + ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) OPM.WriteString("(LONGINT)"); prec := 9 + *) + ELSIF form IN OPT.intSet THEN + SizeCast(n.typ.size, typ.size) END END ELSIF ansi THEN @@ -475,9 +490,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form = OPT.LInt) & (n^.class = OPT.Nconst) - & (n^.conval^.intval <= OPM.SignedMaximum(OPM.IntSize)) & (n^.conval^.intval >= OPM.SignedMinimum(OPM.IntSize)) THEN - OPM.WriteString("((LONGINT)("); expr(n, prec); OPM.WriteString("))"); + ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) END; @@ -485,7 +499,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); OPM.WriteString("(LONGINT)"); OPM.WriteInt(n^.conval^.intval2) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -497,7 +511,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 WHILE aptyp^.comp = OPT.DynArr DO Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; - OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))"); + (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) + ParIntLiteral(aptyp.size, OPM.PointerSize) END END END ; @@ -551,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.conv: Convert(l, n.typ, exprPrec) | OPT.abs: IF SideEffects(l) THEN IF l^.typ^.form < OPT.Real THEN - IF l^.typ^.form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF l.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END ; OPM.WriteString("__ABSF(") ELSE OPM.WriteString("__ABSFD(") END @@ -560,7 +575,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(LONGINT)(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -616,11 +631,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString("__ROT(") END | OPS.div: IF SideEffects(n) THEN - IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; OPM.WriteString("__DIVF(") ELSE OPM.WriteString("__DIV(") END - | OPS.mod: IF form < OPT.LInt THEN OPM.WriteString("(int)") END ; + | OPS.mod: IF n.typ.size <= OPM.CIntSize THEN OPM.WriteString("(int)") END; IF SideEffects(n) THEN OPM.WriteString("__MODF(") ELSE OPM.WriteString("__MOD(") END; @@ -782,18 +797,20 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF base^.form = OPT.Pointer THEN OPM.WriteString("POINTER__typ") ELSE OPM.WriteString("NIL") END ; - OPM.WriteString(", "); OPM.WriteString("((LONGINT)("); OPM.WriteInt(base^.size); OPM.WriteString("))"); + OPM.WriteString(", "); OPM.WriteInt(base.size); OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN - IF x^.class = OPT.Nconst THEN OPM.WriteString("(LONGINT)("); expr(x, MinPrec); OPM.WriteString(")") - ELSE OPM.WriteString("(LONGINT)"); expr(x, 10) + IF x^.class = OPT.Nconst THEN + OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link - ELSE OPM.WriteString("(LONGINT)"); OPM.WriteInt(typ^.n) + ELSE + OPC.IntLiteral(typ.n, OPM.PointerSize) END ; typ := typ^.BaseTyp END ; From a1fd798f6d63622063833360e19ed5be8e082217 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 18:33:53 +0100 Subject: [PATCH 008/140] Remove all use of forms SInt and LInt and remove intSet using just Int instead. --- bootstrap/unix-44/Files.c | 16 ++-- bootstrap/unix-44/Heap.c | 16 ++-- bootstrap/unix-44/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-44/OPC.c | 18 ++-- bootstrap/unix-44/OPM.c | 22 ++--- bootstrap/unix-44/OPP.c | 26 +++--- bootstrap/unix-44/OPS.c | 6 +- bootstrap/unix-44/OPT.c | 30 +++---- bootstrap/unix-44/OPV.c | 20 ++--- bootstrap/unix-44/Platform.c | 8 +- bootstrap/unix-44/Reals.c | 8 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Texts.c | 22 ++--- bootstrap/unix-48/Files.c | 16 ++-- bootstrap/unix-48/Heap.c | 16 ++-- bootstrap/unix-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-48/OPC.c | 18 ++-- bootstrap/unix-48/OPM.c | 22 ++--- bootstrap/unix-48/OPP.c | 26 +++--- bootstrap/unix-48/OPS.c | 6 +- bootstrap/unix-48/OPT.c | 30 +++---- bootstrap/unix-48/OPV.c | 20 ++--- bootstrap/unix-48/Platform.c | 8 +- bootstrap/unix-48/Reals.c | 8 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Texts.c | 22 ++--- bootstrap/unix-88/Files.c | 4 +- bootstrap/unix-88/Heap.c | 16 ++-- bootstrap/unix-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/unix-88/OPC.c | 4 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPP.c | 20 ++--- bootstrap/unix-88/OPT.c | 16 ++-- bootstrap/unix-88/OPV.c | 14 +-- bootstrap/unix-88/Platform.c | 4 +- bootstrap/windows-48/Files.c | 16 ++-- bootstrap/windows-48/Heap.c | 16 ++-- bootstrap/windows-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/windows-48/OPC.c | 18 ++-- bootstrap/windows-48/OPM.c | 22 ++--- bootstrap/windows-48/OPP.c | 26 +++--- bootstrap/windows-48/OPS.c | 6 +- bootstrap/windows-48/OPT.c | 30 +++---- bootstrap/windows-48/OPV.c | 20 ++--- bootstrap/windows-48/Platform.c | 8 +- bootstrap/windows-48/Reals.c | 8 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Texts.c | 22 ++--- bootstrap/windows-88/Files.c | 4 +- bootstrap/windows-88/Heap.c | 16 ++-- bootstrap/windows-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/windows-88/OPC.c | 4 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPP.c | 20 ++--- bootstrap/windows-88/OPT.c | 16 ++-- bootstrap/windows-88/OPV.c | 14 +-- bootstrap/windows-88/Platform.c | 4 +- src/compiler/OPB.Mod | 146 +++++++++++++++----------------- src/compiler/OPC.Mod | 8 +- src/compiler/OPP.Mod | 18 ++-- src/compiler/OPT.Mod | 29 +++---- src/compiler/OPV.Mod | 20 ++--- 62 files changed, 828 insertions(+), 861 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 58a4ec95..e473e702 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 01a8d9ef..5ae22903 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 6e34dddd..9801d5f9 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a0e79aca..08d1739f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 273d1182..60cb401c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5f7d65a2..4d32ed53 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index f66fdf2c..efbe5376 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 000e1aef..9f696edc 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -178,7 +178,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN f := y^.typ^.form; IF x^.class >= OPT.Nconst THEN err(79) - ELSIF ~(f IN OPT.intSet) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; + ELSIF (f # OPT.Int) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp; IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp; @@ -241,7 +241,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR f: INTEGER; k: LONGINT; BEGIN f := x^.typ^.form; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (y^.typ^.form = OPT.Set) THEN + ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) @@ -298,10 +298,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(98) END - |OPS.plus: IF ~(f IN OPT.intSet + OPT.realSet) THEN err(96) END - |OPS.minus: IF f IN OPT.intSet + OPT.realSet +{OPT.Set}THEN + |OPS.plus: IF ~(f IN {OPT.Int} + OPT.realSet) THEN err(96) END + |OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END @@ -313,9 +313,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(97) END - |OPT.abs: IF f IN OPT.intSet + OPT.realSet THEN + |OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) END @@ -333,7 +333,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(111); z^.typ := OPT.chartyp END - |OPT.odd: IF f IN OPT.intSet THEN + |OPT.odd: IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL ELSE z := NewOp(op, typ, z) @@ -348,7 +348,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(127) END ; z^.typ := OPT.linttyp - |OPT.cc: IF (f IN OPT.intSet) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) + |OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END ELSE err(69) END ; @@ -426,7 +426,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Undef: res := OPS.eql |OPT.Byte, OPT.Char - ..OPT.LInt: IF xval^.intval < yval^.intval THEN res := OPS.lss + ..OPT.Int: IF xval^.intval < yval^.intval THEN res := OPS.lss ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr ELSE res := OPS.eql END @@ -463,19 +463,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Char: IF g = OPT.String THEN CharToString(x) ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END ; - |OPT.SInt, - OPT.Int, - OPT.LInt: IF g IN OPT.intSet THEN + |OPT.Int: IF g = OPT.Int THEN IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.Real: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.Real: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.LReal: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.LReal: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END @@ -490,7 +488,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := x^.typ^.form END ; (* {x^.typ = y^.typ} *) CASE op OF - |OPS.times: IF f IN OPT.intSet THEN xv := xval^.intval; yv := yval^.intval; + |OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval; IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR @@ -509,7 +507,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval * yval^.setval ELSIF f # OPT.Undef THEN err(101) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval) ELSE err(205); xval^.realval := 1.0 @@ -525,14 +523,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval / yval^.setval ELSIF f # OPT.Undef THEN err(102) END - |OPS.div: IF f IN OPT.intSet THEN + |OPS.div: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x) ELSE err(205) END ELSIF f # OPT.Undef THEN err(103) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x) ELSE err(205) @@ -543,7 +541,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval)) ELSE err(94) END - |OPS.plus: IF f IN OPT.intSet THEN + |OPS.plus: IF f = OPT.Int THEN temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) @@ -559,7 +557,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval + yval^.setval ELSIF f # OPT.Undef THEN err(105) END - |OPS.minus: IF f IN OPT.intSet THEN + |OPS.minus: IF f = OPT.Int THEN IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) @@ -598,12 +596,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END END ConstOp; - PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); + PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; IF x^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN - IF g IN OPT.intSet THEN + IF f = OPT.Int THEN + IF g = OPT.Int THEN IF f > g THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END @@ -668,17 +666,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g := y^.typ^.form; CASE z^.typ^.form OF |OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END - |OPT.SInt, - OPT.Int, - OPT.LInt: IF (g IN OPT.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) - ELSIF g IN OPT.intSet + OPT.realSet THEN Convert(z, y.typ) + |OPT.Int: IF (g = OPT.Int) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ) ELSE err(100) END - |OPT.Real: IF g IN OPT.intSet THEN Convert(y, z^.typ) + |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) ELSE err(100) END - |OPT.LReal: IF g IN OPT.intSet + OPT.realSet THEN Convert(y, z^.typ) + |OPT.LReal: IF g IN {OPT.Int} + OPT.realSet THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *) ELSE err(100) END @@ -693,7 +689,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) typ := z^.typ; f := typ^.form; g := y^.typ^.form; CASE op OF |OPS.times: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN val := z^.conval^.intval; IF val = 1 THEN do := FALSE; z := y ELSIF val = 0 THEN do := FALSE @@ -711,7 +707,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ; Convert(z, OPT.realtyp); Convert(y, OPT.realtyp); typ := OPT.realtyp @@ -721,7 +717,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; NewOp(op, typ, z, y) |OPS.div: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN val := y^.conval^.intval; IF val = 0 THEN err(205) ELSIF val = 1 THEN do := FALSE @@ -732,7 +728,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN IF y^.conval^.intval = 0 THEN err(205) ELSIF log(y^.conval^.intval) = 1 THEN @@ -752,15 +748,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp END - |OPS.plus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; + |OPS.plus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ; IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.minus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; - IF ~(f IN OPT.intSet) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END + |OPS.minus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; + IF (f # OPT.Int) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END |OPS.or: IF f = OPT.Bool THEN IF z^.class = OPT.Nconst THEN IF ~IntToBool(z^.conval^.intval) THEN z := y END @@ -795,7 +791,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k, l: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.typ^.form IN OPT.intSet) & (y^.typ^.form IN OPT.intSet) THEN + ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END @@ -821,7 +817,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN OPT.intSet) THEN err(93) + ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} @@ -854,15 +850,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Undef, OPT.String: - | OPT.Byte: IF ~((g IN ({OPT.Byte, OPT.Char} + OPT.intSet)) & (y.size = 1)) THEN err(113) END + | OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END | OPT.Bool, OPT.Char, OPT.Set: IF g # f THEN err(113) END - | OPT.SInt, - OPT.Int, - OPT.LInt: IF ~(g IN OPT.intSet) OR (x.size < y.size) THEN err(113) END - | OPT.Real: IF ~(g IN {OPT.SInt..OPT.Real}) THEN err(113) END - | OPT.LReal: IF ~(g IN {OPT.SInt..OPT.LReal}) THEN err(113) END + | OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END + | OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END + | OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) ELSIF g = OPT.Pointer THEN p := x^.BaseTyp; q := y^.BaseTyp; @@ -909,7 +903,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; - IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.SInt..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN + IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.Int..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN Convert(ynode, x) END END CheckAssign; @@ -928,7 +922,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN x := par0; f := x^.typ^.form; CASE fctno OF |OPT.haltfn: (*HALT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x) ELSE err(218) @@ -974,9 +968,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(FALSE) | OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) | OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) @@ -989,9 +981,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(TRUE) | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) @@ -1001,12 +991,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.chrfn: (*CHR*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN {OPT.Undef} + OPT.intSet THEN Convert(x, OPT.chartyp) + ELSIF f IN {OPT.Undef, OPT.Int} THEN Convert(x, OPT.chartyp) ELSE err(111); x^.typ := OPT.chartyp END |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, -1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) @@ -1014,7 +1004,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, 1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) @@ -1024,7 +1014,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.incfn, OPT.decfn: (*INC, DEC*) IF NotVar(x) THEN err(112) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSIF x^.readonly THEN err(76) END |OPT.inclfn, @@ -1043,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END @@ -1061,19 +1051,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet + {OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) + ELSIF ~(f IN {OPT.Int, OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) END |OPT.getfn, OPT.putfn, OPT.bitfn, OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END ELSE err(69) END @@ -1114,7 +1104,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp ELSE IF x^.typ # p^.typ THEN - IF (x^.class = OPT.Nconst) & (f IN OPT.intSet) THEN Convert(x, p^.typ) + IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ) ELSE err(111) END END ; @@ -1124,7 +1114,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) END ; p := NewOp(OPT.Nassign, fctno, p, x) @@ -1132,7 +1122,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; p^.typ := OPT.notyp |OPT.lenfn: (*LEN*) - IF ~(f IN OPT.intSet) OR (x^.class # OPT.Nconst) THEN err(69) + IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69) ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) L := SHORT(x^.conval^.intval); typ := p^.typ; WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; @@ -1156,7 +1146,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 ELSIF x^.conval^.intval >= 0 THEN @@ -1174,7 +1164,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.newfn: (*NEW(p, x...)*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp = OPT.DynArr THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ELSE err(111) END ; @@ -1184,7 +1174,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSE IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ; p^.typ := p^.left^.typ @@ -1205,7 +1195,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.bitfn: (*SYSTEM.BIT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Ndop, OPT.bit, p, x) ELSE err(111) END ; @@ -1229,19 +1219,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.typ := p^.typ; p := x |OPT.sysnewfn: (*SYSTEM.NEW*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x) ELSE err(111) END ; p^.typ := OPT.notyp |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x); x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; @@ -1266,7 +1256,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp # OPT.DynArr THEN err(64) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ; node := p^.right; WHILE node^.link # NIL DO node := node^.link END; node^.link := x; p^.typ := p^.typ^.BaseTyp @@ -1274,7 +1264,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p; node^.left := p^.link; p^.link := x; p := node ELSE err(111) @@ -1333,7 +1323,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN (* ftyp^.comp = OPT.DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (atyp.size = 1)) THEN + IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN IF OPM.verbose IN OPM.opt THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN @@ -1386,7 +1376,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (ap.typ.size = 1))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123) ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index ea629ba1..50ba59a0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1237,9 +1237,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString('case '); CASE form OF | OPT.Char: CharacterLiteral(caseVal) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(caseVal); + | OPT.Int: OPM.WriteInt(caseVal); ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; END; OPM.WriteString(': '); @@ -1295,9 +1293,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPT.Byte: OPM.WriteInt(con^.intval) | OPT.Bool: OPM.WriteInt(con^.intval) | OPT.Char: CharacterLiteral(con.intval) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(con^.intval) + | OPT.Int: OPM.WriteInt(con^.intval) | OPT.Real: OPM.WriteReal(con^.realval, "f") | OPT.LReal: OPM.WriteReal(con^.realval, 0X) | OPT.Set: OPM.WriteString("0x"); diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 4e53ad05..84966442 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -74,7 +74,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN sf := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; @@ -152,7 +152,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ELSE typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN n := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN n := x^.conval^.intval; IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; @@ -669,16 +669,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval + IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 END; - IF f IN OPT.intSet THEN - IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END + IF f = OPT.Int THEN + IF ~(LabelTyp.form = OPT.Int) OR (LabelTyp.size < x.typ.size) THEN err(60) END ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; - IF (y^.typ^.form # f) & ~((f IN OPT.intSet) & (y^.typ^.form IN OPT.intSet)) THEN err(60) END ; + IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval END ; @@ -714,7 +714,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) BEGIN Expression(x); pos := OPM.errpos; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.LInt}) THEN err(125) + ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.Int}) THEN err(125) END ; CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP @@ -802,7 +802,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSIF sym = OPS.for THEN OPS.Get(sym); IF sym = OPS.ident THEN qualident(id); - IF ~(id^.typ^.form IN OPT.intSet) THEN err(68) END ; + IF ~(id^.typ^.form = OPT.Int) THEN err(68) END ; CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos; x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x); CheckSym(OPS.to); Expression(y); pos := OPM.errpos; @@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113) + ELSIF ~(y^.typ^.form = OPT.Int) OR (y.typ.size > x.left.typ.size) THEN err(113) END ; OPB.Link(stat, last, x); IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 4b1eda69..82c1b477 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -91,12 +91,12 @@ TYPE CONST (* Struct.form values *) Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; - SInt* = 4; Int* = 5; LInt* = 6; + Int* = 5; Real* = 7; LReal* = 8; Set* = 9; String* = 10; NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; Comp* = 15; - intSet* = {SInt..LInt}; realSet* = {Real, LReal}; + realSet* = {Real, LReal}; (* Struct.comp - Composite structure forms *) Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4; @@ -224,7 +224,7 @@ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN - ASSERT(x.form IN intSet); + ASSERT(x.form = Int); ASSERT((dir = 1) OR (dir = -1)); (* Not sure if StPar0 (which calls this) always gets the baseiest type. This ASSERT will tell me. *) @@ -517,9 +517,7 @@ BEGIN CASE f OF | Bool, Char, - SInt, - Int, - LInt: OPM.FPrint(fprint, obj^.conval^.intval) + Int: OPM.FPrint(fprint, obj^.conval^.intval) | Set: OPM.FPrintSet(fprint, obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval) | LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval) @@ -632,9 +630,7 @@ BEGIN | Byte, Char, Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch) - | SInt, - Int, - LInt: conval^.intval := OPM.SymRInt() + | Int: conval^.intval := OPM.SymRInt() | Set: OPM.SymRSet(conval^.setval) | Real: OPM.SymRReal(rval); conval^.realval := rval; conval^.intval := OPM.ConstNotAlloc @@ -706,7 +702,7 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; BEGIN - IF tag IN intSet THEN + IF tag = Int THEN RETURN IntType(OPM.SymRInt()) ELSE RETURN impCtxt.ref[tag] @@ -1027,7 +1023,7 @@ END Import; VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); - IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END + IF typ.ref = Int THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1072,9 +1068,7 @@ END Import; CASE f OF | Bool, Char: OPM.SymWCh(CHR(obj^.conval^.intval)) - | SInt, - Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) + | Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1222,7 +1216,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); +(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*) + EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1253,9 +1248,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[SInt] := sinttyp; +(*impCtxt.ref[SInt] := sinttyp;*) impCtxt.ref[Int] := inttyp; - impCtxt.ref[LInt] := linttyp; +(*impCtxt.ref[LInt] := linttyp;*) impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 997fdccb..6eb2ffb0 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -297,7 +297,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN CASE to OF |1: OPM.WriteString("(SYSTEM_INT8)"); |2: OPM.WriteString("(SYSTEM_INT16)"); @@ -312,7 +312,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) - ELSIF to IN OPT.intSet THEN + ELSIF to = OPT.Int THEN IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); @@ -474,13 +474,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("(void*)") (* type extension *) END ELSE - IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) + IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - (* - ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) - OPM.WriteString("(LONGINT)"); prec := 9 - *) - ELSIF form IN OPT.intSet THEN + ELSIF form = OPT.Int THEN SizeCast(n.typ.size, typ.size) END END @@ -490,7 +486,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ELSIF (form = OPT.Int) & (n^.class = OPT.Nconst) THEN ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) @@ -582,8 +578,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, exprPrec) END | OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*) - OR (n^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) - & (l^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + OR (n^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + & (l^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) & (n^.typ^.size = l^.typ^.size) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); @@ -670,7 +666,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END | OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ") ELSE OPM.WriteString(" / "); - IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN OPT.intSet) THEN + IF (r^.obj = NIL) OR (r^.obj^.typ^.form = OPT.Int) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen) END END From 68cf60c4011c5dc4f7c58b35a680ce9f4eb57b81 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 18:46:03 +0100 Subject: [PATCH 009/140] Renumber forms removing gaps for SInt and LInt. --- src/compiler/OPT.Mod | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 82c1b477..a60f30f8 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -91,10 +91,10 @@ TYPE CONST (* Struct.form values *) Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; - Int* = 5; - Real* = 7; LReal* = 8; Set* = 9; String* = 10; - NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; - Comp* = 15; + Int* = 4; + Real* = 5; LReal* = 6; Set* = 7; String* = 8; + NilTyp* = 9; NoTyp* = 10; Pointer* = 11; ProcTyp* = 12; + Comp* = 13; realSet* = {Real, LReal}; @@ -1213,10 +1213,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); -(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); -(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*) EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) @@ -1248,9 +1246,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; -(*impCtxt.ref[SInt] := sinttyp;*) impCtxt.ref[Int] := inttyp; -(*impCtxt.ref[LInt] := linttyp;*) impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1297,9 +1293,7 @@ Objects: Byte Basic | Bool Basic | Char Basic | - SInt Basic | - Int Basic | - LInt Basic | + Int Basic | size determine SHORT vs LONG XInt Basic | bits Real Basic | LReal Basic | From 159f5a3d80d05fdc68aee23ff2fffb2d51661a65 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 12:04:17 +0100 Subject: [PATCH 010/140] Update bootstrap source and snapshot binaries --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 366 +++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 68 ++-- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 52 +-- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 132 ++++---- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 74 ++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 366 +++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 68 ++-- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 52 +-- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 132 ++++---- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 74 ++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 366 +++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 68 ++-- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 52 +-- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 132 ++++---- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 74 ++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 366 +++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 68 ++-- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 52 +-- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 132 ++++---- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 74 ++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 366 +++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 68 ++-- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 52 +-- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 132 ++++---- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 74 ++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/test/confidence/planned-binary-change | 2 +- 196 files changed, 1906 insertions(+), 1906 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 124f7163..816df1b9 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a6db1a11..bd3e3fd5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 61089cbd..985572ec 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2508f6f7..033e03cf 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 4c7f2849..34d088bf 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index e473e702..df4278f7 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 34a403f2..c878ff62 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 124f7163..816df1b9 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a6db1a11..bd3e3fd5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 61089cbd..985572ec 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2508f6f7..033e03cf 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 4c7f2849..34d088bf 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index bd5d1115..dddea925 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index be79016b..5499c3d0 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5a7e6896..f4abd052 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b38a0aa6..c756e930 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index bb971366..d884a64a 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 22d598fb..8d9e2fb5 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 5ae22903..67a7a958 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 17323792..3be486fe 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a5063871..5822f690 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index eebee23c..5e7c01fb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5929cd57..004f1f8b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 03458258..6f5e4cad 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fef28dff..eacff2d0 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -318,7 +318,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -438,10 +438,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -505,7 +505,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -516,7 +516,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -568,21 +568,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -645,9 +645,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -682,7 +682,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -700,7 +700,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -717,7 +717,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -787,7 +787,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -803,14 +803,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -819,7 +819,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -857,7 +857,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -865,17 +865,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -884,11 +884,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -896,11 +896,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -908,26 +908,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -950,7 +950,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -958,23 +958,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -982,14 +982,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1028,7 +1028,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1036,21 +1036,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1058,7 +1058,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1078,28 +1078,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1132,7 +1132,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1141,8 +1141,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1191,25 +1191,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1248,49 +1248,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1337,7 +1337,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1346,18 +1346,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1463,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1472,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1577,40 +1577,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1627,28 +1627,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1720,7 +1720,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1758,7 +1758,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1778,17 +1778,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1809,17 +1809,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,14 +1843,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1859,14 +1859,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1901,18 +1901,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1929,7 +1929,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1970,14 +1970,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2168,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2194,7 +2194,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2385,7 +2385,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2409,7 +2409,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2426,7 +2426,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2458,17 +2458,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0b71f987..7b980a10 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b8a0608e..ad70616c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -228,12 +228,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -278,16 +278,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -332,19 +332,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -358,7 +358,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -373,7 +373,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -394,7 +394,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -436,7 +436,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -541,7 +541,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -613,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -636,7 +636,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -674,7 +674,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -693,13 +693,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -890,7 +890,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1018,7 +1018,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1027,7 +1027,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1044,7 +1044,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1381,7 +1381,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1400,7 +1400,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1563,7 +1563,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1977,16 +1977,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2009,10 +2009,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 21b48db8..bb250e9a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 450ed83d..228e7978 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 5363c227..6bbab25d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index becc2507..9337c539 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -159,7 +159,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -254,7 +254,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -266,10 +266,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -302,7 +302,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -410,7 +410,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -460,7 +460,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -489,7 +489,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -504,7 +504,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -522,7 +522,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -544,7 +544,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -573,7 +573,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -872,10 +872,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -889,7 +889,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -897,7 +897,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1527,7 +1527,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7a12f897..863db6d6 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2ee978f2..e575dfe6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a8dccfed..a60ffe74 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index f8762935..35088301 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -285,7 +285,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -484,14 +484,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -520,7 +520,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -532,8 +532,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -596,7 +596,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -604,7 +604,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -650,23 +650,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -851,22 +851,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -878,7 +878,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1055,20 +1055,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1079,7 +1079,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1113,7 +1113,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1192,7 +1192,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1289,7 +1289,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1356,7 +1356,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1475,15 +1475,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1538,24 +1538,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1669,7 +1669,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1845,16 +1845,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1872,12 +1872,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,14 +1905,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index acf2e9e9..c3fdc0cf 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b5cebda5..c769935e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -123,14 +123,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -163,7 +163,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -237,7 +237,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -349,7 +349,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -358,7 +358,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -371,7 +371,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -380,7 +380,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -464,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -503,11 +503,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -542,7 +542,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -794,14 +794,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -861,7 +861,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -902,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -930,7 +930,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -959,18 +959,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1080,7 +1080,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1092,31 +1092,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1127,14 +1127,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1150,7 +1150,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1324,7 +1324,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1430,11 +1430,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1445,7 +1445,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1630,7 +1630,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 351ef416..914ff060 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9801d5f9..84e4aba7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ca58fbe8..906f09cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0652d6b4..98719812 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9836b502..87c9aa45 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ad6ecbeb..24999430 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index f836f9f9..9c2bad27 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 01c67abc..ff526cbc 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 699c0323..f36b27cf 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index ffe27b0f..65dd2639 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 57e3252c..dc5320bb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index abc550ac..d15a472c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4e7d428f..566e2b5c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index b5b2af96..161e273a 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 037caf04..b9fb5373 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 0b63640a..745ff709 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index eed3c4f0..fb7df026 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 90696149..61b33bc5 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 01806847..bd7a7d85 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fad0f676..2c01265d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 08d1739f..459e292f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index fdaec6b0..3de5b022 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f35765c6..50d17d87 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 4d5c5b4e..a4e30a5e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9f39f448..52abc5b8 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 1707868f..6bee52c7 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e6e966a6..a3322969 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -317,7 +317,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -437,10 +437,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -504,7 +504,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -515,7 +515,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -567,21 +567,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -644,9 +644,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -681,7 +681,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -699,7 +699,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -716,7 +716,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -786,7 +786,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -802,14 +802,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -818,7 +818,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -856,7 +856,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -864,17 +864,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -883,11 +883,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -895,11 +895,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -907,26 +907,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -949,7 +949,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -957,23 +957,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -981,14 +981,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1027,7 +1027,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1035,21 +1035,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1057,7 +1057,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1077,28 +1077,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1131,7 +1131,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1140,8 +1140,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1190,25 +1190,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1247,49 +1247,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1336,7 +1336,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1345,18 +1345,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1462,7 +1462,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1471,7 +1471,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1576,40 +1576,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1626,28 +1626,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1719,7 +1719,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1757,7 +1757,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1777,17 +1777,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1808,17 +1808,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,14 +1842,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1858,14 +1858,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1900,18 +1900,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1928,7 +1928,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1969,14 +1969,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,7 +2060,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT16)x->conval->intval; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2167,7 +2167,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2193,7 +2193,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2384,7 +2384,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2408,7 +2408,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2425,7 +2425,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2457,17 +2457,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2575,7 +2575,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 385a9146..97c4485c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 45784a13..9f818a4a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -227,12 +227,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -277,16 +277,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -331,19 +331,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -357,7 +357,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -372,7 +372,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -393,7 +393,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -435,7 +435,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -540,7 +540,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -612,7 +612,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -635,7 +635,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -673,7 +673,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -692,13 +692,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -889,7 +889,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1017,7 +1017,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1026,7 +1026,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1043,7 +1043,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1380,7 +1380,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1399,7 +1399,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1562,7 +1562,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1976,16 +1976,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2008,10 +2008,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4243328e..38f95afe 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 979d9598..f2da0fed 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index f93bcd98..15a980a6 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b0e235d3..21c21350 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -253,7 +253,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -265,10 +265,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -301,7 +301,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -409,7 +409,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -459,7 +459,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -488,7 +488,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -503,7 +503,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -521,7 +521,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -543,7 +543,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -572,7 +572,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -871,10 +871,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -888,7 +888,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -896,7 +896,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1173,14 +1173,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if ((SYSTEM_INT16)LabelTyp->form != f) { @@ -1190,7 +1190,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1526,7 +1526,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 0ddbe4c3..8bed9493 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 89c8242e..f197a5c6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 46e05201..1e99f5e9 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7398b44a..5b495ad5 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -284,7 +284,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -483,14 +483,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -519,7 +519,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -531,8 +531,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -595,7 +595,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -603,7 +603,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -649,23 +649,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -850,22 +850,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = (SYSTEM_INT16)ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -877,7 +877,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1054,20 +1054,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1078,7 +1078,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1112,7 +1112,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1191,7 +1191,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1288,7 +1288,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1355,7 +1355,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1367,7 +1367,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1474,15 +1474,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1537,24 +1537,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1668,7 +1668,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1844,16 +1844,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1871,12 +1871,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,14 +1904,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3e352ca3..307b94e2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7538f014..df62e985 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -122,14 +122,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -162,7 +162,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -236,7 +236,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -348,7 +348,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -357,7 +357,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -370,7 +370,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -379,7 +379,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -463,7 +463,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -502,11 +502,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -541,7 +541,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -793,14 +793,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -860,7 +860,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -901,7 +901,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -929,7 +929,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -958,18 +958,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1079,7 +1079,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1091,31 +1091,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1126,14 +1126,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1149,7 +1149,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1323,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1429,11 +1429,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1444,7 +1444,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1629,7 +1629,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0299d34b..06bc39f1 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 60cb401c..c1158d0f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d0a62b87..7deb4830 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index bea1f4aa..28a855aa 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6eeb5a87..65543fac 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f1d4f53d..834c1fb1 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 43656e74..2edcc736 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index bd5d1115..dddea925 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index be79016b..5499c3d0 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 7c16c24d..030b94f6 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 7a91fc31..3f916fe9 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4a787a17..2afac320 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index cfb79ac9..bfab2dc6 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb0797f3..ca635519 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index dfe62efa..84707926 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 73d985c9..6266a678 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5a7e6896..f4abd052 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b38a0aa6..c756e930 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index af2ecbd7..7269d448 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 22d598fb..8d9e2fb5 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 4d32ed53..5ec9a8a2 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index fa7db0e9..c2853bea 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a5063871..5822f690 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index eebee23c..5e7c01fb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5929cd57..004f1f8b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 03458258..6f5e4cad 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fef28dff..eacff2d0 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -318,7 +318,7 @@ void OPB_DeRef (OPT_Node *x) typ = (*x)->typ; if ((*x)->class >= 7) { OPB_err(78); - } else if (typ->form == 13) { + } else if (typ->form == 11) { if (typ == OPT_sysptrtyp) { OPB_err(57); } @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 5 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -438,10 +438,10 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) TypTest__57_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); - } else if ((*x)->typ->form == 13) { + } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); - } else if (obj->typ->form == 13) { + } else if (obj->typ->form == 11) { GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((f == 5 && y->typ->form == 9)) { + } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -505,7 +505,7 @@ static LONGINT OPB_log (LONGINT x) static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) { LONGREAL min, max, r; - if (f == 7) { + if (f == 5) { min = OPM_MinReal; max = OPM_MaxReal; } else { @@ -516,7 +516,7 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) if (r > max || r < min) { OPB_err(nr); x->realval = (LONGREAL)1; - } else if (f == 7) { + } else if (f == 5) { x->realval = x->realval; } x->intval = -1; @@ -568,21 +568,21 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01a0)) { + if (!__IN(f, 0x70)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03a0)) { + if (__IN(f, 0xf0)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01a0)) { + if (__IN(f, 0x70)) { if (z->class == 7) { - if (f == 5) { + if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (f == 5) { + if (f == 4) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -645,9 +645,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 24: if ((((z->class == 7 && f == 3)) && z->conval->intval >= 32)) { OPB_CharToString(z); - f = 10; + f = 8; } - if (z->class < 7 || f == 10) { + if (z->class < 7 || f == 8) { z = NewOp__29(op, typ, z); } else { OPB_err(127); @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((f == 5 && z->class == 7)) { + if ((f == 4 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -682,7 +682,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) INTEGER g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; - if (g == 13) { + if (g == 11) { p = x->typ->BaseTyp; q = y->typ->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -700,7 +700,7 @@ static void OPB_CheckPtr (OPT_Node x, OPT_Node y) } else { OPB_err(100); } - } else if (g != 11) { + } else if (g != 9) { OPB_err(100); } } @@ -717,7 +717,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) at = at->BaseTyp; } if (ft != at) { - if ((ft->form == 14 && at->form == 14)) { + if ((ft->form == 12 && at->form == 12)) { if (ft->BaseTyp == at->BaseTyp) { OPB_CheckParameters(ft->link, at->link, 0); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: + case 1: case 3: case 4: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -787,7 +787,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 7: case 8: + case 5: case 6: if ((*ConstOp__13_s->xval)->realval < (*ConstOp__13_s->yval)->realval) { res = 11; } else if ((*ConstOp__13_s->xval)->realval > (*ConstOp__13_s->yval)->realval) { @@ -803,14 +803,14 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 9: + case 7: if ((*ConstOp__13_s->xval)->setval != (*ConstOp__13_s->yval)->setval) { res = 10; } else { res = 9; } break; - case 10: + case 8: if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) < 0) { res = 11; } else if (__STRCMP(*(*ConstOp__13_s->xval)->ext, *(*ConstOp__13_s->yval)->ext) > 0) { @@ -819,7 +819,7 @@ static INTEGER ConstCmp__14 (void) res = 9; } break; - case 11: case 13: case 14: + case 9: case 11: case 12: if ((*ConstOp__13_s->xval)->intval != (*ConstOp__13_s->yval)->intval) { res = 10; } else { @@ -857,7 +857,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) if (f != g) { switch (f) { case 3: - if (g == 10) { + if (g == 8) { OPB_CharToString(x); } else { OPB_err(100); @@ -865,17 +865,17 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 5: - if (g == 5) { + case 4: + if (g == 4) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { x->typ = OPT_IntType(x->typ->size); } - } else if (g == 7) { + } else if (g == 5) { x->typ = OPT_realtyp; xval->realval = xval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; xval->realval = xval->intval; } else { @@ -884,11 +884,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 7: - if (g == 5) { + case 5: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 8) { + } else if (g == 6) { x->typ = OPT_lrltyp; } else { OPB_err(100); @@ -896,11 +896,11 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 8: - if (g == 5) { + case 6: + if (g == 4) { y->typ = x->typ; yval->realval = yval->intval; - } else if (g == 7) { + } else if (g == 5) { y->typ = OPT_lrltyp; } else { OPB_err(100); @@ -908,26 +908,26 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 10: + case 8: if (g == 3) { OPB_CharToString(y); - g = 10; + g = 8; } else { OPB_err(100); y->typ = x->typ; __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 11: - if (!__IN(g, 0x6000)) { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; - case 13: + case 11: OPB_CheckPtr(x, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (f == 5) { + if (f == 4) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -950,7 +950,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -958,23 +958,23 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & yval->setval); } else if (f != 0) { OPB_err(101); } break; case 2: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; - OPB_CheckRealType(7, 205, xval); + OPB_CheckRealType(5, 205, xval); } else { OPB_err(205); xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -982,14 +982,14 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(205); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; } else if (f != 0) { OPB_err(102); } break; case 3: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (f == 5) { + if (f == 4) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1028,7 +1028,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1036,21 +1036,21 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = xval->setval | yval->setval; } else if (f != 0) { OPB_err(105); } break; case 7: - if (f == 5) { + if (f == 4) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { OPB_err(207); } - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1058,7 +1058,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (f == 9) { + } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); } else if (f != 0) { OPB_err(106); @@ -1078,28 +1078,28 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x2a04)) { + if (__IN(f, 0x0a84)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 5) { - if (g == 5) { + if (f == 4) { + if (g == 4) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1132,7 +1132,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x0180)) { + } else if (__IN(g, 0x60)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1141,8 +1141,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x0180)) { - if (__IN(g, 0x0180)) { + } else if (__IN(f, 0x60)) { + if (__IN(g, 0x60)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1191,25 +1191,25 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 10; + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__38_s->g = 10; + *Op__38_s->g = 8; yCharArr = 1; } if ((((yCharArr && *Op__38_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__38_s->f = 10; + *Op__38_s->f = 8; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__38_s->f == 8 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(0)); - } else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__38_s->g == 8 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); @@ -1248,49 +1248,49 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 4: + if ((g == 4 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x70)) { + OPB_Convert(&z, y->typ); + } else { + OPB_err(100); + } + break; case 5: - if ((g == 5 && y->typ->size < z->typ->size)) { + if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01a0)) { + } else if (__IN(g, 0x60)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 7: - if (g == 5) { + case 6: + if (__IN(g, 0x70)) { + OPB_Convert(&y, z->typ); + } else if (__IN(g, 0x60)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; - case 8: - if (__IN(g, 0x01a0)) { - OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x0180)) { - OPB_Convert(&y, z->typ); - } else { + case 9: + if (!__IN(g, 0x1800)) { OPB_err(100); } break; case 11: - if (!__IN(g, 0x6000)) { - OPB_err(100); - } - break; - case 13: OPB_CheckPtr(z, y); break; - case 14: - if (g != 11) { + case 12: + if (g != 9) { OPB_err(100); } break; - case 10: + case 8: break; - case 15: + case 13: if (z->typ->comp == 4) { OPB_err(100); } @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (f == 5) { + if (f == 4) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1337,7 +1337,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0x0381)) { + } else if (!__IN(f, 0xe1)) { OPB_err(105); typ = OPT_undftyp; } @@ -1346,18 +1346,18 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (f == 5) { + if (f == 4) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } - } else if ((f != 9 && f != 0)) { + } else if ((f != 7 && f != 0)) { OPB_err(102); typ = OPT_undftyp; } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (f == 5) { + if (f == 4) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (f == 5) { + if (f == 4) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (f == 5) { + if (f == 4) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03e1)) { + if (!__IN(f, 0xf1)) { OPB_err(106); typ = OPT_undftyp; } - if ((f != 5 || y->class != 7) || y->conval->intval != 0) { + if ((f != 4 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1463,7 +1463,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1472,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__41(&z, &y)) { + if (__IN(f, 0x79) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { + } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if ((*x)->typ->form != 5) { + } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1577,40 +1577,40 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWNum(ynode->typ->size, 0); OPM_LogWLn(); } - if (ynode->class == 8 || (ynode->class == 9 && f != 14)) { + if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } switch (f) { - case 0: case 10: + case 0: case 8: break; case 1: - if (!((__IN(g, 0x2a) && y->size == 1))) { + if (!((__IN(g, 0x1a) && y->size == 1))) { OPB_err(113); } break; - case 2: case 3: case 9: + case 2: case 3: case 7: if (g != f) { OPB_err(113); } break; + case 4: + if (g != 4 || x->size < y->size) { + OPB_err(113); + } + break; case 5: - if (g != 5 || x->size < y->size) { + if (!__IN(g, 0x30)) { OPB_err(113); } break; - case 7: - if (!__IN(g, 0xe0)) { + case 6: + if (!__IN(g, 0x70)) { OPB_err(113); } break; - case 8: - if (!__IN(g, 0x01e0)) { - OPB_err(113); - } - break; - case 13: - if ((x == y || g == 11) || (x == OPT_sysptrtyp && g == 13)) { - } else if (g == 13) { + case 11: + if ((x == y || g == 9) || (x == OPT_sysptrtyp && g == 11)) { + } else if (g == 11) { p = x->BaseTyp; q = y->BaseTyp; if ((p->comp == 4 && q->comp == 4)) { @@ -1627,28 +1627,28 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 14: + case 12: if (ynode->class == 9) { OPB_CheckProc(x, ynode->obj); - } else if (x == y || g == 11) { + } else if (x == y || g == 9) { } else { OPB_err(113); } break; - case 12: case 11: + case 10: case 9: OPB_err(113); break; - case 15: + case 13: x->pvused = 1; if (x->comp == 2) { if ((ynode->class == 7 && g == 3)) { OPB_CharToString(ynode); y = ynode->typ; - g = 10; + g = 8; } if (x == y) { } else if (x->BaseTyp == OPT_chartyp) { - if (g == 10) { + if (g == 8) { if (ynode->conval->intval2 > x->n) { OPB_err(114); } @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1720,7 +1720,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) typ = OPT_notyp; if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { if (x->readonly) { OPB_err(76); } @@ -1758,7 +1758,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x0180)) { + } else if (__IN(f, 0x60)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1778,17 +1778,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(0); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MinReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MinLReal, OPT_lrltyp); break; default: @@ -1809,17 +1809,17 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 5: + case 4: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; - case 9: + case 7: x = OPB_NewIntConst(OPM_MaxSet); x->typ = OPT_inttyp; break; - case 7: + case 5: x = OPB_NewRealConst(OPM_MaxReal, OPT_realtyp); break; - case 8: + case 6: x = OPB_NewRealConst(OPM_MaxLReal, OPT_lrltyp); break; default: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x21)) { + } else if (__IN(f, 0x11)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,14 +1843,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 8) { + } else if (f == 6) { OPB_Convert(&x, OPT_realtyp); } else { OPB_err(111); @@ -1859,14 +1859,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); } else { OPB_Convert(&x, typ); } - } else if (f == 7) { + } else if (f == 5) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { OPB_Convert(&x, OPT_linttyp); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1901,18 +1901,18 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 18: if ((x->class == 7 && f == 3)) { OPB_CharToString(x); - f = 10; + f = 8; } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 10)) { + } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1929,7 +1929,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x022a)) { + } else if (!__IN(f, 0x9a)) { OPB_err(111); } break; case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -1970,14 +1970,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x1401) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501) || x->typ->comp == 3) { OPB_err(111); } break; case 30: if (OPB_NotVar(x)) { OPB_err(112); - } else if (f == 13) { + } else if (f == 11) { } else { OPB_err(111); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 5)) { + if ((x->class == 7 && f == 4)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!(f == 5) || x->class != 7) { + if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (f == 5) { + if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f != 5) { + } else if (f != 4) { OPB_err(111); } else { if (fctno == 22) { @@ -2168,7 +2168,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x63ff)) { + } else if (__IN(f, 0x18ff)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2194,7 +2194,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x1401)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } if (x->typ->size < p->typ->size) { @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((f == 5 && x->class == 7)) { + if ((f == 4 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (f == 5) { + } else if (f == 4) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { + } else if (f == 4) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2385,7 +2385,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { - if ((((!fvarpar && ftyp->form == 13)) && atyp->form == 13)) { + if ((((!fvarpar && ftyp->form == 11)) && atyp->form == 11)) { ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((ftyp->comp == 4 && atyp->comp == 4)) { @@ -2409,7 +2409,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) { - if (fp->typ->form == 13) { + if (fp->typ->form == 11) { if ((*x)->class == 3) { *x = (*x)->left; } else { @@ -2426,7 +2426,7 @@ void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) OPB_CheckReceiver(&(*x)->left, *fpar); *fpar = (*fpar)->link; } - } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 14)) { + } else if (((((*x)->class != 8 && (*x)->typ != NIL)) && (*x)->typ->form == 12)) { *fpar = (*x)->typ->link; } else { OPB_err(121); @@ -2458,17 +2458,17 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) if (q == NIL) { OPB_err(111); } - } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && ap->typ->size == 1)))))) { + } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { OPB_err(123); - } else if ((fp->typ->form == 13 && ap->class == 5)) { + } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } } else if (fp->typ->comp == 3) { if ((ap->class == 7 && ap->typ->form == 3)) { OPB_CharToString(ap); } - if ((ap->typ->form == 10 && fp->typ->BaseTyp->form == 3)) { + if ((ap->typ->form == 8 && fp->typ->BaseTyp->form == 3)) { } else if (ap->class >= 7) { OPB_err(59); } else { @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) OPB_BindNodes(6, (*x)->typ, &z, NIL); *x = z; } - } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) { + } else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 8)) && y->conval->intval2 == 1)) { y->typ = OPT_chartyp; y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0b71f987..7b980a10 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b8a0608e..ad70616c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -228,12 +228,12 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) if (__IN(typ->comp, 0x0c)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; - } else if (typ->form == 14) { + } else if (typ->form == 12) { OPM_Write('('); OPM_Write('*'); } else { pointers = 0; - while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 13)) { + while (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->form == 11)) { pointers += 1; typ = typ->BaseTyp; } @@ -278,16 +278,16 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) for (;;) { form = typ->form; comp = typ->comp; - if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 12) || comp == 4) { + if (((typ->strobj != NIL && typ->strobj->name[0] != 0x00) || form == 10) || comp == 4) { break; - } else if ((form == 13 && typ->BaseTyp->comp != 3)) { + } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 14 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c)) { if (openClause) { OPM_Write(')'); openClause = 0; } - if (form == 14) { + if (form == 12) { if (OPC_ansi) { OPM_Write(')'); OPC_AnsiParamList(typ->link, 0); @@ -332,19 +332,19 @@ static void OPC_DeclareBase (OPT_Object dcl) LONGINT off, n, dummy; typ = dcl->typ; prev = typ; - while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 12)) && !((typ->form == 13 && typ->BaseTyp->comp == 3)))) { + while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { prev = typ; typ = typ->BaseTyp; } obj = typ->strobj; - if (typ->form == 12) { + if (typ->form == 10) { OPM_WriteString((CHAR*)"void", 5); } else if ((obj != NIL && !OPC_Undefined(obj))) { OPC_Ident(obj); } else if (typ->comp == 4) { OPM_WriteString((CHAR*)"struct ", 8); OPC_Andent(typ); - if ((prev->form != 13 && (obj != NIL || dcl->name[0] == 0x00))) { + if ((prev->form != 11 && (obj != NIL || dcl->name[0] == 0x00))) { if ((typ->BaseTyp != NIL && typ->BaseTyp->strobj->vis != 0)) { OPM_WriteString((CHAR*)" { /* ", 7); OPC_Ident(typ->BaseTyp->strobj); @@ -358,7 +358,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_FieldList(typ, 1, &off, &n, &dummy); OPC_EndBlk0(); } - } else if ((typ->form == 13 && typ->BaseTyp->comp == 3)) { + } else if ((typ->form == 11 && typ->BaseTyp->comp == 3)) { typ = typ->BaseTyp->BaseTyp; nofdims = 1; while (typ->comp == 3) { @@ -373,7 +373,7 @@ static void OPC_DeclareBase (OPT_Object dcl) OPC_BegStat(); __NEW(obj, OPT_ObjDesc); __NEW(obj->typ, OPT_StrDesc); - obj->typ->form = 15; + obj->typ->form = 13; obj->typ->comp = 2; obj->typ->n = 1; obj->typ->BaseTyp = typ; @@ -394,7 +394,7 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -436,7 +436,7 @@ static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) OPT_Object fld = NIL; OPT_Struct btyp = NIL; LONGINT n, i; - if ((typ->form == 13 && typ->sysflag == 0)) { + if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); *cnt += 1; @@ -541,7 +541,7 @@ static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro) if (macro) { OPM_WriteStringVar((void*)par->name, 256); } else { - if ((par->mode == 1 && par->typ->form == 7)) { + if ((par->mode == 1 && par->typ->form == 5)) { OPM_Write('_'); } OPC_Ident(par); @@ -613,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) OPT_Struct typ = NIL, base = NIL; LONGINT mno; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } base = typ->BaseTyp; @@ -636,7 +636,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj); OPC_DeclareParams(obj->link, 1); OPM_WriteString((CHAR*)" __SEND(", 9); - if (obj->link->typ->form == 13) { + if (obj->link->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPC_Ident(obj->link); OPM_Write(')'); @@ -674,7 +674,7 @@ static void OPC_DefineType (OPT_Struct str) if (obj == NIL || OPC_Undefined(obj)) { if (obj != NIL) { if (obj->linkadr == 1) { - if (str->form != 13) { + if (str->form != 11) { OPM_Mark(244, str->txtpos); obj->linkadr = 2; } @@ -693,13 +693,13 @@ static void OPC_DefineType (OPT_Struct str) } field = field->link; } - } else if (str->form == 13) { + } else if (str->form == 11) { if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } } else if (__IN(str->comp, 0x0c)) { OPC_DefineType(str->BaseTyp); - } else if (str->form == 14) { + } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { OPC_DefineType(str->BaseTyp); } @@ -890,7 +890,7 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) { LONGINT _o_result; LONGINT alignment; - if (typ->form == 15) { + if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); } else { @@ -1018,7 +1018,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_WriteString((CHAR*)"export ", 8); } } - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_WriteString((CHAR*)"double", 7); } else { OPC_DeclareBase(obj); @@ -1027,7 +1027,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPM_Write(','); } OPM_Write(' '); - if ((((vis == 2 && obj->mode == 1)) && base->form == 7)) { + if ((((vis == 2 && obj->mode == 1)) && base->form == 5)) { OPM_Write('_'); } OPC_DeclareObj(obj, vis == 3); @@ -1044,7 +1044,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 13)) { + } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1381,7 +1381,7 @@ void OPC_GenEnumPtrs (OPT_Object var) OPC_BegBlk(); } OPC_BegStat(); - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"P(", 3); OPC_Ident(var); OPM_Write(')'); @@ -1400,7 +1400,7 @@ void OPC_GenEnumPtrs (OPT_Object var) n = n * typ->n; typ = typ->BaseTyp; } - if (typ->form == 13) { + if (typ->form == 11) { OPM_WriteString((CHAR*)"__ENUMP(", 9); OPC_Ident(var); OPC_Str1((CHAR*)", #, P)", 8, n); @@ -1563,7 +1563,7 @@ void OPC_EnterProc (OPT_Object proc) if (!OPC_ansi) { var = proc->link; while (var != NIL) { - if ((var->typ->form == 7 && var->mode == 1)) { + if ((var->typ->form == 5 && var->mode == 1)) { OPC_BegStat(); OPC_Ident(var->typ->strobj); OPM_Write(' '); @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 5: + case 4: OPM_WriteInt(caseVal); break; default: @@ -1977,16 +1977,16 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 5: + case 4: OPM_WriteInt(con->intval); break; - case 7: + case 5: OPM_WriteReal(con->realval, 'f'); break; - case 8: + case 6: OPM_WriteReal(con->realval, 0x00); break; - case 9: + case 7: OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; @@ -2009,10 +2009,10 @@ void OPC_Constant (OPT_Const con, INTEGER form) OPM_Write('0'); } break; - case 10: + case 8: OPC_StringLiteral(*con->ext, 256, con->intval2 - 1); break; - case 11: + case 9: OPM_WriteString((CHAR*)"NIL", 4); break; default: diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 21b48db8..bb250e9a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 450ed83d..228e7978 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 5363c227..6bbab25d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index becc2507..9337c539 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -159,7 +159,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; INTEGER sysflag; - *typ = OPT_NewStr(15, 4); + *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); if (OPP_sym == 30) { @@ -254,7 +254,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) INTEGER sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { - *typ = OPT_NewStr(15, 3); + *typ = OPT_NewStr(13, 3); (*typ)->mno = 0; (*typ)->sysflag = sysflag; OPS_Get(&OPP_sym); @@ -266,10 +266,10 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) (*typ)->n = 0; } } else { - *typ = OPT_NewStr(15, 2); + *typ = OPT_NewStr(13, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (x->typ->form == 5) { + if (x->typ->form == 4) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -302,7 +302,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_PointerType (OPT_Struct *typ) { OPT_Object id = NIL; - *typ = OPT_NewStr(13, 1); + *typ = OPT_NewStr(11, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); OPP_CheckSym(28); if (OPP_sym == 38) { @@ -410,7 +410,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) if (OPP_sym == 38) { OPP_qualident(&res); if (res->mode == 5) { - if (res->typ->form < 15) { + if (res->typ->form < 13) { *resTyp = res->typ; } else { OPP_err(54); @@ -460,7 +460,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) OPP_PointerType(&*typ); } else if (OPP_sym == 61) { OPS_Get(&OPP_sym); - *typ = OPT_NewStr(14, 1); + *typ = OPT_NewStr(12, 1); OPP_CheckSysFlag(&(*typ)->sysflag, 0); if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -489,7 +489,7 @@ static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned) static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned) { OPP_TypeDecl(&*typ, &*banned); - if (((((*typ)->form == 13 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { + if (((((*typ)->form == 11 && (*typ)->BaseTyp == OPT_undftyp)) && (*typ)->strobj == NIL)) { OPP_err(0); } } @@ -504,7 +504,7 @@ static void OPP_selector (OPT_Node *x) if (OPP_sym == 31) { OPS_Get(&OPP_sym); for (;;) { - if (((*x)->typ != NIL && (*x)->typ->form == 13)) { + if (((*x)->typ != NIL && (*x)->typ->form == 11)) { OPB_DeRef(&*x); } OPP_Expression(&y); @@ -522,7 +522,7 @@ static void OPP_selector (OPT_Node *x) __COPY(OPS_name, name, 256); OPS_Get(&OPP_sym); if ((*x)->typ != NIL) { - if ((*x)->typ->form == 13) { + if ((*x)->typ->form == 11) { OPB_DeRef(&*x); } if ((*x)->typ->comp == 4) { @@ -544,7 +544,7 @@ static void OPP_selector (OPT_Node *x) OPP_err(75); } typ = y->obj->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField((*x)->obj->name, typ->BaseTyp, &proc); @@ -573,7 +573,7 @@ static void OPP_selector (OPT_Node *x) } else if (OPP_sym == 17) { OPS_Get(&OPP_sym); OPB_DeRef(&*x); - } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 14)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { + } else if ((((((OPP_sym == 30 && (*x)->class < 7)) && (*x)->typ->form != 12)) && ((*x)->obj == NIL || (*x)->obj->mode != 13))) { OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&obj); @@ -872,10 +872,10 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } else { *typ = obj->typ; *rec = *typ; - if ((*rec)->form == 13) { + if ((*rec)->form == 11) { *rec = (*rec)->BaseTyp; } - if (!((((*mode == 1 && (*typ)->form == 13)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { + if (!((((*mode == 1 && (*typ)->form == 11)) && (*rec)->comp == 4) || (*mode == 2 && (*typ)->comp == 4))) { OPP_err(70); *rec = NIL; } @@ -889,7 +889,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St } OPP_CheckSym(22); if (*rec == NIL) { - *rec = OPT_NewStr(15, 4); + *rec = OPT_NewStr(13, 4); (*rec)->BaseTyp = NIL; } } @@ -897,7 +897,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { BOOLEAN _o_result; - if ((b->form == 13 && x->form == 13)) { + if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; } @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x28)) { + if (__IN(f, 0x18)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (f == 5) { - if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { + if (f == 4) { + if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { + if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x38)) { + } else if (!__IN((*x)->typ->form, 0x18)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!(id->typ->form == 5)) { + if (!(id->typ->form == 4)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 4) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); @@ -1527,7 +1527,7 @@ static void OPP_StatSeq (OPT_Node *stat) if (OPP_sym == 38) { OPP_qualident(&id); y = OPB_NewLeaf(id); - if ((((id != NIL && id->typ->form == 13)) && (id->mode == 2 || !id->leaf))) { + if ((((id != NIL && id->typ->form == 11)) && (id->mode == 2 || !id->leaf))) { OPP_err(245); } OPP_CheckSym(20); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7a12f897..863db6d6 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2ee978f2..e575dfe6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a8dccfed..a60ffe74 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index f8762935..35088301 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(x->form == 5, 0); + __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -285,7 +285,7 @@ void OPT_Close (void) OPT_GlbMod[__X(i, 64)] = NIL; i += 1; } - i = 16; + i = 14; while (i < 255) { OPT_impCtxt.ref[__X(i, 255)] = NIL; OPT_impCtxt.old[__X(i, 255)] = NIL; @@ -484,14 +484,14 @@ void OPT_IdFPrint (OPT_Struct typ) OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256); OPT_FPrintName(&idfp, (void*)strobj->name, 256); } - if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) { + if ((f == 11 || (c == 4 && btyp != NIL)) || c == 3) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); } else if (c == 2) { OPT_IdFPrint(btyp); OPM_FPrint(&idfp, btyp->idfp); OPM_FPrint(&idfp, typ->n); - } else if (f == 14) { + } else if (f == 12) { OPT_FPrintSign(&idfp, btyp, typ->link); } typ->idfp = idfp; @@ -520,7 +520,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; FPrintHdFld__15(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -532,8 +532,8 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 13); + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { + OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); OPT_nofhdfld += 1; } @@ -596,7 +596,7 @@ void OPT_FPrintStr (OPT_Struct typ) f = typ->form; c = typ->comp; btyp = typ->BaseTyp; - if (f == 13) { + if (f == 11) { strobj = typ->strobj; bstrobj = btyp->strobj; if (((strobj == NIL || strobj->name[0] == 0x00) || bstrobj == NIL) || bstrobj->name[0] == 0x00) { @@ -604,7 +604,7 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pbfp, btyp->pbfp); pvfp = pbfp; } - } else if (f == 14) { + } else if (f == 12) { } else if (__IN(c, 0x0c)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); @@ -650,23 +650,23 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 5: + case 2: case 3: case 4: OPM_FPrint(&fprint, obj->conval->intval); break; - case 9: + case 7: OPM_FPrintSet(&fprint, obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_FPrintReal(&fprint, rval); break; - case 8: + case 6: OPM_FPrintLReal(&fprint, obj->conval->realval); break; - case 10: + case 8: OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -851,22 +851,22 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 5: + case 4: conval->intval = OPM_SymRInt(); break; - case 9: + case 7: OPM_SymRSet(&conval->setval); break; - case 7: + case 5: OPM_SymRReal(&rval); conval->realval = rval; conval->intval = -1; break; - case 8: + case 6: OPM_SymRLReal(&conval->realval); conval->intval = -1; break; - case 10: + case 8: ext = OPT_NewExt(); conval->ext = ext; i = 0; @@ -878,7 +878,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) conval->intval2 = i; conval->intval = -1; break; - case 11: + case 9: conval->intval = 0; break; default: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (tag == 5) { + if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1055,20 +1055,20 @@ static void OPT_InStruct (OPT_Struct *typ) } switch (tag) { case 36: - (*typ)->form = 13; + (*typ)->form = 11; (*typ)->size = OPM_PointerSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; case 37: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); (*OPT_typSize)(*typ); break; case 38: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 3; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp->comp == 3) { @@ -1079,7 +1079,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*OPT_typSize)(*typ); break; case 39: - (*typ)->form = 15; + (*typ)->form = 13; (*typ)->comp = 4; OPT_InStruct(&(*typ)->BaseTyp); if ((*typ)->BaseTyp == OPT_notyp) { @@ -1113,7 +1113,7 @@ static void OPT_InStruct (OPT_Struct *typ) } break; case 40: - (*typ)->form = 14; + (*typ)->form = 12; (*typ)->size = OPM_ProcSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; @@ -1192,7 +1192,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj = OPT_NewObj(); obj->mnolev = -mno; obj->vis = 1; - if (tag <= 13) { + if (tag <= 11) { obj->mode = 3; obj->conval = OPT_NewConst(); OPT_InConstant(tag, obj->conval); @@ -1289,7 +1289,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) obj->scope = OPT_syslink; obj->typ = OPT_notyp; } else { - OPT_impCtxt.nofr = 16; + OPT_impCtxt.nofr = 14; OPT_impCtxt.minr = 255; OPT_impCtxt.nofm = 0; OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0; @@ -1356,7 +1356,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) n = btyp->n * n; btyp = btyp->BaseTyp; } - if (btyp->form == 13 || btyp->comp == 4) { + if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; OPT_OutHdFld(btyp, fld, adr); if (j != OPT_nofhdfld) { @@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } } - } else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) { + } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { OPM_SymWInt(27); OPM_SymWInt(adr); OPT_nofhdfld += 1; @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 5) { + if (typ->ref == 4) { OPM_SymWInt(typ->size); } } else { @@ -1475,15 +1475,15 @@ static void OPT_OutStr (OPT_Struct typ) OPM_SymWInt(typ->sysflag); } switch (typ->form) { - case 13: + case 11: OPM_SymWInt(36); OPT_OutStr(typ->BaseTyp); break; - case 14: + case 12: OPM_SymWInt(40); OPT_OutSign(typ->BaseTyp, typ->link); break; - case 15: + case 13: switch (typ->comp) { case 2: OPM_SymWInt(37); @@ -1538,24 +1538,24 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 5: + case 4: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; - case 9: + case 7: OPM_SymWSet(obj->conval->setval); break; - case 7: + case 5: rval = obj->conval->realval; OPM_SymWReal(rval); break; - case 8: + case 6: OPM_SymWLReal(obj->conval->realval); break; - case 10: + case 8: OPT_OutName((void*)*obj->conval->ext, 256); break; - case 11: + case 9: break; default: OPT_err(127); @@ -1669,7 +1669,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) OPM_SymWInt(16); OPT_OutName((void*)OPT_SelfName, 256); OPT_expCtxt.reffp = 0; - OPT_expCtxt.ref = 16; + OPT_expCtxt.ref = 14; OPT_expCtxt.nofm = 1; OPT_expCtxt.locmno[0] = 0; i = 1; @@ -1845,16 +1845,16 @@ export void *OPT__init(void) OPM_errpos = 0; OPT_InitStruct(&OPT_undftyp, 0); OPT_undftyp->BaseTyp = OPT_undftyp; - OPT_InitStruct(&OPT_notyp, 12); - OPT_InitStruct(&OPT_stringtyp, 10); - OPT_InitStruct(&OPT_niltyp, 11); + OPT_InitStruct(&OPT_notyp, 10); + OPT_InitStruct(&OPT_stringtyp, 8); + OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 13, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADRINT", 5, OPM_PointerSize, &OPT_ainttyp); - OPT_EnterTyp((CHAR*)"INT8", 5, 1, &OPT_int8typ); - OPT_EnterTyp((CHAR*)"INT16", 5, 2, &OPT_int16typ); - OPT_EnterTyp((CHAR*)"INT32", 5, 4, &OPT_int32typ); - OPT_EnterTyp((CHAR*)"INT64", 5, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); + OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); + OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); + OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); + OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -1872,12 +1872,12 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); + OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,14 +1905,14 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[7] = OPT_realtyp; - OPT_impCtxt.ref[8] = OPT_lrltyp; - OPT_impCtxt.ref[9] = OPT_settyp; - OPT_impCtxt.ref[10] = OPT_stringtyp; - OPT_impCtxt.ref[11] = OPT_niltyp; - OPT_impCtxt.ref[12] = OPT_notyp; - OPT_impCtxt.ref[13] = OPT_sysptrtyp; + OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[5] = OPT_realtyp; + OPT_impCtxt.ref[6] = OPT_lrltyp; + OPT_impCtxt.ref[7] = OPT_settyp; + OPT_impCtxt.ref[8] = OPT_stringtyp; + OPT_impCtxt.ref[9] = OPT_niltyp; + OPT_impCtxt.ref[10] = OPT_notyp; + OPT_impCtxt.ref[11] = OPT_sysptrtyp; OPT_IntTypes[1] = OPT_sinttyp; OPT_IntTypes[2] = OPT_inttyp; OPT_IntTypes[3] = OPT_linttyp; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index acf2e9e9..c3fdc0cf 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b5cebda5..c769935e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -123,14 +123,14 @@ void OPV_TypSize (OPT_Struct typ) } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 13) { + } else if (f == 11) { typ->size = OPM_PointerSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } - } else if (f == 14) { + } else if (f == 12) { typ->size = OPM_ProcSize; } else if (c == 3) { btyp = typ->BaseTyp; @@ -163,7 +163,7 @@ static void OPV_GetTProcNum (OPT_Object obj) oldPos = OPM_errpos; OPM_errpos = obj->scope->adr; typ = obj->link->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(obj->name, typ->BaseTyp, &redef); @@ -237,7 +237,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; OPV_TypSize(obj->typ); - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } if (typ->comp == 4) { @@ -349,7 +349,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN case 12: switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -358,7 +358,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 2: - if (form == 9) { + if (form == 7) { _o_result = 3; return _o_result; } else { @@ -371,7 +371,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN return _o_result; break; case 6: - if (form == 9) { + if (form == 7) { _o_result = 2; return _o_result; } else { @@ -380,7 +380,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN } break; case 7: - if (form == 9) { + if (form == 7) { _o_result = 4; return _o_result; } else { @@ -464,7 +464,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, INTEGER prec) { - if (__IN(n->typ->form, 0x0180)) { + if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -503,11 +503,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) INTEGER from, to; from = n->typ->form; to = newtype->form; - if (to == 9) { + if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (to == 5) { + } else if (to == 4) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -542,7 +542,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) static void OPV_TypeOf (OPT_Node n) { - if (n->typ->form == 13) { + if (n->typ->form == 11) { OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -794,14 +794,14 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (OPV_ansi) { if ((__IN(comp, 0x0c) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); - } else if ((((form == 13 && typ != n->typ)) && n->typ != OPT_niltyp)) { + } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && n->typ->form == 5)) { + if ((__IN(form, 0x60) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (form == 5) { + } else if (form == 4) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((form == 5 && n->class == 7)) { + } else if ((form == 4 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -861,7 +861,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; - if (typ->form == 13) { + if (typ->form == 11) { typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); @@ -902,7 +902,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); break; case 7: - if (form == 9) { + if (form == 7) { OPM_Write('~'); } else { OPM_Write('-'); @@ -930,7 +930,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 21: if (OPV_SideEffects(l)) { - if (l->typ->form < 7) { + if (l->typ->form < 5) { if (l->typ->size <= 4) { OPM_WriteString((CHAR*)"(int)", 6); } @@ -959,18 +959,18 @@ static void OPV_expr (OPT_Node n, INTEGER prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 10 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { + if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); } OPV_expr(l, exprPrec); @@ -1080,7 +1080,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x8400)) { + if (__IN(l->typ->form, 0x2100)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1092,31 +1092,31 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPV_expr(l, exprPrec); OPC_Cmp(subclass); typ = l->typ; - if ((((((typ->form == 13 && r->typ->form != 11)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { + if ((((((typ->form == 11 && r->typ->form != 9)) && r->typ != typ)) && r->typ != OPT_sysptrtyp)) { OPM_WriteString((CHAR*)"(void *) ", 10); } OPV_expr(r, exprPrec); } break; default: - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write('('); } OPV_expr(l, exprPrec); switch (subclass) { case 1: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ", 4); } else { OPM_WriteString((CHAR*)" * ", 4); } break; case 2: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || r->obj->typ->form == 5) { + if (r->obj == NIL || r->obj->typ->form == 4) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1127,14 +1127,14 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" && ", 5); break; case 6: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" | ", 4); } else { OPM_WriteString((CHAR*)" + ", 4); } break; case 7: - if (form == 9) { + if (form == 7) { OPM_WriteString((CHAR*)" & ~", 5); } else { OPM_WriteString((CHAR*)" - ", 4); @@ -1150,7 +1150,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) break; } OPV_expr(r, exprPrec); - if (subclass == 5 || (form == 9 && (subclass == 1 || subclass == 7))) { + if (subclass == 5 || (form == 7 && (subclass == 1 || subclass == 7))) { OPM_Write(')'); } break; @@ -1324,7 +1324,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if ((base->comp == 4 && OPC_NofPtrs(base) != 0)) { OPC_Ident(base->strobj); OPM_WriteString((CHAR*)"__typ", 6); - } else if (base->form == 13) { + } else if (base->form == 11) { OPM_WriteString((CHAR*)"POINTER__typ", 13); } else { OPM_WriteString((CHAR*)"NIL", 4); @@ -1430,11 +1430,11 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } OPM_Write(')'); } else { - if ((((((l->typ->form == 13 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { + if ((((((l->typ->form == 11 && l->obj != NIL)) && l->obj->adr == 1)) && l->obj->mode == 1)) { l->obj->adr = 0; OPV_design(l, -1); l->obj->adr = 1; - if (r->typ->form != 11) { + if (r->typ->form != 9) { OPM_WriteString((CHAR*)" = (void*)", 11); } else { OPM_WriteString((CHAR*)" = ", 4); @@ -1445,7 +1445,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } if (l->typ == r->typ) { OPV_expr(r, -1); - } else if ((((l->typ->form == 13 && r->typ->form != 11)) && l->typ->strobj != NIL)) { + } else if ((((l->typ->form == 11 && r->typ->form != 9)) && l->typ->strobj != NIL)) { OPM_Write('('); OPC_Ident(l->typ->strobj); OPM_Write(')'); @@ -1630,7 +1630,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { if (n->left != NIL) { OPM_WriteString((CHAR*)"_o_result = ", 13); - if ((n->left->typ->form == 13 && n->obj->typ != n->left->typ)) { + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 351ef416..914ff060 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index efbe5376..3f699c1c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 45566c5d..cff07fba 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0652d6b4..98719812 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9836b502..87c9aa45 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ad6ecbeb..24999430 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index f836f9f9..9c2bad27 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 01c67abc..ff526cbc 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 699c0323..f36b27cf 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index ffe27b0f..65dd2639 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 57e3252c..dc5320bb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index abc550ac..d15a472c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4e7d428f..566e2b5c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index b5b2af96..161e273a 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 037caf04..b9fb5373 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 0b63640a..745ff709 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 78981922..61780798 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -a +b From ee8342ef0d651353e077a2c28c44857a3327ba1b Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:14:06 +0100 Subject: [PATCH 011/140] Moving to config independent types stage 1 - generate intxx types. --- bootstrap/unix-44/Console.c | 26 +-- bootstrap/unix-44/Console.h | 4 +- bootstrap/unix-44/Files.c | 166 +++++++++---------- bootstrap/unix-44/Files.h | 34 ++-- bootstrap/unix-44/Heap.c | 200 +++++++++++----------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 12 +- bootstrap/unix-44/Modules.h | 8 +- bootstrap/unix-44/OPB.c | 154 ++++++++--------- bootstrap/unix-44/OPB.h | 20 +-- bootstrap/unix-44/OPC.c | 236 +++++++++++++------------- bootstrap/unix-44/OPC.h | 24 +-- bootstrap/unix-44/OPM.c | 168 +++++++++---------- bootstrap/unix-44/OPM.h | 34 ++-- bootstrap/unix-44/OPP.c | 92 +++++------ bootstrap/unix-44/OPS.c | 44 ++--- bootstrap/unix-44/OPS.h | 6 +- bootstrap/unix-44/OPT.c | 216 ++++++++++++------------ bootstrap/unix-44/OPT.h | 32 ++-- bootstrap/unix-44/OPV.c | 110 ++++++------- bootstrap/unix-44/Platform.c | 266 +++++++++++++++--------------- bootstrap/unix-44/Platform.h | 94 +++++------ bootstrap/unix-44/Reals.c | 64 ++++---- bootstrap/unix-44/Reals.h | 14 +- bootstrap/unix-44/SYSTEM.h | 104 ++++++++---- bootstrap/unix-44/Strings.c | 48 +++--- bootstrap/unix-44/Strings.h | 12 +- bootstrap/unix-44/Texts.c | 244 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 56 +++---- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/vt100.c | 88 +++++----- bootstrap/unix-44/vt100.h | 34 ++-- bootstrap/unix-48/Console.c | 26 +-- bootstrap/unix-48/Console.h | 4 +- bootstrap/unix-48/Files.c | 166 +++++++++---------- bootstrap/unix-48/Files.h | 34 ++-- bootstrap/unix-48/Heap.c | 200 +++++++++++----------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 12 +- bootstrap/unix-48/Modules.h | 8 +- bootstrap/unix-48/OPB.c | 154 ++++++++--------- bootstrap/unix-48/OPB.h | 20 +-- bootstrap/unix-48/OPC.c | 236 +++++++++++++------------- bootstrap/unix-48/OPC.h | 24 +-- bootstrap/unix-48/OPM.c | 168 +++++++++---------- bootstrap/unix-48/OPM.h | 34 ++-- bootstrap/unix-48/OPP.c | 92 +++++------ bootstrap/unix-48/OPS.c | 44 ++--- bootstrap/unix-48/OPS.h | 6 +- bootstrap/unix-48/OPT.c | 216 ++++++++++++------------ bootstrap/unix-48/OPT.h | 32 ++-- bootstrap/unix-48/OPV.c | 110 ++++++------- bootstrap/unix-48/Platform.c | 266 +++++++++++++++--------------- bootstrap/unix-48/Platform.h | 94 +++++------ bootstrap/unix-48/Reals.c | 64 ++++---- bootstrap/unix-48/Reals.h | 14 +- bootstrap/unix-48/SYSTEM.h | 104 ++++++++---- bootstrap/unix-48/Strings.c | 48 +++--- bootstrap/unix-48/Strings.h | 12 +- bootstrap/unix-48/Texts.c | 244 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 56 +++---- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/vt100.c | 88 +++++----- bootstrap/unix-48/vt100.h | 34 ++-- bootstrap/unix-88/Console.c | 26 +-- bootstrap/unix-88/Console.h | 4 +- bootstrap/unix-88/Files.c | 158 +++++++++--------- bootstrap/unix-88/Files.h | 34 ++-- bootstrap/unix-88/Heap.c | 200 +++++++++++----------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 12 +- bootstrap/unix-88/Modules.h | 8 +- bootstrap/unix-88/OPB.c | 164 +++++++++---------- bootstrap/unix-88/OPB.h | 20 +-- bootstrap/unix-88/OPC.c | 236 +++++++++++++------------- bootstrap/unix-88/OPC.h | 24 +-- bootstrap/unix-88/OPM.c | 156 +++++++++--------- bootstrap/unix-88/OPM.h | 34 ++-- bootstrap/unix-88/OPP.c | 86 +++++----- bootstrap/unix-88/OPS.c | 46 +++--- bootstrap/unix-88/OPS.h | 6 +- bootstrap/unix-88/OPT.c | 208 +++++++++++------------ bootstrap/unix-88/OPT.h | 32 ++-- bootstrap/unix-88/OPV.c | 110 ++++++------- bootstrap/unix-88/Platform.c | 262 ++++++++++++++--------------- bootstrap/unix-88/Platform.h | 94 +++++------ bootstrap/unix-88/Reals.c | 54 +++--- bootstrap/unix-88/Reals.h | 14 +- bootstrap/unix-88/SYSTEM.h | 104 ++++++++---- bootstrap/unix-88/Strings.c | 62 +++---- bootstrap/unix-88/Strings.h | 12 +- bootstrap/unix-88/Texts.c | 230 +++++++++++++------------- bootstrap/unix-88/Texts.h | 56 +++---- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/vt100.c | 88 +++++----- bootstrap/unix-88/vt100.h | 34 ++-- bootstrap/windows-48/Console.c | 26 +-- bootstrap/windows-48/Console.h | 4 +- bootstrap/windows-48/Files.c | 166 +++++++++---------- bootstrap/windows-48/Files.h | 34 ++-- bootstrap/windows-48/Heap.c | 200 +++++++++++----------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 12 +- bootstrap/windows-48/Modules.h | 8 +- bootstrap/windows-48/OPB.c | 154 ++++++++--------- bootstrap/windows-48/OPB.h | 20 +-- bootstrap/windows-48/OPC.c | 236 +++++++++++++------------- bootstrap/windows-48/OPC.h | 24 +-- bootstrap/windows-48/OPM.c | 168 +++++++++---------- bootstrap/windows-48/OPM.h | 34 ++-- bootstrap/windows-48/OPP.c | 92 +++++------ bootstrap/windows-48/OPS.c | 44 ++--- bootstrap/windows-48/OPS.h | 6 +- bootstrap/windows-48/OPT.c | 216 ++++++++++++------------ bootstrap/windows-48/OPT.h | 32 ++-- bootstrap/windows-48/OPV.c | 110 ++++++------- bootstrap/windows-48/Platform.c | 282 ++++++++++++++++---------------- bootstrap/windows-48/Platform.h | 94 +++++------ bootstrap/windows-48/Reals.c | 64 ++++---- bootstrap/windows-48/Reals.h | 14 +- bootstrap/windows-48/SYSTEM.h | 104 ++++++++---- bootstrap/windows-48/Strings.c | 48 +++--- bootstrap/windows-48/Strings.h | 12 +- bootstrap/windows-48/Texts.c | 244 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 56 +++---- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/vt100.c | 88 +++++----- bootstrap/windows-48/vt100.h | 34 ++-- bootstrap/windows-88/Console.c | 26 +-- bootstrap/windows-88/Console.h | 4 +- bootstrap/windows-88/Files.c | 158 +++++++++--------- bootstrap/windows-88/Files.h | 34 ++-- bootstrap/windows-88/Heap.c | 200 +++++++++++----------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 12 +- bootstrap/windows-88/Modules.h | 8 +- bootstrap/windows-88/OPB.c | 164 +++++++++---------- bootstrap/windows-88/OPB.h | 20 +-- bootstrap/windows-88/OPC.c | 236 +++++++++++++------------- bootstrap/windows-88/OPC.h | 24 +-- bootstrap/windows-88/OPM.c | 156 +++++++++--------- bootstrap/windows-88/OPM.h | 34 ++-- bootstrap/windows-88/OPP.c | 86 +++++----- bootstrap/windows-88/OPS.c | 46 +++--- bootstrap/windows-88/OPS.h | 6 +- bootstrap/windows-88/OPT.c | 208 +++++++++++------------ bootstrap/windows-88/OPT.h | 32 ++-- bootstrap/windows-88/OPV.c | 110 ++++++------- bootstrap/windows-88/Platform.c | 282 ++++++++++++++++---------------- bootstrap/windows-88/Platform.h | 94 +++++------ bootstrap/windows-88/Reals.c | 54 +++--- bootstrap/windows-88/Reals.h | 14 +- bootstrap/windows-88/SYSTEM.h | 104 ++++++++---- bootstrap/windows-88/Strings.c | 62 +++---- bootstrap/windows-88/Strings.h | 12 +- bootstrap/windows-88/Texts.c | 230 +++++++++++++------------- bootstrap/windows-88/Texts.h | 56 +++---- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/vt100.c | 88 +++++----- bootstrap/windows-88/vt100.h | 34 ++-- src/compiler/OPC.Mod | 32 ++-- src/compiler/OPV.Mod | 8 +- src/system/SYSTEM.h | 104 ++++++++---- 168 files changed, 6673 insertions(+), 6565 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 816df1b9..8c9c6910 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index bd3e3fd5..3c6594af 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 985572ec..d84672d4 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 033e03cf..c247eb06 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -163,68 +163,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -258,7 +258,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -267,10 +267,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -293,10 +293,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,64 +325,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { - LONGINT s, ns; + int32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -395,10 +395,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -411,10 +411,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -427,9 +427,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -440,9 +440,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -455,9 +455,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -492,15 +492,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -511,9 +511,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -526,9 +526,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -541,10 +541,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; - LONGINT written; + int16 _o_result; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -556,9 +556,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -569,9 +569,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - INTEGER _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -582,9 +582,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int16 Platform_Truncate (int32 h, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -595,9 +595,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -608,10 +608,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -624,9 +624,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -637,7 +637,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -653,7 +653,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -661,7 +661,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -670,7 +670,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -726,9 +726,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -740,12 +740,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -753,7 +753,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -763,7 +763,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 34d088bf..129004fd 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -7,74 +7,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index df4278f7..a736989a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index c878ff62..bba6eb24 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,22 +84,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -108,7 +108,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -129,41 +129,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 816df1b9..8c9c6910 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index bd3e3fd5..3c6594af 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 985572ec..d84672d4 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 033e03cf..c247eb06 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -163,68 +163,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -258,7 +258,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -267,10 +267,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -293,10 +293,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,64 +325,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { - LONGINT s, ns; + int32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -395,10 +395,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -411,10 +411,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - INTEGER fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -427,9 +427,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -440,9 +440,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -455,9 +455,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -492,15 +492,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -511,9 +511,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -526,9 +526,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; + int16 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -541,10 +541,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; - LONGINT written; + int16 _o_result; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -556,9 +556,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -569,9 +569,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - INTEGER _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -582,9 +582,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int16 Platform_Truncate (int32 h, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -595,9 +595,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -608,10 +608,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -624,9 +624,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -637,7 +637,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -653,7 +653,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -661,7 +661,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -670,7 +670,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -726,9 +726,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -740,12 +740,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -753,7 +753,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -763,7 +763,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 34d088bf..129004fd 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -7,74 +7,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index dddea925..8dea0639 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5499c3d0..d946691c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; LONGREAL _prvt0; char _prvt1[24]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index d884a64a..b4cd60d3 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -5,14 +5,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int32 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int64 i); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int32 error; error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -40,7 +40,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -50,11 +50,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 63, LONGINT)) { + int64 i1, k; + if (i == __LSHL(1, 63, int64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { @@ -96,9 +96,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int64 i) { - LONGINT k, n; + int64 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -113,8 +113,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int64 n; + int32 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -124,7 +124,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int64 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 8d9e2fb5..987b5478 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -12,8 +12,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int64 i); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 67a7a958..9ce98932 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -14,7 +14,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int64 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -29,23 +29,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int64 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int32 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int64 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int32 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -58,56 +58,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int64 *t, int64 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -136,7 +136,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int32 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -161,7 +161,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int64 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -213,7 +213,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int32 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -250,7 +250,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int32 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -274,7 +274,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int32 error; if (Files_files == f) { Files_files = f->next; } else { @@ -294,8 +294,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int64 i; + int32 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -311,9 +311,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int64 Files_Length (Files_File f) { - LONGINT _o_result; + int64 _o_result; _o_result = f->len; return _o_result; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -382,7 +382,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; CHAR ch; i = 0; ch = name[0]; @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int32 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -428,11 +428,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int64 fd; + int32 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int32 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -507,9 +507,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int32 i; Platform_FileIdentity identity; - INTEGER error; + int32 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -529,27 +529,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int64 *t, int64 *d) { Platform_FileIdentity identity; - INTEGER error; + int32 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) { - LONGINT org, offset, i, n; + int64 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int32 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -609,7 +609,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int64 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -631,9 +631,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -682,7 +682,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int64 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -700,9 +700,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -736,17 +736,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int64 fdold, fdnew, n; + int32 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -801,7 +801,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int32 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -820,7 +820,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -829,7 +829,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int64 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -848,14 +848,14 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); @@ -865,7 +865,7 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int64 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; @@ -887,7 +887,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -899,7 +899,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; BOOLEAN b; i = 0; @@ -915,20 +915,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int64 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); while (ch >= 128) { - n += __ASH((SYSTEM_INT64)(ch - 128), s); + n += __ASH((int64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -937,7 +937,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -945,7 +945,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -958,8 +958,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int64 i; + i = (int64)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -983,7 +983,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -991,7 +991,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1008,7 +1008,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int64 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3be486fe..dee1234e 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -12,13 +12,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[232]; - LONGINT fd; + int64 fd; char _prvt1[64]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; char _prvt0[31]; } Files_Rider; @@ -29,39 +29,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +import void Files_GetDate (Files_File f, int64 *t, int64 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5822f690..e96f7807 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -50,25 +50,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int64 refcnt; Heap_Cmd cmds; - LONGINT types; + int64 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int32 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -76,27 +76,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int64); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int64 Heap_NewChunk (int64 blksz) { - LONGINT _o_result; - LONGINT chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); - __PUT(chnk + 24, chnk + 32, LONGINT); - __PUT(chnk + 32, blksz, LONGINT); - __PUT(chnk + 40, -8, LONGINT); - __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int64 blksz) { - LONGINT size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 8, restsize, int64); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, LONGINT); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 16, 0, LONGINT); - __PUT(i + 24, 0, LONGINT); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 8, 0, LONGINT); - __PUT(adr + 16, 0, LONGINT); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; - __PUT(tag - 8, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int64 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int64 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, LONGINT); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, LONGINT); - __PUT(q - 8, tag + 1, LONGINT); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -385,12 +385,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int64); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - LONGINT i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - LONGINT l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int64 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int64)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5e7c01fb..40c921e4 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -32,8 +32,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int64 Heap_allocated, Heap_heapsize; +import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 004f1f8b..5f85fd33 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -27,15 +27,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int64 types; + void (*enumPtrs)(void(*)(int64)); + int64 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -52,7 +52,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int32 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6f5e4cad..d61c2889 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -29,15 +29,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int64 types; + void (*enumPtrs)(void(*)(int64)); char _prvt0[16]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index eacff2d0..36f97a5d 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -7,13 +7,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int32 OPB_exp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int64 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -21,10 +21,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -34,17 +34,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -52,17 +52,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int32 n); +static int64 OPB_log (int64 x); -static void OPB_err (INTEGER n) +static void OPB_err (int32 n) { OPM_err(n); } @@ -101,7 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -124,9 +124,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int64 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int64 _o_result; if (b) { _o_result = 1; return _o_result; @@ -137,7 +137,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; if (i == 0) { @@ -223,8 +223,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int32 b; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -237,7 +237,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -262,7 +262,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -294,7 +294,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -336,7 +336,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -461,15 +461,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int32 f; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -488,9 +488,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int64 OPB_log (int64 x) { - LONGINT _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -502,7 +502,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -526,9 +526,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -540,9 +540,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -679,7 +679,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int32 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -763,17 +763,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int32 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int32 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int32 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int32 _o_result; + int32 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -837,11 +837,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1117,8 +1117,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int32 f, g; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1169,14 +1169,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int32 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1219,13 +1219,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1496,19 +1496,19 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1531,14 +1531,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1553,7 +1553,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int32 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1696,9 +1696,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int32 fctno) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1913,7 +1913,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { + if (x->typ->size != (int64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1953,7 +1953,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2006,9 +2006,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2020,9 +2020,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int32 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2051,7 +2051,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT32)x->conval->intval; + L = (int32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2222,7 +2222,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2260,10 +2260,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) { OPT_Node node = NIL; - INTEGER f; + int32 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2305,9 +2305,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) { - INTEGER dim; + int32 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2371,7 +2371,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int32 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2480,7 +2480,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2495,7 +2495,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2555,7 +2555,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 7b980a10..61a0edcd 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -15,7 +15,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -24,25 +24,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ad70616c..8310f854 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -6,27 +6,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int32 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int64 *adr, int64 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int64 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int32 vis); +export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CharacterLiteral (int64 c); +export void OPC_Cmp (int32 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int32 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -43,45 +43,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int32 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int64 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int32 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int32 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int32 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int32 OPC_Length (CHAR *s, LONGINT s__len); +export int64 OPC_NofPtrs (OPT_Struct typ); +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int64 OPC_SizeAlignment (int64 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int32 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -99,14 +99,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int32 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int32 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -142,10 +142,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) { CHAR ch; - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -161,10 +161,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int32 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -173,10 +173,10 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int32 _o_result; + int32 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { @@ -189,17 +189,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int32 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -213,7 +216,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -222,7 +225,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -258,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int32 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -320,7 +323,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -328,8 +331,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int32 nofdims; + int64 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -388,12 +391,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int64 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int64 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int64 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -431,11 +434,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int64 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -511,7 +514,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -611,7 +614,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int64 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -740,7 +743,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -753,11 +756,11 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int32 vis) { - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int32 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { @@ -781,7 +784,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -813,7 +816,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int64 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -828,7 +831,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); OPC_EndStat(); } @@ -850,7 +853,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int64 *adr, int64 base) { switch (base) { case 2: @@ -870,11 +873,11 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int64 OPC_SizeAlignment (int64 size) { - LONGINT _o_result; - LONGINT alignment; - if (size < (SYSTEM_INT64)OPM_Alignment) { + int64 _o_result; + int64 alignment; + if (size < (int64)OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -886,10 +889,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int64 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int64 _o_result; + int64 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -903,19 +906,19 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) { - LONGINT adr; + int64 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (SYSTEM_INT64)OPM_IntSize) { + if (align == (int64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (SYSTEM_INT64)OPM_LIntSize) { + } else if (align == (int64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (SYSTEM_INT64)OPM_LRealSize) { + } else if (align == (int64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", 9); } OPC_Str1((CHAR*)" _prvt#", 8, *n); @@ -932,11 +935,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int64 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -980,7 +983,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); + adr = typ->size - (int64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -992,11 +995,11 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int32 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int32 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { @@ -1121,7 +1124,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1151,7 +1154,7 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); @@ -1162,7 +1165,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int32 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1210,7 +1213,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int32 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1361,7 +1364,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int64 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1522,7 +1525,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1751,7 +1754,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int32 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1780,7 +1783,7 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int32 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { if (ap->mnolev != OPM_level) { @@ -1799,7 +1802,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int32 rel) { switch (rel) { case 9: @@ -1828,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1843,10 +1846,10 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) { - LONGINT i; - INTEGER c; + int64 i; + int32 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; @@ -1871,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int64 caseVal, int32 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1909,30 +1912,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int64 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int64 n, int64 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1940,7 +1930,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1961,11 +1951,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int32 form) { - INTEGER i; + int32 i; SET s; - LONGINT hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2024,7 +2014,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2032,18 +2022,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int32 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2054,6 +2044,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2075,16 +2066,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bb250e9a..3c5dedf4 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -10,16 +10,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int64 *adr, int64 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int64 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int64 caseVal, int32 form); +import void OPC_Cmp (int32 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int32 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -32,19 +32,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int64 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int32 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import int64 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int64 OPC_SizeAlignment (int64 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int32 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 228e7978..d4b582de 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -15,23 +15,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int64 OPM_curpos, OPM_errpos, OPM_breakpc; +export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int32 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -41,54 +41,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int64 *fp, int64 val); +export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +export void OPM_FPrintReal (int64 *fp, REAL real); +export void OPM_FPrintSet (int64 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int64 pos); +export int64 OPM_SignedMaximum (int64 bytecount); +export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int64 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int32 n); +static int64 OPM_minusop (int64 i); +static int64 OPM_power0 (int64 i, int64 j); void OPM_LogW (CHAR ch) @@ -103,7 +103,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -115,7 +115,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int32 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -300,7 +300,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int64 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -348,7 +348,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int32 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -370,12 +370,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int32 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int32 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -400,7 +400,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -432,12 +432,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int32 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -459,7 +459,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); + i = (int32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -474,7 +474,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int32 n, int64 pos) { if (pos == -1) { pos = 0; @@ -526,49 +526,49 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int32 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int64 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int64)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int64 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, i, INTEGER); + int32 i; + int64 l; + __GET((SYSTEM_ADRINT)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int64 *fp, LONGREAL lr) { - LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + int64 l, h; + OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT32)(*S).i; + *size = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT32)(*S).i; + *align = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -579,17 +579,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int64 OPM_minusop (int64 i) { - LONGINT _o_result; + int64 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int64 OPM_power0 (int64 i, int64 j) { - LONGINT _o_result; - LONGINT k, p; + int64 _o_result; + int64 k, p; k = 1; p = i; do { @@ -641,19 +641,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int64 OPM_SignedMaximum (int64 bytecount) { - LONGINT _o_result; - LONGINT result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int64 OPM_SignedMinimum (int64 bytecount) { - LONGINT _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -687,10 +687,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int64 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int64 _o_result; + int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -698,7 +698,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); } void OPM_SymRReal (REAL *r) @@ -745,14 +745,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) @@ -796,7 +796,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -806,7 +806,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -814,17 +814,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT32)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT32)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -834,10 +834,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int64 i) { CHAR s[20]; - LONGINT i1, k; + int64 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -870,7 +870,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; + int32 i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); @@ -958,7 +958,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int32 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 6bbab25d..ccce7304 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -7,12 +7,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int64 OPM_curpos, OPM_errpos, OPM_breakpc; +import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -22,44 +22,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int64 *fp, int64 val); +import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +import void OPM_FPrintReal (int64 *fp, REAL real); +import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int64 OPM_SignedMaximum (int64 bytecount); +import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int64 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int32 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9337c539..78136a18 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -7,17 +7,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int64 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int32 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -25,10 +25,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int32 s); +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -38,7 +38,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -47,17 +47,17 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int32 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int32 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int32 s) { if (OPP_sym == s) { OPS_Get(&OPP_sym); @@ -69,7 +69,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -109,7 +109,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -127,10 +127,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) { OPT_Node x = NIL; - LONGINT sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT32)sf; + *sysflag = (int32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int32 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -250,8 +250,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int64 n; + int32 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -343,7 +343,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -624,9 +624,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); + int8 m; + int32 n; + m = (int8)((int32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -785,7 +785,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -798,7 +798,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -822,7 +822,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -848,7 +848,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -914,7 +914,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -927,8 +927,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int32 n; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -992,7 +992,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1015,7 +1015,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1087,7 +1087,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1164,11 +1164,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int32 i, f; + int64 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1235,7 +1235,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int64 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1245,8 +1245,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int32 n; + int64 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1329,7 +1329,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int64 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1622,7 +1622,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int32 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1775,7 +1775,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e575dfe6..efd39a62 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -12,29 +12,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int32 OPS_numtyp; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int32 n); -static void OPS_err (INTEGER n) +static void OPS_err (int32 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int32 i; CHAR och; i = 0; och = OPS_ch; @@ -66,9 +66,9 @@ static void OPS_Str (SHORTINT *sym) } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int32 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -87,10 +87,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int32 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int32 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int32 e) { LONGREAL _o_result; LONGREAL x, p; @@ -109,9 +109,9 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int32 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int32 _o_result; if (ch <= '9') { _o_result = ch - 48; return _o_result; @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int32 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { - OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } @@ -310,9 +310,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a60ffe74..c497e5c6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -15,13 +15,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int32 OPS_numtyp; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 35088301..287c2ba6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -13,17 +13,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int64 reffp; + int32 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -34,13 +34,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int64 nextTag, reffp; + int32 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int64 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -49,7 +49,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -61,22 +61,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int64 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -85,7 +85,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -93,7 +93,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -106,62 +106,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int64 value); +static void OPT_EnterProc (OPS_Name name, int32 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int32 errcode); +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int64 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int64 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); +static void OPT_OutMod (int32 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +static void OPT_err (int32 n); -static void OPT_err (INTEGER n) +static void OPT_err (int32 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - INTEGER i; + int32 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -170,10 +170,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) { OPT_Struct _o_result; - INTEGER i; + int32 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -204,7 +204,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -221,7 +221,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -235,12 +235,12 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); _o_result = ext; return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -278,7 +278,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int32 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -370,7 +370,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -408,9 +408,9 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -453,7 +453,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -469,8 +469,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int64 idfp; + int32 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -499,17 +499,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int64 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -539,7 +539,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -574,10 +574,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int32 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int64 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -638,8 +638,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int64 fprint; + int32 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -696,9 +696,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int32 errcode) { - INTEGER i, j; + int32 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -788,7 +788,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -798,12 +798,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int64 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -840,10 +840,10 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int64 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { @@ -889,10 +889,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int64 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -920,7 +920,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -949,10 +949,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -977,7 +977,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int64 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -992,9 +992,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int32 ref; + int64 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); + (*typ)->sysflag = (int32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1172,14 +1172,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int32 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int64 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1212,7 +1212,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT32)OPM_SymRInt(); + s = (int32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1278,7 +1278,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1321,7 +1321,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -1331,7 +1331,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int32 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1343,9 +1343,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1375,7 +1375,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1530,7 +1530,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int32 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1565,7 +1565,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int32 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1655,8 +1655,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int32 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1698,7 +1698,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1712,7 +1712,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int64 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1724,7 +1724,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1747,7 +1747,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index c3fdc0cf..808e8043 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -16,7 +16,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[24]; OPT_Struct BaseTyp; @@ -69,7 +69,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -82,7 +82,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int32 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,14 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c769935e..5b1ffe19 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -8,15 +8,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int32 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int32 OPV_stamp; +static int64 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int32 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -24,38 +24,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int32 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int64 n, int64 size); +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int64 from, int64 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int32 prec); +static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int64 OPV_NaturalAlignment (int64 size, int64 max) { - LONGINT _o_result; - LONGINT i; + int64 _o_result; + int64 i; if (size >= max) { _o_result = max; return _o_result; @@ -72,8 +72,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int32 f, c; + int64 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -88,7 +88,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -119,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -157,7 +157,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int64 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -193,7 +193,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int32 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -223,7 +223,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int32 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -298,9 +298,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) { - INTEGER _o_result; + int32 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -433,7 +433,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -462,7 +462,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int32 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -473,34 +473,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int64 from, int64 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) { - INTEGER from, to; + int32 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -562,7 +546,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -579,13 +563,13 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int32 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int32 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -669,7 +653,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { + while ((int64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -758,7 +742,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int64 n, int64 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -770,7 +754,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int32 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -869,9 +853,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int32 prec) { - INTEGER class, subclass, form, exprPrec; + int32 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1187,7 +1171,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int64 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1237,8 +1221,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int64 low, high; + int32 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1305,7 +1289,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int32 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 84e4aba7..fd00502a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -9,90 +9,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int64 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int64 Platform_MainStackFrame, Platform_HaltCode; +export int32 Platform_PID; export CHAR Platform_CWD[256]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int32 Platform_ArgCount; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int64 Platform_TimeStart; +export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int32 e); +export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int64 code); +export int32 Platform_Chdir (CHAR *n, LONGINT n__len); +export int32 Platform_Close (int64 h); +export BOOLEAN Platform_ConnectionFailed (int32 e); +export void Platform_Delay (int64 ms); +export BOOLEAN Platform_DifferentFilesystems (int32 e); +static void Platform_DisplayHaltCode (int64 code); +export int32 Platform_Error (void); +export void Platform_Exit (int32 code); +export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int64 *t, int64 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int32 n, int64 *val); +export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +export void Platform_Halt (int64 code); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int32 e); +export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +export BOOLEAN Platform_NoSuchDirectory (int32 e); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); +export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +export int32 Platform_Seek (int64 h, int64 offset, int32 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Sync (int64 h); +export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT l); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d); +export int64 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int32 e); +export BOOLEAN Platform_TooManyFiles (int32 e); +export int32 Platform_Truncate (int64 h, int64 l); +export int32 Platform_Unlink (CHAR *n, LONGINT n__len); +export int32 Platform_Write (int64 h, int64 p, int64 l); +static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int64 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int64 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -164,68 +164,68 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int32 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int64 Platform_OSAllocate (int64 size) { - LONGINT _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -259,7 +259,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -268,10 +268,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int32 n, int64 *val) { CHAR s[64]; - LONGINT k, d, i; + int64 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -294,10 +294,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int32 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -326,64 +326,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d) { *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int64 *t, int64 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int64 *sec, int64 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -LONGINT Platform_Time (void) +int64 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int64 _o_result; + int64 ms; Platform_gettimeval(); ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; _o_result = __MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int64 ms) { - LONGINT s, ns; + int64 s, ns; s = __DIV(ms, 1000); ns = __MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int32 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; + int32 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -INTEGER Platform_Error (void) +int32 Platform_Error (void) { - INTEGER _o_result; + int32 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -396,10 +396,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -412,10 +412,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - INTEGER fd; + int32 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -428,9 +428,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int32 Platform_Close (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -441,9 +441,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -456,9 +456,9 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -493,15 +493,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int32 Platform_Size (int64 h, int64 *l) { - INTEGER _o_result; + int32 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -512,9 +512,9 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) { - INTEGER _o_result; + int32 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -527,9 +527,9 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { - INTEGER _o_result; + int32 _o_result; *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); if (*n < 0) { *n = 0; @@ -542,10 +542,10 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int32 Platform_Write (int64 h, int64 p, int64 l) { - INTEGER _o_result; - LONGINT written; + int32 _o_result; + int64 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -557,9 +557,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int32 Platform_Sync (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -570,9 +570,9 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) +int32 Platform_Seek (int64 h, int64 offset, int32 whence) { - INTEGER _o_result; + int32 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -583,9 +583,9 @@ INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT l) +int32 Platform_Truncate (int64 h, int64 l) { - INTEGER _o_result; + int32 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -596,9 +596,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT l) __RETCHK; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int32 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -609,10 +609,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int32 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int32 _o_result; + int32 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -625,9 +625,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -638,7 +638,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int32 code) { Platform_exit(code); } @@ -654,7 +654,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int64 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -662,7 +662,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + __MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int64 l) { if (l < 0) { Platform_errch('-'); @@ -671,7 +671,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int64 code) { switch (code) { case -1: @@ -727,9 +727,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int64 code) { - INTEGER e; + int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -741,12 +741,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int64 code) { - INTEGER e; + int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -754,7 +754,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -764,7 +764,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int32 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 906f09cb..caba8898 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -8,74 +8,74 @@ typedef struct Platform_FileIdentity { - LONGINT volume, index, mtime; + int64 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int64 Platform_MainStackFrame, Platform_HaltCode; +import int32 Platform_PID; import CHAR Platform_CWD[256]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_ArgCount; +import int64 Platform_ArgVector; +import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int32 e); +import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int64 code); +import int32 Platform_Chdir (CHAR *n, LONGINT n__len); +import int32 Platform_Close (int64 h); +import BOOLEAN Platform_ConnectionFailed (int32 e); +import void Platform_Delay (int64 ms); +import BOOLEAN Platform_DifferentFilesystems (int32 e); +import int32 Platform_Error (void); +import void Platform_Exit (int32 code); +import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int64 *t, int64 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int32 n, int64 *val); +import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +import void Platform_Halt (int64 code); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int32 e); +import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +import BOOLEAN Platform_NoSuchDirectory (int32 e); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); +import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT offset, INTEGER whence); +import int32 Platform_Seek (int64 h, int64 offset, int32 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT l); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Sync (int64 h); +import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int64 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int32 e); +import BOOLEAN Platform_TooManyFiles (int32 e); +import int32 Platform_Truncate (int64 h, int64 l); +import int32 Platform_Unlink (CHAR *n, LONGINT n__len); +import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 98719812..5877bedc 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -6,19 +6,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +export int32 Reals_Expo (REAL x); +export int32 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int32 ex); +export REAL Reals_Ten (int32 e); +export LONGREAL Reals_TenL (int32 e); +static CHAR Reals_ToHex (int32 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int32 e) { REAL _o_result; LONGREAL r, power; @@ -35,7 +35,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int32 e) { LONGREAL _o_result; LONGREAL r, power; @@ -55,16 +55,16 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int32 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); @@ -73,36 +73,36 @@ void Reals_SetExpo (REAL *x, INTEGER ex) __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int32 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int64 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; i = __ENTIER(x); - while (k < (SYSTEM_INT64)n) { + while (k < (int64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int32 i) { CHAR _o_result; if (i < 10) { @@ -117,12 +117,12 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int32 i; + int64 l; CHAR by; i = 0; l = b__len; - while ((SYSTEM_INT64)i < l) { + while ((int64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 87c9aa45..cf944612 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -9,15 +9,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +import int32 Reals_Expo (REAL x); +import int32 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int32 ex); +import REAL Reals_Ten (int32 e); +import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 24999430..85e9fca9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -7,22 +7,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int32 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; __DUP(s, s__len, CHAR); i = 0; - while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -32,24 +32,24 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { + while ((i < n2 && (int64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((SYSTEM_INT64)(i + n1) < dest__len) { + if ((int64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((SYSTEM_INT64)(pos + n2) < dest__len) { + if ((int64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((SYSTEM_INT64)(i + n2) < dest__len) { + if ((int64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -77,9 +77,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) { - INTEGER len, i; + int32 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((SYSTEM_INT64)(i - n) < s__len) { + if ((int64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -100,7 +100,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -108,12 +108,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int32 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT32)dest__len - 1; + destLen = (int32)dest__len - 1; if (pos < 0) { pos = 0; } @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -132,10 +132,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int32 _o_result; + int32 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -170,7 +170,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -184,9 +184,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9c2bad27..d703f8c0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -11,13 +11,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ff526cbc..0c5cb89c 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -14,9 +14,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -37,26 +37,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int64 org, span; CHAR mod[32], proc[32]; }; @@ -65,7 +65,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int64 len; Texts_Run head; } Texts_BufDesc; @@ -79,8 +79,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -95,7 +95,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_PieceDesc *Texts_Piece; @@ -103,57 +103,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int64 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int64 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -179,50 +179,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int64 beg, int64 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int64 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -237,10 +237,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) { Texts_Run v = NIL; - LONGINT m; + int64 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -270,7 +270,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -369,11 +369,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int64 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int64 _o_result; Texts_Run u = NIL; - LONGINT pos; + int64 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -388,7 +388,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int64 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -464,10 +464,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int64 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -498,11 +498,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int64 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -521,7 +521,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int64 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -536,10 +536,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int64 beg, int64 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -561,10 +561,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -600,7 +600,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -617,7 +617,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int64 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -709,14 +709,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -728,7 +728,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int32 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -756,9 +756,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int32 e; + int64 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = k * 10 + (int64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -974,12 +974,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1036,7 +1036,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1046,10 +1046,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { - INTEGER i; - LONGINT x0; + int32 i; + int64 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (SYSTEM_INT64)i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,10 +1081,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) { - INTEGER i; - LONGINT y; + int32 i; + int64 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1104,9 +1104,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) { - INTEGER e; + int32 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1177,15 +1177,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int32 n); +static void seq__56 (CHAR ch, int32 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int32 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1193,7 +1193,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int32 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1202,9 +1202,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) { - INTEGER e, i; + int32 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1276,7 +1276,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int32 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1286,9 +1286,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) { - INTEGER e; + int32 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (int32)__ASHR((int64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1360,7 +1360,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int32 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1376,16 +1376,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int64 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int64 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1402,22 +1402,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int64 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1467,8 +1467,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int64 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1538,7 +1538,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int32 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1553,7 +1553,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int64 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1603,20 +1603,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int64 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1647,8 +1647,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int64 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1765,7 +1765,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int32 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f36b27cf..2e48fe94 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -9,7 +9,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int64 len; char _prvt0[8]; } Texts_BufDesc; @@ -41,15 +41,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[40]; - LONGINT W, H; + int64 W, H; Texts_Handler handle; char _prvt1[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; char _prvt0[24]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[54]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int64 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 65dd2639..c313eb20 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -21,7 +21,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int32 sig); void Vishap_Module (BOOLEAN *done) @@ -127,7 +127,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 566e2b5c..bc32dc20 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -18,7 +18,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index b9fb5373..a757d25d 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -9,36 +9,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int32 n); +export void vt100_CNL (int32 n); +export void vt100_CPL (int32 n); +export void vt100_CUB (int32 n); +export void vt100_CUD (int32 n); +export void vt100_CUF (int32 n); +export void vt100_CUP (int32 n, int32 m); +export void vt100_CUU (int32 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int32 n); +export void vt100_ED (int32 n); +export void vt100_EL (int32 n); +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int32 n, int32 m); +export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int32 n); +export void vt100_SGR (int32 n); +export void vt100_SGR2 (int32 n, int32 m); +export void vt100_SU (int32 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) { CHAR h; while (start < end) { @@ -50,11 +50,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int32 s, e; + int8 maxLength; maxLength = 20; if (int_ == (-9223372036854775807-1)) { __MOVE("-9223372036854775808", b, 21); @@ -89,7 +89,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -102,7 +102,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -115,7 +115,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -131,82 +131,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int32 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int32 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int32 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int32 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int32 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int32 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int32 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int32 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int32 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int32 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int32 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int32 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int32 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 745ff709..fb8a12d0 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -10,27 +10,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int32 n); +import void vt100_CNL (int32 n); +import void vt100_CPL (int32 n); +import void vt100_CUB (int32 n); +import void vt100_CUD (int32 n); +import void vt100_CUF (int32 n); +import void vt100_CUP (int32 n, int32 m); +import void vt100_CUU (int32 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int32 n); +import void vt100_ED (int32 n); +import void vt100_EL (int32 n); +import void vt100_HVP (int32 n, int32 m); +import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int32 n); +import void vt100_SGR (int32 n); +import void vt100_SGR2 (int32 n, int32 m); +import void vt100_SU (int32 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index bd7a7d85..72c0b6bf 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -4,14 +4,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int32 i); +export void Console_Int (int32 i, int32 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -20,7 +20,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int16 error; error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -39,7 +39,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -49,11 +49,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int32 i, int32 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 31, LONGINT)) { + int32 i1, k; + if (i == __LSHL(1, 31, int32)) { __MOVE("8463847412", s, 11); k = 10; } else { @@ -95,9 +95,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int32 i) { - LONGINT k, n; + int32 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -112,8 +112,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -123,7 +123,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 2c01265d..16287a76 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -11,8 +11,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int32 i); +import void Console_Int (int32 i, int32 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 459e292f..4aecc2ee 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -13,7 +13,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -28,23 +28,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -57,56 +57,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -135,7 +135,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -160,7 +160,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -212,7 +212,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -249,7 +249,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -273,7 +273,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -293,8 +293,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -310,9 +310,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - LONGINT _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -335,9 +335,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -397,7 +397,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -427,11 +427,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -506,9 +506,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int16 i; Platform_FileIdentity identity; - INTEGER error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -528,27 +528,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - INTEGER error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) { - LONGINT org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -608,7 +608,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -630,9 +630,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -681,7 +681,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -699,9 +699,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - LONGINT xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -735,17 +735,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -800,7 +800,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -819,7 +819,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -828,7 +828,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -847,26 +847,26 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -886,7 +886,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -898,7 +898,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -914,20 +914,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while ((SYSTEM_INT16)ch >= 128) { - n += __ASH(((SYSTEM_INT16)ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } @@ -936,7 +936,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -944,7 +944,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -957,8 +957,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -982,7 +982,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -990,7 +990,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1007,7 +1007,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int32 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3de5b022..e85d1cfd 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -11,13 +11,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[224]; - LONGINT fd; + int32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; @@ -28,39 +28,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 50d17d87..a252264a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -49,25 +49,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int32 refcnt; Heap_Cmd cmds; - LONGINT types; + int32 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int16 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -75,27 +75,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int32); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int32 Heap_NewChunk (int32 blksz) { - LONGINT _o_result; - LONGINT chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), LONGINT); - __PUT(chnk + 12, chnk + 16, LONGINT); - __PUT(chnk + 16, blksz, LONGINT); - __PUT(chnk + 20, -4, LONGINT); - __PUT(chnk + 24, Heap_bigBlocks, LONGINT); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int32 blksz) { - LONGINT size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, LONGINT); - __PUT(end + 8, -4, LONGINT); - __PUT(end, end + 4, LONGINT); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, LONGINT); + __PUT(adr + 4, restsize, int32); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, LONGINT); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, LONGINT); - __PUT(adr + 12, Heap_freeList[di], LONGINT); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 4, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 12, 0, LONGINT); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 4, 0, LONGINT); - __PUT(adr + 8, 0, LONGINT); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; - __PUT(tag - 4, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 4, -4, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); + tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int32 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int32 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, LONGINT); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, LONGINT); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, LONGINT); - __PUT(q - 4, tag + 1, LONGINT); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -384,12 +384,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int32); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, LONGINT); - __PUT(start + 4, freesize, LONGINT); - __PUT(start + 8, -4, LONGINT); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], LONGINT); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, LONGINT); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - LONGINT i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - LONGINT l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int32 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int32)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a4e30a5e..a89f18fc 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -31,8 +31,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int32 Heap_allocated, Heap_heapsize; +import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 52abc5b8..7969f68f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -26,15 +26,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -51,7 +51,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6bee52c7..8b271308 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int32 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int32 types; + void (*enumPtrs)(void(*)(int32)); char _prvt0[8]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a3322969..bc74dd1d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -6,13 +6,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int16 OPB_exp; +static int32 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -20,10 +20,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -33,17 +33,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int32 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int32 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int32 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -51,17 +51,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int16 n); +static int32 OPB_log (int32 x); -static void OPB_err (INTEGER n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -100,7 +100,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -123,9 +123,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; @@ -136,7 +136,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int32 i) { BOOLEAN _o_result; if (i == 0) { @@ -222,8 +222,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int16 b; + int32 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -236,7 +236,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int32 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -261,7 +261,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int32 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -293,7 +293,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -335,7 +335,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -460,8 +460,8 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int16 f; + int32 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -487,9 +487,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int32 OPB_log (int32 x) { - LONGINT _o_result; + int32 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -501,7 +501,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -525,9 +525,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -539,9 +539,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -678,7 +678,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -762,17 +762,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -836,11 +836,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int32 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1116,8 +1116,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int16 f, g; + int32 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1168,14 +1168,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1218,13 +1218,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int32 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1495,7 +1495,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int32 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1530,7 +1530,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int32 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1552,7 +1552,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1695,9 +1695,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - INTEGER f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -2005,9 +2005,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2019,9 +2019,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT16)x->conval->intval; + L = (int16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2259,10 +2259,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - INTEGER f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2304,9 +2304,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - INTEGER dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2370,7 +2370,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2479,7 +2479,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2494,7 +2494,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2554,7 +2554,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 97c4485c..a4ccc86e 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -14,7 +14,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -23,25 +23,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int32 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int32 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9f818a4a..08469d42 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -5,27 +5,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int16 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int32 caseVal, int16 form); +static void OPC_CharacterLiteral (int32 c); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -42,45 +42,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int32 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -98,14 +98,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -141,10 +141,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -160,10 +160,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -172,14 +172,14 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -188,17 +188,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -212,7 +215,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -221,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -257,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -327,8 +330,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +390,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +433,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +513,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -610,7 +613,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -739,7 +742,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -752,14 +755,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +771,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -780,7 +783,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -812,7 +815,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -849,7 +852,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -869,10 +872,10 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int32 OPC_SizeAlignment (int32 size) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -885,10 +888,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -902,9 +905,9 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - LONGINT adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -931,11 +934,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -991,16 +994,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1120,7 +1123,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1150,18 +1153,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1209,7 +1212,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1360,7 +1363,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1521,7 +1524,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1750,7 +1753,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1779,10 +1782,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((SYSTEM_INT16)ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1798,7 +1801,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1827,7 +1830,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int32 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1842,15 +1845,15 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - LONGINT i; - INTEGER c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (SYSTEM_INT16)s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1870,7 +1873,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int32 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1908,30 +1911,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int32 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1939,7 +1929,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1960,11 +1950,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int16 form) { - INTEGER i; + int16 i; SET s; - LONGINT hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2023,7 +2013,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2031,18 +2021,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2053,6 +2043,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2074,16 +2065,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 38f95afe..05c34fcc 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int32 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index f2da0fed..8bf863b3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -14,23 +14,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int16 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -40,54 +40,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int32 i, int32 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int32 pos); +export int32 OPM_SignedMaximum (int32 bytecount); +export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int32 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int32 i); +export void OPM_WriteInt (int32 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -102,7 +102,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int32 i, int32 len) { Console_Int(i, len); } @@ -114,7 +114,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int16 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_IntSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -299,7 +299,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -347,7 +347,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -369,12 +369,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int16 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -399,7 +399,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -431,12 +431,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int32 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); + i = (int16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -473,7 +473,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -525,51 +525,51 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, l, LONGINT); + int16 i; + int32 l; + __GET((SYSTEM_ADRINT)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - LONGINT l, h; - __GET((SYSTEM_ADRINT)&lr, l, LONGINT); - __GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT); + int32 l, h; + __GET((SYSTEM_ADRINT)&lr, l, int32); + __GET((SYSTEM_ADRINT)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT16)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT16)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -580,17 +580,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int32 OPM_minusop (int32 i) { - LONGINT _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int32 OPM_power0 (int32 i, int32 j) { - LONGINT _o_result; - LONGINT k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -642,19 +642,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int32 OPM_SignedMaximum (int32 bytecount) { - LONGINT _o_result; - LONGINT result; + int32 _o_result; + int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int32 OPM_SignedMinimum (int32 bytecount) { - LONGINT _o_result; + int32 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -688,10 +688,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -699,7 +699,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -746,14 +746,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int32 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -797,7 +797,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -807,7 +807,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -815,17 +815,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int32 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT16)i, 4); + int16 digit; + digit = __ASHR((int16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT16)i, -16); + digit = __MASK((int16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -835,10 +835,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int32 i) { CHAR s[20]; - LONGINT i1, k; + int32 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -871,14 +871,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((SYSTEM_INT32)__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -959,7 +959,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 15a980a6..36eb4165 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -21,44 +21,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int32 i, int32 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int32 OPM_SignedMaximum (int32 bytecount); +import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int32 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int32 i); +import void OPM_WriteInt (int32 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 21c21350..a366ef24 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -6,17 +6,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -24,10 +24,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -37,7 +37,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -46,19 +46,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int16 s) { - if ((SYSTEM_INT16)OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -68,7 +68,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -108,7 +108,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -126,10 +126,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - LONGINT sf; + int32 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT16)sf; + *sysflag = (int16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -157,7 +157,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -249,8 +249,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int32 n; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -342,7 +342,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -623,9 +623,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); + int8 m; + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -784,7 +784,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -797,7 +797,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -821,7 +821,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -847,7 +847,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -913,7 +913,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -926,8 +926,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int16 n; + int32 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -991,7 +991,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1014,7 +1014,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1086,7 +1086,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1163,11 +1163,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((SYSTEM_INT16)LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if (((SYSTEM_INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1234,7 +1234,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1244,8 +1244,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1328,7 +1328,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1621,7 +1621,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,7 +1774,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f197a5c6..2b29372f 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -11,29 +11,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int16 OPS_numtyp; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int16 n); -static void OPS_err (INTEGER n) +static void OPS_err (int16 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -59,15 +59,15 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (SYSTEM_INT16)OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -86,10 +86,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -108,14 +108,14 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = (SYSTEM_INT16)ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = ((SYSTEM_INT16)ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -127,7 +127,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int16 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -309,9 +309,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1e99f5e9..e40119f7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int16 OPS_numtyp; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 5b495ad5..7fbad791 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -12,17 +12,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int32 reffp; + int16 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -33,13 +33,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int32 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -48,7 +48,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -60,22 +60,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -92,7 +92,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -105,62 +105,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (INTEGER n) +static void OPT_err (int16 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - INTEGER i; + int16 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -169,10 +169,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - INTEGER i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -203,7 +203,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -220,7 +220,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -239,7 +239,7 @@ OPT_ConstExt OPT_NewExt (void) return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -277,7 +277,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -369,7 +369,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -407,14 +407,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (SYSTEM_INT16)ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -452,7 +452,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -468,8 +468,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -498,17 +498,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -538,7 +538,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -573,10 +573,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -637,8 +637,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (SYSTEM_INT16)(*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -695,9 +695,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - INTEGER i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -787,7 +787,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -797,12 +797,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int32 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -839,16 +839,16 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (SYSTEM_INT16)ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -888,10 +888,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -919,7 +919,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -948,10 +948,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -976,7 +976,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -991,9 +991,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1171,14 +1171,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT16)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1277,7 +1277,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1320,7 +1320,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int16 i; CHAR ch; i = 0; do { @@ -1330,7 +1330,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1342,9 +1342,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - LONGINT i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1374,7 +1374,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1529,7 +1529,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1564,7 +1564,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (SYSTEM_INT16)(*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1654,8 +1654,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int16 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1697,7 +1697,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1711,7 +1711,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1723,7 +1723,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1746,7 +1746,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 307b94e2..480267cc 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -15,7 +15,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int32 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -32,7 +32,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -44,20 +44,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -81,7 +81,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,14 +92,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index df62e985..5ef539df 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -7,15 +7,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int16 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int16 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -23,38 +23,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int32 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int32 OPV_NaturalAlignment (int32 size, int32 max) { - LONGINT _o_result; - LONGINT i; + int32 _o_result; + int32 i; if (size >= max) { _o_result = max; return _o_result; @@ -71,8 +71,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -156,7 +156,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -192,7 +192,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -222,7 +222,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -297,9 +297,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - INTEGER _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -432,7 +432,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int32 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -461,7 +461,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int16 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -472,34 +472,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - INTEGER from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -561,7 +545,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -578,18 +562,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int16 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +672,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((SYSTEM_INT16)obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -757,7 +741,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int32 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -769,7 +753,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -868,9 +852,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int16 prec) { - INTEGER class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1186,7 +1170,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1236,8 +1220,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int32 low, high; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1304,7 +1288,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index c1158d0f..b8a6b5a5 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -8,90 +8,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int32 Platform_MainStackFrame, Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[4096]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int16 Platform_ArgCount; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 limit); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, int32 p, int32 l); +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -175,68 +175,68 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int32 Platform_OSAllocate (int32 size) { - LONGINT _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -251,7 +251,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - INTEGER res; + int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -276,7 +276,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -285,10 +285,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - LONGINT k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (SYSTEM_INT16)s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -311,10 +311,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -332,28 +332,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -LONGINT Platform_Time (void) +int32 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int32 _o_result; + int32 ms; ms = Platform_GetTickCount(); _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -364,7 +364,7 @@ void Platform_Delay (LONGINT ms) } } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -374,10 +374,10 @@ void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) *usec = Platform_uluSec(); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -393,17 +393,17 @@ INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -INTEGER Platform_Error (void) +int16 Platform_Error (void) { - INTEGER _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -416,10 +416,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -432,10 +432,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - INTEGER _o_result; - LONGINT fd; + int16 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -448,9 +448,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int16 Platform_Close (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -461,9 +461,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -478,11 +478,11 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; - LONGINT h; - INTEGER e, i; + int16 _o_result; + int32 h; + int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -517,16 +517,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int16 Platform_Size (int32 h, int32 *l) { - INTEGER _o_result; + int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -537,10 +537,10 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; *n = 0; result = Platform_readfile(h, p, l, &*n); if (result == 0) { @@ -554,10 +554,10 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - INTEGER _o_result; - INTEGER result; + int16 _o_result; + int16 result; *n = 0; result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { @@ -571,9 +571,9 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int16 Platform_Write (int32 h, int32 p, int32 l) { - INTEGER _o_result; + int16 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -584,9 +584,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int16 Platform_Sync (int32 h) { - INTEGER _o_result; + int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -597,10 +597,10 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +int16 Platform_Seek (int32 h, int32 o, int16 r) { - INTEGER _o_result; - INTEGER rc; + int16 _o_result; + int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -613,11 +613,11 @@ INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +int16 Platform_Truncate (int32 h, int32 limit) { - INTEGER _o_result; - INTEGER rc; - LONGINT oldpos; + int16 _o_result; + int16 rc; + int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -642,9 +642,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT limit) return _o_result; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -655,10 +655,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int16 _o_result; + int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -669,9 +669,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -682,7 +682,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -698,7 +698,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -706,7 +706,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -715,7 +715,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -756,9 +756,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int32 code) { - INTEGER e; + int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -770,12 +770,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int32 code) { - INTEGER e; + int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -783,7 +783,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -793,7 +793,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int16 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 7deb4830..23922225 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -12,69 +12,69 @@ typedef } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int32 Platform_MainStackFrame, Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[4096]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int16 Platform_ArgCount; +import int32 Platform_ArgVector; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 limit); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 28a855aa..4b500170 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -5,19 +5,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -34,7 +34,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -54,43 +54,43 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int16 _o_result; + int16 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -100,7 +100,7 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (SYSTEM_INT32)__ENTIER(x); + i = (int32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -109,12 +109,12 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -129,15 +129,15 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 65543fac..a1191c0b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 834c1fb1..6463db16 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -6,19 +6,19 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -46,9 +46,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -76,9 +76,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - INTEGER len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -99,7 +99,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -107,12 +107,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT16)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -131,10 +131,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -169,7 +169,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -183,9 +183,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 2edcc736..07051628 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index dddea925..8dea0639 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -13,9 +13,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -36,26 +36,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -64,7 +64,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -78,8 +78,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -94,7 +94,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -102,57 +102,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int32 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int32 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -178,50 +178,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -236,10 +236,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - LONGINT m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -269,7 +269,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -368,11 +368,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int32 _o_result; Texts_Run u = NIL; - LONGINT pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -387,7 +387,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -463,10 +463,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -497,11 +497,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -520,7 +520,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -535,10 +535,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -560,10 +560,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -599,7 +599,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -616,7 +616,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -708,14 +708,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -727,7 +727,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -755,9 +755,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((SYSTEM_INT16)ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = (SYSTEM_INT16)d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -973,12 +973,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1035,7 +1035,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1045,10 +1045,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) { - INTEGER i; - LONGINT x0; + int16 i; + int32 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1080,10 +1080,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) { - INTEGER i; - LONGINT y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1103,9 +1103,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) { - INTEGER e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1176,15 +1176,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1192,7 +1192,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1201,9 +1201,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) { - INTEGER e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1275,7 +1275,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1285,9 +1285,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) { - INTEGER e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1359,7 +1359,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1375,16 +1375,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1401,22 +1401,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int32 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1466,8 +1466,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int32 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1537,7 +1537,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1552,7 +1552,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1602,20 +1602,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int32 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1646,8 +1646,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int32 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1764,7 +1764,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5499c3d0..d946691c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int32 len; char _prvt0[4]; } Texts_BufDesc; @@ -40,15 +40,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[20]; - LONGINT W, H; + int32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; LONGREAL _prvt0; char _prvt1[24]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[26]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 030b94f6..c8f81032 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -20,7 +20,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -126,7 +126,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index bfab2dc6..b894b3f9 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -17,7 +17,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 84707926..46a1e460 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -8,36 +8,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -49,11 +49,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int16 s, e; + int8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -88,7 +88,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -101,7 +101,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -114,7 +114,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -130,82 +130,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 6266a678..ad1ac948 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7269d448..4331a772 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -5,14 +5,14 @@ static CHAR Console_line[128]; -static INTEGER Console_pos; +static int32 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (LONGINT i); -export void Console_Int (LONGINT i, LONGINT n); +export void Console_Hex (int64 i); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - INTEGER error; + int32 error; error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); Console_pos = 0; } @@ -40,7 +40,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -50,11 +50,11 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (LONGINT i, LONGINT n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; - LONGINT i1, k; - if (i == __LSHL(1, 63, LONGINT)) { + int64 i1, k; + if (i == __LSHL(1, 63, int64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { @@ -96,9 +96,9 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (LONGINT i) +void Console_Hex (int64 i) { - LONGINT k, n; + int64 k, n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); @@ -113,8 +113,8 @@ void Console_Hex (LONGINT i) void Console_Read (CHAR *ch) { - LONGINT n; - INTEGER error; + int64 n; + int32 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -124,7 +124,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - LONGINT i; + int64 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 8d9e2fb5..987b5478 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -12,8 +12,8 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (LONGINT i); -import void Console_Int (LONGINT i, LONGINT n); +import void Console_Hex (int64 i); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5ec9a8a2..0c20d87b 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -14,7 +14,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - LONGINT org, size; + int64 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -29,23 +29,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - LONGINT fd, len, pos; + int64 fd, len, pos; Files_Buffer bufs[4]; - INTEGER swapper, state; + int32 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; Files_Buffer buf; - LONGINT org, offset; + int64 org, offset; } Files_Rider; static Files_File Files_files; -static INTEGER Files_tempno; +static int32 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -58,56 +58,56 @@ export LONGINT *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +export void Files_GetDate (Files_File f, int64 *t, int64 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export LONGINT Files_Length (Files_File f); +export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -136,7 +136,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - INTEGER i, j; + int32 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -161,7 +161,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - LONGINT n, i, j; + int64 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -213,7 +213,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - INTEGER error; + int32 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -250,7 +250,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - INTEGER error; + int32 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -274,7 +274,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - INTEGER error; + int32 error; if (Files_files == f) { Files_files = f->next; } else { @@ -294,8 +294,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - LONGINT i; - INTEGER error; + int64 i; + int32 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -311,9 +311,9 @@ void Files_Close (Files_File f) } } -LONGINT Files_Length (Files_File f) +int64 Files_Length (Files_File f) { - LONGINT _o_result; + int64 _o_result; _o_result = f->len; return _o_result; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -382,7 +382,7 @@ static void Files_ScanPath (INTEGER *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; CHAR ch; i = 0; ch = name[0]; @@ -398,7 +398,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - INTEGER i, error; + int32 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -428,11 +428,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - LONGINT fd; - INTEGER pos; + int64 fd; + int32 pos; BOOLEAN done; CHAR dir[256], path[256]; - INTEGER error; + int32 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -507,9 +507,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - INTEGER i; + int32 i; Platform_FileIdentity identity; - INTEGER error; + int32 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -529,27 +529,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d) +void Files_GetDate (Files_File f, int64 *t, int64 *d) { Platform_FileIdentity identity; - INTEGER error; + int32 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) +void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) { - LONGINT org, offset, i, n; + int64 org, offset, i, n; Files_Buffer buf = NIL; - INTEGER error; + int32 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -609,7 +609,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos) void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) { - LONGINT offset; + int64 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -631,9 +631,9 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -682,7 +682,7 @@ Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - LONGINT offset; + int64 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -700,9 +700,9 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n) +void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { - LONGINT xpos, min, restInBuf, offset; + int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -736,17 +736,17 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res) +void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) { - LONGINT fdold, fdnew, n; - INTEGER error, ignore; + int64 fdold, fdnew, n; + int32 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -801,7 +801,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT void Files_Register (Files_File f) { - INTEGER idx, errcode; + int32 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -820,7 +820,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -829,7 +829,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - LONGINT i, j; + int64 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -848,14 +848,14 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) +void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); @@ -865,7 +865,7 @@ void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) { CHAR b[4]; - LONGINT l; + int64 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; @@ -887,7 +887,7 @@ void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -899,7 +899,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; CHAR ch; BOOLEAN b; i = 0; @@ -915,20 +915,20 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) +void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) { - SHORTINT s; + int8 s; CHAR ch; - LONGINT n; + int64 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); while (ch >= 128) { - n += __ASH((SYSTEM_INT64)(ch - 128), s); + n += __ASH((int64)(ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); *x = n; } @@ -937,7 +937,7 @@ void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) +void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -945,7 +945,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -958,8 +958,8 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x) void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; - LONGINT i; - i = (LONGINT)x; + int64 i; + i = (int64)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -983,7 +983,7 @@ void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) { - INTEGER i; + int32 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -991,7 +991,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x) +void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1008,7 +1008,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - LONGINT res; + int64 res; f = (Files_File)(SYSTEM_ADRINT)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c2853bea..918f272c 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -12,13 +12,13 @@ typedef typedef struct Files_FileDesc { char _prvt0[248]; - LONGINT fd; + int64 fd; char _prvt1[64]; } Files_FileDesc; typedef struct Files_Rider { - LONGINT res; + int64 res; BOOLEAN eof; char _prvt0[31]; } Files_Rider; @@ -29,39 +29,39 @@ import LONGINT *Files_FileDesc__typ; import LONGINT *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INTEGER *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, INTEGER *res); -import void Files_GetDate (Files_File f, LONGINT *t, LONGINT *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); +import void Files_GetDate (Files_File f, int64 *t, int64 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import LONGINT Files_Length (Files_File f); +import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import LONGINT Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x); +import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INTEGER *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); +import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, LONGINT n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x); +import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5822f690..e96f7807 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - LONGINT obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -50,25 +50,25 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - LONGINT refcnt; + int64 refcnt; Heap_Cmd cmds; - LONGINT types; + int64 types; Heap_EnumProc enumPtrs; - LONGINT reserved1, reserved2; + int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static LONGINT Heap_freeList[10]; -static LONGINT Heap_bigBlocks; -export LONGINT Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static LONGINT Heap_heap, Heap_heapend; -export LONGINT Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; -static INTEGER Heap_lockdepth; +static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export INTEGER Heap_FileCount; +export int32 Heap_FileCount; export LONGINT *Heap_ModuleDesc__typ; export LONGINT *Heap_CmdDesc__typ; @@ -76,27 +76,27 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (LONGINT blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (LONGINT q); -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (LONGINT size); -export SYSTEM_PTR Heap_NEWREC (LONGINT tag); -static LONGINT Heap_NewChunk (LONGINT blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, LONGINT typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, LONGINT typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, LONGINT); + __PUT(typ, m->types, int64); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static LONGINT Heap_NewChunk (LONGINT blksz) +static int64 Heap_NewChunk (int64 blksz) { - LONGINT _o_result; - LONGINT chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), LONGINT); - __PUT(chnk + 24, chnk + 32, LONGINT); - __PUT(chnk + 32, blksz, LONGINT); - __PUT(chnk + 40, -8, LONGINT); - __PUT(chnk + 48, Heap_bigBlocks, LONGINT); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static LONGINT Heap_NewChunk (LONGINT blksz) return _o_result; } -static void Heap_ExtendHeap (LONGINT blksz) +static void Heap_ExtendHeap (int64 blksz) { - LONGINT size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (LONGINT blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, LONGINT); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (LONGINT blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, LONGINT); - __PUT(j, chnk, LONGINT); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (LONGINT blksz) } } -SYSTEM_PTR Heap_NEWREC (LONGINT tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - LONGINT i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, LONGINT); - __PUT(end + 16, -8, LONGINT); - __PUT(end, end + 8, LONGINT); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, LONGINT); + __PUT(adr + 8, restsize, int64); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, LONGINT); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, LONGINT); - __PUT(adr + 24, Heap_freeList[di], LONGINT); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, LONGINT); - __PUT(i + 8, 0, LONGINT); - __PUT(i + 16, 0, LONGINT); - __PUT(i + 24, 0, LONGINT); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, LONGINT); - __PUT(adr, tag, LONGINT); - __PUT(adr + 8, 0, LONGINT); - __PUT(adr + 16, 0, LONGINT); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (LONGINT size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - LONGINT blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; - __PUT(tag - 8, 0, LONGINT); - __PUT(tag, blksz, LONGINT); - __PUT(tag + 8, -8, LONGINT); - __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); + tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (LONGINT q) +static void Heap_Mark (int64 q) { - LONGINT p, tag, fld, n, offset, tagbits; + int64 p, tag, fld, n, offset, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, LONGINT); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, LONGINT); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (LONGINT q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, LONGINT); + __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (LONGINT q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, LONGINT); - __PUT(q - 8, tag + 1, LONGINT); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; @@ -385,12 +385,12 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) { - LONGINT chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, LONGINT); + __PUT(adr, tag, int64); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, LONGINT); - __PUT(start + 8, freesize, LONGINT); - __PUT(start + 16, -8, LONGINT); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], LONGINT); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, LONGINT); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - LONGINT i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (LONGINT l, LONGINT r, LONGINT *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - LONGINT l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (LONGINT n, LONGINT *a, LONGINT a__len) } } -static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - LONGINT chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (LONGINT n, LONGINT *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - LONGINT tag; + int64 tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - LONGINT inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, LONGINT); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - LONGINT i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - LONGINT cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (LONGINT)(SYSTEM_ADRINT)obj; + f->obj = (int64)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, LONGINT); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5e7c01fb..40c921e4 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -32,8 +32,8 @@ typedef import SYSTEM_PTR Heap_modules; -import LONGINT Heap_allocated, Heap_heapsize; -import INTEGER Heap_FileCount; +import int64 Heap_allocated, Heap_heapsize; +import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (LONGINT size); -import SYSTEM_PTR Heap_NEWREC (LONGINT tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, LONGINT typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 004f1f8b..5f85fd33 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -27,15 +27,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); - LONGINT reserved1, reserved2; + int64 types; + void (*enumPtrs)(void(*)(int64)); + int64 reserved1, reserved2; } Modules_ModuleDesc; -export INTEGER Modules_res; +export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -52,7 +52,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - INTEGER i, j; + int32 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6f5e4cad..d61c2889 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -29,15 +29,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - LONGINT refcnt; + int64 refcnt; Modules_Cmd cmds; - LONGINT types; - void (*enumPtrs)(void(*)(LONGINT)); + int64 types; + void (*enumPtrs)(void(*)(int64)); char _prvt0[16]; } Modules_ModuleDesc; -import INTEGER Modules_res; +import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index eacff2d0..36f97a5d 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -7,13 +7,13 @@ export void (*OPB_typSize)(OPT_Struct); -static INTEGER OPB_exp; -static LONGINT OPB_maxExp; +static int32 OPB_exp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static LONGINT OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static int64 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -21,10 +21,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x); +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y); -export void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -34,17 +34,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (LONGINT i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (SHORTINT op, OPT_Node *x); +export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (LONGINT intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, LONGINT len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -52,17 +52,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -export void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -export void OPB_StaticLink (SHORTINT dlev); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (INTEGER n); -static LONGINT OPB_log (LONGINT x); +static void OPB_err (int32 n); +static int64 OPB_log (int64 x); -static void OPB_err (INTEGER n) +static void OPB_err (int32 n) { OPM_err(n); } @@ -101,7 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return _o_result; } -void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y) +void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -124,9 +124,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static LONGINT OPB_BoolToInt (BOOLEAN b) +static int64 OPB_BoolToInt (BOOLEAN b) { - LONGINT _o_result; + int64 _o_result; if (b) { _o_result = 1; return _o_result; @@ -137,7 +137,7 @@ static LONGINT OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (LONGINT i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; if (i == 0) { @@ -223,8 +223,8 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - INTEGER b; - LONGINT n; + int32 b; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -237,7 +237,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (LONGINT intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -262,7 +262,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, LONGINT len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -294,7 +294,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (SHORTINT class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -336,7 +336,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -461,15 +461,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - INTEGER f; - LONGINT k; + int32 f; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); @@ -488,9 +488,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static LONGINT OPB_log (LONGINT x) +static int64 OPB_log (int64 x) { - LONGINT _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -502,7 +502,7 @@ static LONGINT OPB_log (LONGINT x) return _o_result; } -static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) +static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -526,9 +526,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -540,9 +540,9 @@ static OPT_Node NewOp__29 (SHORTINT op, OPT_Struct typ, OPT_Node z) return _o_result; } -void OPB_MOp (SHORTINT op, OPT_Node *x) +void OPB_MOp (int8 op, OPT_Node *x) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -679,7 +679,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - INTEGER g; + int32 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -763,17 +763,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - INTEGER *f; + int32 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static INTEGER ConstCmp__14 (void); +static int32 ConstCmp__14 (void); -static INTEGER ConstCmp__14 (void) +static int32 ConstCmp__14 (void) { - INTEGER _o_result; - INTEGER res; + int32 _o_result; + int32 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -837,11 +837,11 @@ static INTEGER ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Const xval = NIL, yval = NIL; - LONGINT xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1117,8 +1117,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - INTEGER f, g; - LONGINT k; + int32 f, g; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1169,14 +1169,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - INTEGER *f, *g; + int32 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1219,13 +1219,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return _o_result; } -void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) +void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - INTEGER f, g; + int32 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - LONGINT val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1496,19 +1496,19 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - LONGINT k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (SYSTEM_INT64)OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1531,14 +1531,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - LONGINT k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (SYSTEM_INT64)OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k); } else { OPB_err(202); @@ -1553,7 +1553,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - INTEGER f, g; + int32 f, g; OPT_Struct p = NIL, q = NIL; if (OPM_Verbose) { OPM_LogWLn(); @@ -1696,9 +1696,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) +void OPB_StPar0 (OPT_Node *par0, int32 fctno) { - INTEGER f; + int32 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1913,7 +1913,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { + if (x->typ->size != (int64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1953,7 +1953,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2006,9 +2006,9 @@ static struct StPar1__52 { struct StPar1__52 *lnk; } *StPar1__52_s; -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2020,9 +2020,9 @@ static OPT_Node NewOp__53 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_No return _o_result; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - INTEGER f, L; + int32 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2051,7 +2051,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (SYSTEM_INT32)x->conval->intval; + L = (int32)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2222,7 +2222,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2260,10 +2260,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) { OPT_Node node = NIL; - INTEGER f; + int32 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2305,9 +2305,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) { - INTEGER dim; + int32 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2371,7 +2371,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - INTEGER f; + int32 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2480,7 +2480,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (SHORTINT dlev) +void OPB_StaticLink (int8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2495,7 +2495,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - SHORTINT lev; + int8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2555,7 +2555,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - SHORTINT subcl; + int8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 7b980a10..61a0edcd 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -15,7 +15,7 @@ import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (SHORTINT class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -24,25 +24,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (SHORTINT op, OPT_Node *x); +import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (LONGINT intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, LONGINT len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y); +import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno); -import void OPB_StPar0 (OPT_Node *par0, INTEGER fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n); -import void OPB_StaticLink (SHORTINT dlev); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); +import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ad70616c..8310f854 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -6,27 +6,27 @@ #include "OPT.h" -static INTEGER OPC_indentLevel; +static int32 OPC_indentLevel; static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; -static SHORTINT OPC_hashtab[105]; -static CHAR OPC_keytab[36][9]; +static int8 OPC_hashtab[105]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (LONGINT *adr, LONGINT base); +export void OPC_Align (int64 *adr, int64 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export LONGINT OPC_BaseAlignment (OPT_Struct typ); +export int64 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis); -export void OPC_Case (LONGINT caseVal, INTEGER form); -static void OPC_CharacterLiteral (LONGINT c); -export void OPC_Cmp (INTEGER rel); +static void OPC_CProcDefs (OPT_Object obj, int32 vis); +export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CharacterLiteral (int64 c); +export void OPC_Cmp (int32 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, INTEGER form); +export void OPC_Constant (OPT_Const con, int32 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -43,45 +43,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign); -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis); +static void OPC_GenDynTypes (OPT_Node n, int32 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (LONGINT n); +export void OPC_Halt (int64 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, INTEGER vis); +static void OPC_IdentList (OPT_Object obj, int32 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis); +static void OPC_IncludeImports (OPT_Object obj, int32 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (INTEGER count); +export void OPC_Indent (int32 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (LONGINT n, LONGINT size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); +export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static INTEGER OPC_Length (CHAR *s, LONGINT s__len); -export LONGINT OPC_NofPtrs (OPT_Struct typ); -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int32 OPC_Length (CHAR *s, LONGINT s__len); +export int64 OPC_NofPtrs (OPT_Struct typ); +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis); +static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export LONGINT OPC_SizeAlignment (LONGINT size); +export int64 OPC_SizeAlignment (int64 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +export void OPC_TypeDefs (OPT_Object obj, int32 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -99,14 +99,14 @@ void OPC_Init (void) } } -void OPC_Indent (INTEGER count) +void OPC_Indent (int32 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - INTEGER i; + int32 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -142,10 +142,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) { CHAR ch; - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -161,10 +161,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, LONGINT x) __DEL(s); } -static INTEGER OPC_Length (CHAR *s, LONGINT s__len) +static int32 OPC_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -173,10 +173,10 @@ static INTEGER OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i, h; + int32 _o_result; + int32 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { @@ -189,17 +189,20 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - INTEGER mode, level, h; + int32 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 36)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } + } else if ((mode == 5 && obj->typ->form == 4)) { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -213,7 +216,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((((((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_int8typ->strobj) || obj == OPT_int16typ->strobj) || obj == OPT_int32typ->strobj) || obj == OPT_int64typ->strobj) || obj == OPT_bytetyp->strobj) { + } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -222,7 +225,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - INTEGER pointers; + int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c)) { @@ -258,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - INTEGER form, comp; + int32 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -320,7 +323,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (SYSTEM_INT64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -328,8 +331,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - INTEGER nofdims; - LONGINT off, n, dummy; + int32 nofdims; + int64 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -388,12 +391,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -LONGINT OPC_NofPtrs (OPT_Struct typ) +int64 OPC_NofPtrs (OPT_Struct typ) { - LONGINT _o_result; + int64 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n; + int64 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -431,11 +434,11 @@ LONGINT OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, LONGINT adr, LONGINT *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - LONGINT n, i; + int64 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -511,7 +514,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -611,7 +614,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - LONGINT mno; + int64 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -740,7 +743,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - INTEGER i; + int32 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -753,11 +756,11 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) +static void OPC_CProcDefs (OPT_Object obj, int32 vis) { - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; - INTEGER _for__9; + int32 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { @@ -781,7 +784,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) } } -void OPC_TypeDefs (OPT_Object obj, INTEGER vis) +void OPC_TypeDefs (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -813,7 +816,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - LONGINT nofptrs; + int64 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -828,7 +831,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (SYSTEM_INT64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); OPC_EndStat(); } @@ -850,7 +853,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (LONGINT *adr, LONGINT base) +void OPC_Align (int64 *adr, int64 base) { switch (base) { case 2: @@ -870,11 +873,11 @@ void OPC_Align (LONGINT *adr, LONGINT base) } } -LONGINT OPC_SizeAlignment (LONGINT size) +int64 OPC_SizeAlignment (int64 size) { - LONGINT _o_result; - LONGINT alignment; - if (size < (SYSTEM_INT64)OPM_Alignment) { + int64 _o_result; + int64 alignment; + if (size < (int64)OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -886,10 +889,10 @@ LONGINT OPC_SizeAlignment (LONGINT size) return _o_result; } -LONGINT OPC_BaseAlignment (OPT_Struct typ) +int64 OPC_BaseAlignment (OPT_Struct typ) { - LONGINT _o_result; - LONGINT alignment; + int64 _o_result; + int64 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -903,19 +906,19 @@ LONGINT OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LONGINT *curAlign) +static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) { - LONGINT adr; + int64 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (SYSTEM_INT64)OPM_IntSize) { + if (align == (int64)OPM_IntSize) { OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (SYSTEM_INT64)OPM_LIntSize) { + } else if (align == (int64)OPM_LIntSize) { OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (SYSTEM_INT64)OPM_LRealSize) { + } else if (align == (int64)OPM_LRealSize) { OPM_WriteString((CHAR*)"LONGREAL", 9); } OPC_Str1((CHAR*)" _prvt#", 8, *n); @@ -932,11 +935,11 @@ static void OPC_FillGap (LONGINT gap, LONGINT off, LONGINT align, LONGINT *n, LO } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT *n, LONGINT *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - LONGINT gap, adr, align, fldAlign; + int64 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -980,7 +983,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } if (last) { - adr = typ->size - (SYSTEM_INT64)__ASHR(typ->sysflag, 8); + adr = typ->size - (int64)__ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -992,11 +995,11 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, LONGINT *off, LONGINT * } } -static void OPC_IdentList (OPT_Object obj, INTEGER vis) +static void OPC_IdentList (OPT_Object obj, int32 vis) { OPT_Struct base = NIL; BOOLEAN first; - INTEGER lastvis; + int32 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { @@ -1121,7 +1124,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) } } -static void OPC_ProcPredefs (OPT_Object obj, SHORTINT vis) +static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1151,7 +1154,7 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) +static void OPC_IncludeImports (OPT_Object obj, int32 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); @@ -1162,7 +1165,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) } } -static void OPC_GenDynTypes (OPT_Node n, INTEGER vis) +static void OPC_GenDynTypes (OPT_Node n, int32 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1210,7 +1213,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - INTEGER i; + int32 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1361,7 +1364,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - LONGINT n; + int64 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1522,7 +1525,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - INTEGER dim; + int32 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1751,7 +1754,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - INTEGER comp, level; + int32 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1780,7 +1783,7 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - INTEGER i; + int32 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { if (ap->mnolev != OPM_level) { @@ -1799,7 +1802,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (INTEGER rel) +void OPC_Cmp (int32 rel) { switch (rel) { case 9: @@ -1828,7 +1831,7 @@ void OPC_Cmp (INTEGER rel) } } -static void OPC_CharacterLiteral (LONGINT c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1843,10 +1846,10 @@ static void OPC_CharacterLiteral (LONGINT c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) { - LONGINT i; - INTEGER c; + int64 i; + int32 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; @@ -1871,7 +1874,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) __DEL(s); } -void OPC_Case (LONGINT caseVal, INTEGER form) +void OPC_Case (int64 caseVal, int32 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1909,30 +1912,17 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (LONGINT n) +void OPC_Halt (int64 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (LONGINT n, LONGINT size) +void OPC_IntLiteral (int64 n, int64 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - switch (size) { - case 2: - OPM_WriteString((CHAR*)"((SYSTEM_INT16)(", 17); - break; - case 4: - OPM_WriteString((CHAR*)"((SYSTEM_INT32)(", 17); - break; - case 8: - OPM_WriteString((CHAR*)"((SYSTEM_INT64)(", 17); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.IntLiteral, size = ", 42); - OPM_LogWNum(size, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteInt(__ASHL(size, 3)); + OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); OPM_WriteString((CHAR*)"))", 3); } else { @@ -1940,7 +1930,7 @@ void OPC_IntLiteral (LONGINT n, LONGINT size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1961,11 +1951,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim) } } -void OPC_Constant (OPT_Const con, INTEGER form) +void OPC_Constant (OPT_Const con, int32 form) { - INTEGER i; + int32 i; SET s; - LONGINT hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -2024,7 +2014,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) } static struct InitKeywords__48 { - SHORTINT *n; + int8 *n; struct InitKeywords__48 *lnk; } *InitKeywords__48_s; @@ -2032,18 +2022,18 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - INTEGER h; + int32 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 36)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); *InitKeywords__48_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - SHORTINT n, i; + int8 n, i; struct InitKeywords__48 _s; _s.n = &n; _s.lnk = InitKeywords__48_s; @@ -2054,6 +2044,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__49((CHAR*)"adrint", 7); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2075,16 +2066,25 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"if", 3); Enter__49((CHAR*)"import", 7); Enter__49((CHAR*)"int", 4); + Enter__49((CHAR*)"int16", 6); + Enter__49((CHAR*)"int32", 6); + Enter__49((CHAR*)"int64", 6); + Enter__49((CHAR*)"int8", 5); Enter__49((CHAR*)"long", 5); Enter__49((CHAR*)"register", 9); Enter__49((CHAR*)"return", 7); Enter__49((CHAR*)"short", 6); Enter__49((CHAR*)"signed", 7); Enter__49((CHAR*)"sizeof", 7); + Enter__49((CHAR*)"size_t", 7); Enter__49((CHAR*)"static", 7); Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uint16", 7); + Enter__49((CHAR*)"uint32", 7); + Enter__49((CHAR*)"uint64", 7); + Enter__49((CHAR*)"uint8", 6); Enter__49((CHAR*)"union", 6); Enter__49((CHAR*)"unsigned", 9); Enter__49((CHAR*)"void", 5); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bb250e9a..3c5dedf4 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -10,16 +10,16 @@ -import void OPC_Align (LONGINT *adr, LONGINT base); +import void OPC_Align (int64 *adr, int64 base); import void OPC_Andent (OPT_Struct typ); -import LONGINT OPC_BaseAlignment (OPT_Struct typ); +import int64 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (LONGINT caseVal, INTEGER form); -import void OPC_Cmp (INTEGER rel); +import void OPC_Case (int64 caseVal, int32 form); +import void OPC_Cmp (int32 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, INTEGER form); +import void OPC_Constant (OPT_Const con, int32 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -32,19 +32,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (LONGINT n); +import void OPC_Halt (int64 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (INTEGER count); +import void OPC_Indent (int32 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (LONGINT n, LONGINT size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim); -import LONGINT OPC_NofPtrs (OPT_Struct typ); +import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import int64 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import LONGINT OPC_SizeAlignment (LONGINT size); +import int64 OPC_SizeAlignment (int64 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, INTEGER vis); +import void OPC_TypeDefs (OPT_Object obj, int32 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 228e7978..d4b582de 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -15,23 +15,23 @@ typedef static CHAR OPM_SourceFileName[256]; -export INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export LONGINT OPM_MaxIndex; +export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -export INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int64 OPM_curpos, OPM_errpos, OPM_breakpc; +export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static LONGINT OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static INTEGER OPM_S; +static int32 OPM_S; export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -41,54 +41,54 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (LONGINT *fp, LONGINT val); -export void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -export void OPM_FPrintReal (LONGINT *fp, REAL real); -export void OPM_FPrintSet (LONGINT *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos); +export void OPM_FPrint (int64 *fp, int64 val); +export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +export void OPM_FPrintReal (int64 *fp, REAL real); +export void OPM_FPrintSet (int64 *fp, SET set); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align); +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -static void OPM_LogErrMsg (INTEGER n); +static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (LONGINT i, LONGINT len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (INTEGER n, LONGINT pos); +export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (LONGINT pos); -export LONGINT OPM_SignedMaximum (LONGINT bytecount); -export LONGINT OPM_SignedMinimum (LONGINT bytecount); +static void OPM_ShowLine (int64 pos); +export int64 OPM_SignedMaximum (int64 bytecount); +export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); -export LONGINT OPM_SymRInt (void); +export int64 OPM_SymRInt (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (LONGINT i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (LONGINT i); -export void OPM_WriteInt (LONGINT i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (INTEGER n); -static LONGINT OPM_minusop (LONGINT i); -static LONGINT OPM_power0 (LONGINT i, LONGINT j); +export void OPM_err (int32 n); +static int64 OPM_minusop (int64 i); +static int64 OPM_power0 (int64 i, int64 j); void OPM_LogW (CHAR ch) @@ -103,7 +103,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (LONGINT i, LONGINT len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -115,7 +115,7 @@ void OPM_LogWLn (void) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - INTEGER i; + int32 i; i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { @@ -300,7 +300,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - LONGINT beg, end, time; + int64 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -348,7 +348,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - INTEGER i, j; + int32 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -370,12 +370,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (INTEGER n) +static void OPM_LogErrMsg (int32 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - INTEGER i; + int32 i; CHAR buf[1024]; if (n >= 0) { if (!OPM_notColorOutput) { @@ -400,7 +400,7 @@ static void OPM_LogErrMsg (INTEGER n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -432,12 +432,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (LONGINT pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - INTEGER i; + int32 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -459,7 +459,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos); + i = (int32)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -474,7 +474,7 @@ static void OPM_ShowLine (LONGINT pos) Files_Close(f); } -void OPM_Mark (INTEGER n, LONGINT pos) +void OPM_Mark (int32 n, int64 pos) { if (pos == -1) { pos = 0; @@ -526,49 +526,49 @@ void OPM_Mark (INTEGER n, LONGINT pos) } } -void OPM_err (INTEGER n) +void OPM_err (int32 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (LONGINT *fp, LONGINT val) +void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); } -void OPM_FPrintSet (LONGINT *fp, SET set) +void OPM_FPrintSet (int64 *fp, SET set) { - OPM_FPrint(&*fp, (LONGINT)set); + OPM_FPrint(&*fp, (int64)set); } -void OPM_FPrintReal (LONGINT *fp, REAL real) +void OPM_FPrintReal (int64 *fp, REAL real) { - INTEGER i; - LONGINT l; - __GET((SYSTEM_ADRINT)&real, i, INTEGER); + int32 i; + int64 l; + __GET((SYSTEM_ADRINT)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) +void OPM_FPrintLReal (int64 *fp, LONGREAL lr) { - LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + int64 l, h; + OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) +static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (SYSTEM_INT32)(*S).i; + *size = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (SYSTEM_INT32)(*S).i; + *align = (int32)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -579,17 +579,17 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG __DEL(name); } -static LONGINT OPM_minusop (LONGINT i) +static int64 OPM_minusop (int64 i) { - LONGINT _o_result; + int64 _o_result; _o_result = -i; return _o_result; } -static LONGINT OPM_power0 (LONGINT i, LONGINT j) +static int64 OPM_power0 (int64 i, int64 j) { - LONGINT _o_result; - LONGINT k, p; + int64 _o_result; + int64 k, p; k = 1; p = i; do { @@ -641,19 +641,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -LONGINT OPM_SignedMaximum (LONGINT bytecount) +int64 OPM_SignedMaximum (int64 bytecount) { - LONGINT _o_result; - LONGINT result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); _o_result = result - 1; return _o_result; } -LONGINT OPM_SignedMinimum (LONGINT bytecount) +int64 OPM_SignedMinimum (int64 bytecount) { - LONGINT _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -687,10 +687,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -LONGINT OPM_SymRInt (void) +int64 OPM_SymRInt (void) { - LONGINT _o_result; - LONGINT k; + int64 _o_result; + int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -698,7 +698,7 @@ LONGINT OPM_SymRInt (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (LONGINT*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); } void OPM_SymRReal (REAL *r) @@ -745,14 +745,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (LONGINT i) +void OPM_SymWInt (int64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) @@ -796,7 +796,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -806,7 +806,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -814,17 +814,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (LONGINT i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - INTEGER digit; - digit = __ASHR((SYSTEM_INT32)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((SYSTEM_INT32)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -834,10 +834,10 @@ void OPM_WriteHex (LONGINT i) OPM_WriteString(s, 3); } -void OPM_WriteInt (LONGINT i) +void OPM_WriteInt (int64 i) { CHAR s[20]; - LONGINT i1, k; + int64 i1, k; if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -870,7 +870,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - INTEGER i; + int32 i; if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); @@ -958,7 +958,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - INTEGER res; + int32 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 6bbab25d..ccce7304 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -7,12 +7,12 @@ #include "SYSTEM.h" -import INTEGER OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import LONGINT OPM_MaxIndex; +import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import LONGINT OPM_curpos, OPM_errpos, OPM_breakpc; -import INTEGER OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int64 OPM_curpos, OPM_errpos, OPM_breakpc; +import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -22,44 +22,44 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (LONGINT *fp, LONGINT val); -import void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr); -import void OPM_FPrintReal (LONGINT *fp, REAL real); -import void OPM_FPrintSet (LONGINT *fp, SET set); +import void OPM_FPrint (int64 *fp, int64 val); +import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); +import void OPM_FPrintReal (int64 *fp, REAL real); +import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (LONGINT i, LONGINT len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (INTEGER n, LONGINT pos); +import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import LONGINT OPM_SignedMaximum (LONGINT bytecount); -import LONGINT OPM_SignedMinimum (LONGINT bytecount); +import int64 OPM_SignedMaximum (int64 bytecount); +import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); -import LONGINT OPM_SymRInt (void); +import int64 OPM_SymRInt (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (LONGINT i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (LONGINT i); -import void OPM_WriteInt (LONGINT i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (INTEGER n); +import void OPM_err (int32 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9337c539..78136a18 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -7,17 +7,17 @@ #include "OPT.h" struct OPP__1 { - LONGINT low, high; + int64 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static SHORTINT OPP_sym, OPP_level; -static INTEGER OPP_LoopLevel; +static int8 OPP_sym, OPP_level; +static int32 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static INTEGER OPP_nofFwdPtr; +static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export LONGINT *OPP__1__typ; @@ -25,10 +25,10 @@ export LONGINT *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab); -static void OPP_CheckMark (SHORTINT *vis); -static void OPP_CheckSym (INTEGER s); -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CheckMark (int8 *vis); +static void OPP_CheckSym (int32 s); +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -38,7 +38,7 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); export void OPP_Module (OPT_Node *prog, SET opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -47,17 +47,17 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (INTEGER n); +static void OPP_err (int32 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (INTEGER n) +static void OPP_err (int32 n) { OPM_err(n); } -static void OPP_CheckSym (INTEGER s) +static void OPP_CheckSym (int32 s) { if (OPP_sym == s) { OPS_Get(&OPP_sym); @@ -69,7 +69,7 @@ static void OPP_CheckSym (INTEGER s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - SHORTINT lev; + int8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -109,7 +109,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (SHORTINT *vis) +static void OPP_CheckMark (int8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -127,10 +127,10 @@ static void OPP_CheckMark (SHORTINT *vis) } } -static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) +static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) { OPT_Node x = NIL; - LONGINT sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = (SYSTEM_INT32)sf; + *sysflag = (int32)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -158,7 +158,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - INTEGER sysflag; + int32 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -250,8 +250,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - LONGINT n; - INTEGER sysflag; + int64 n; + int32 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -343,7 +343,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - SHORTINT mode; + int8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -624,9 +624,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT m; - INTEGER n; - m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); + int8 m; + int32 n; + m = (int8)((int32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -785,7 +785,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT mulop; + int8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -798,7 +798,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - SHORTINT addop; + int8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -822,7 +822,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - SHORTINT relation; + int8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -848,7 +848,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -914,7 +914,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - SHORTINT *mode, *vis; + int8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -927,8 +927,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - INTEGER n; - LONGINT c; + int32 n; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -992,7 +992,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); OPP_CheckSym(39); @@ -1015,7 +1015,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - SHORTINT objMode; + int8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1087,7 +1087,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - SHORTINT mode, vis; + int8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1164,11 +1164,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - INTEGER i, f; - LONGINT xval, yval; + int32 i, f; + int64 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1235,7 +1235,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O } static struct StatSeq__30 { - LONGINT *pos; + int64 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1245,8 +1245,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - INTEGER n; - LONGINT low, high; + int32 n; + int64 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1329,7 +1329,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - LONGINT pos; + int64 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1622,7 +1622,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - INTEGER i; + int32 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1775,7 +1775,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - LONGINT c; + int64 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e575dfe6..efd39a62 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -12,29 +12,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export INTEGER OPS_numtyp; -export LONGINT OPS_intval; +export int32 OPS_numtyp; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (SHORTINT *sym); -static void OPS_Identifier (SHORTINT *sym); +export void OPS_Get (int8 *sym); +static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (SHORTINT *sym); -static void OPS_err (INTEGER n); +static void OPS_Str (int8 *sym); +static void OPS_err (int32 n); -static void OPS_err (INTEGER n) +static void OPS_err (int32 n) { OPM_err(n); } -static void OPS_Str (SHORTINT *sym) +static void OPS_Str (int8 *sym) { - INTEGER i; + int32 i; CHAR och; i = 0; och = OPS_ch; @@ -66,9 +66,9 @@ static void OPS_Str (SHORTINT *sym) } } -static void OPS_Identifier (SHORTINT *sym) +static void OPS_Identifier (int8 *sym) { - INTEGER i; + int32 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -87,10 +87,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (INTEGER e); +static int32 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int32 e); -static LONGREAL Ten__9 (INTEGER e) +static LONGREAL Ten__9 (int32 e) { LONGREAL _o_result; LONGREAL x, p; @@ -109,9 +109,9 @@ static LONGREAL Ten__9 (INTEGER e) return _o_result; } -static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) +static int32 Ord__7 (CHAR ch, BOOLEAN hex) { - INTEGER _o_result; + int32 _o_result; if (ch <= '9') { _o_result = ch - 48; return _o_result; @@ -128,7 +128,7 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - INTEGER i, m, n, d, e, maxHdig; + int32 i, m, n, d, e, maxHdig; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -174,7 +174,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -189,7 +189,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (SYSTEM_INT64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -200,8 +200,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (SYSTEM_INT64)d, 10)) { - OPS_intval = OPS_intval * 10 + (SYSTEM_INT64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } @@ -310,9 +310,9 @@ static void Comment__2 (void) } } -void OPS_Get (SHORTINT *sym) +void OPS_Get (int8 *sym) { - SHORTINT s; + int8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a60ffe74..c497e5c6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -15,13 +15,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import INTEGER OPS_numtyp; -import LONGINT OPS_intval; +import int32 OPS_numtyp; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (SHORTINT *sym); +import void OPS_Get (int8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 35088301..287c2ba6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -13,17 +13,17 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - LONGINT reffp; - INTEGER ref; - SHORTINT nofm; - SHORTINT locmno[64]; + int64 reffp; + int32 ref; + int8 nofm; + int8 locmno[64]; } OPT_ExpCtxt; typedef @@ -34,13 +34,13 @@ typedef typedef struct OPT_ImpCtxt { - LONGINT nextTag, reffp; - INTEGER nofr, minr, nofm; + int64 nextTag, reffp; + int32 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - LONGINT pvfp[255]; - SHORTINT glbmno[64]; + int64 pvfp[255]; + int8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -49,7 +49,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -61,22 +61,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - LONGINT idfp, pbfp, pvfp; + int64 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -85,7 +85,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export SHORTINT OPT_nofGmod; +export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; @@ -93,7 +93,7 @@ static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static LONGINT OPT_nofhdfld; +static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export LONGINT *OPT_ConstDesc__typ; @@ -106,62 +106,62 @@ export LONGINT *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value); -static void OPT_EnterProc (OPS_Name name, INTEGER num); -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int64 value); +static void OPT_EnterProc (OPS_Name name, int32 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int32 errcode); +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (LONGINT f, OPT_Const conval); +static void OPT_InConstant (int64 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (SHORTINT *mno); +static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (SHORTINT mno); -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (int8 mno); +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (SHORTINT mno); -static OPT_Struct OPT_InTyp (LONGINT tag); +static OPT_Object OPT_InTProc (int8 mno); +static OPT_Struct OPT_InTyp (int64 tag); export void OPT_Init (OPS_Name name, SET opt); -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form); +static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export OPT_Struct OPT_IntType (LONGINT size); +export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (SHORTINT class); +export OPT_Node OPT_NewNode (int8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -export void OPT_OpenScope (SHORTINT level, OPT_Object owner); +export OPT_Struct OPT_NewStr (int8 form, int8 comp); +export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr); -static void OPT_OutMod (INTEGER mno); +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); +static void OPT_OutMod (int32 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); -static void OPT_err (INTEGER n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +static void OPT_err (int32 n); -static void OPT_err (INTEGER n) +static void OPT_err (int32 n) { OPM_err(n); } -OPT_Struct OPT_IntType (LONGINT size) +OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - INTEGER i; + int32 i; i = 1; while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { i += 1; @@ -170,10 +170,10 @@ OPT_Struct OPT_IntType (LONGINT size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) { OPT_Struct _o_result; - INTEGER i; + int32 i; __ASSERT(x->form == 4, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); @@ -204,7 +204,7 @@ OPT_Object OPT_NewObj (void) return _o_result; } -OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) +OPT_Struct OPT_NewStr (int8 form, int8 comp) { OPT_Struct _o_result; OPT_Struct typ = NIL; @@ -221,7 +221,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp) return _o_result; } -OPT_Node OPT_NewNode (SHORTINT class) +OPT_Node OPT_NewNode (int8 class) { OPT_Node _o_result; OPT_Node node = NIL; @@ -235,12 +235,12 @@ OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); _o_result = ext; return _o_result; } -void OPT_OpenScope (SHORTINT level, OPT_Object owner) +void OPT_OpenScope (int8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -278,7 +278,7 @@ void OPT_Init (OPS_Name name, SET opt) void OPT_Close (void) { - INTEGER i; + int32 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -370,7 +370,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - SHORTINT mnolev; + int8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -408,9 +408,9 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -453,7 +453,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -469,8 +469,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - LONGINT idfp; - INTEGER f, c; + int64 idfp; + int32 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -499,17 +499,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__12 { - LONGINT *pbfp, *pvfp; + int64 *pbfp, *pvfp; struct FPrintStr__12 *lnk; } *FPrintStr__12_s; -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr); +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); static void FPrintTProcs__17 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__13(typ->link, adr, 0); @@ -539,7 +539,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -574,10 +574,10 @@ static void FPrintTProcs__17 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - INTEGER f, c; + int32 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - LONGINT pbfp, pvfp; + int64 pbfp, pvfp; struct FPrintStr__12 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -638,8 +638,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - LONGINT fprint; - INTEGER f, m; + int64 fprint; + int32 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -696,9 +696,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, INTEGER errcode) +void OPT_FPrintErr (OPT_Object obj, int32 errcode) { - INTEGER i, j; + int32 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -788,7 +788,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -798,12 +798,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (SHORTINT *mno) +static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - LONGINT mn; - SHORTINT i; + int64 mn; + int8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -840,10 +840,10 @@ static void OPT_InMod (SHORTINT *mno) } } -static void OPT_InConstant (LONGINT f, OPT_Const conval) +static void OPT_InConstant (int64 f, OPT_Const conval) { CHAR ch; - INTEGER i; + int32 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { @@ -889,10 +889,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) } } -static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - LONGINT tag; + int64 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -920,7 +920,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -949,10 +949,10 @@ static OPT_Object OPT_InFld (void) return _o_result; } -static OPT_Object OPT_InTProc (SHORTINT mno) +static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - LONGINT tag; + int64 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -977,7 +977,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) return _o_result; } -static OPT_Struct OPT_InTyp (LONGINT tag) +static OPT_Struct OPT_InTyp (int64 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -992,9 +992,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag) static void OPT_InStruct (OPT_Struct *typ) { - SHORTINT mno; - INTEGER ref; - LONGINT tag; + int8 mno; + int32 ref; + int64 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt(); + (*typ)->sysflag = (int32)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1172,14 +1172,14 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (SHORTINT mno) +static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - INTEGER i, s; + int32 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - LONGINT tag; + int64 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1212,7 +1212,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (SYSTEM_INT32)OPM_SymRInt(); + s = (int32)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1278,7 +1278,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - SHORTINT mno; + int8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1321,7 +1321,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - INTEGER i; + int32 i; CHAR ch; i = 0; do { @@ -1331,7 +1331,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (INTEGER mno) +static void OPT_OutMod (int32 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1343,9 +1343,9 @@ static void OPT_OutMod (INTEGER mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) { - LONGINT i, j, n; + int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1375,7 +1375,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr) } } -static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1530,7 +1530,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - INTEGER f; + int32 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1565,7 +1565,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - INTEGER i, j; + int32 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1655,8 +1655,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - INTEGER i; - SHORTINT nofmod; + int32 i; + int8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1698,7 +1698,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) +static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1712,7 +1712,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) +static void OPT_EnterBoolConst (OPS_Name name, int64 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1724,7 +1724,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1747,7 +1747,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res = typ; } -static void OPT_EnterProc (OPS_Name name, INTEGER num) +static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index c3fdc0cf..808e8043 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -16,7 +16,7 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - LONGINT intval, intval2; + int64 intval, intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - SHORTINT class, subcl; + int8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - SHORTINT mode, mnolev, vis, history; + int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - LONGINT fprint; + int64 fprint; OPT_Struct typ; OPT_Const conval; - LONGINT adr, linkadr; - INTEGER x; + int64 adr, linkadr; + int32 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - SHORTINT form, comp, mno, extlev; - INTEGER ref, sysflag; - LONGINT n, size, align, txtpos; + int8 form, comp, mno, extlev; + int32 ref, sysflag; + int64 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[24]; OPT_Struct BaseTyp; @@ -69,7 +69,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import SHORTINT OPT_nofGmod; +import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; @@ -82,7 +82,7 @@ import LONGINT *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, INTEGER errcode); +import void OPT_FPrintErr (OPT_Object obj, int32 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,14 +93,14 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import OPT_Struct OPT_IntType (LONGINT size); +import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (SHORTINT class); +import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp); -import void OPT_OpenScope (SHORTINT level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir); +import OPT_Struct OPT_NewStr (int8 form, int8 comp); +import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c769935e..5b1ffe19 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -8,15 +8,15 @@ typedef struct OPV_ExitInfo { - INTEGER level, label; + int32 level, label; } OPV_ExitInfo; static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; -static INTEGER OPV_stamp; -static LONGINT OPV_recno; +static int32 OPV_stamp; +static int64 OPV_recno; static OPV_ExitInfo OPV_exit; -static INTEGER OPV_nofExitLabels; +static int32 OPV_nofExitLabels; static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -24,38 +24,38 @@ export LONGINT *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, INTEGER prec); +static void OPV_Entier (OPT_Node n, int32 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, LONGINT dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max); +static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (LONGINT n, LONGINT size); -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp); +static void OPV_ParIntLiteral (int64 n, int64 size); +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (LONGINT from, LONGINT to); +static void OPV_SizeCast (int64 from, int64 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, INTEGER prec); -static void OPV_expr (OPT_Node n, INTEGER prec); +static void OPV_design (OPT_Node n, int32 prec); +static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) +static int64 OPV_NaturalAlignment (int64 size, int64 max) { - LONGINT _o_result; - LONGINT i; + int64 _o_result; + int64 i; if (size >= max) { _o_result = max; return _o_result; @@ -72,8 +72,8 @@ static LONGINT OPV_NaturalAlignment (LONGINT size, LONGINT max) void OPV_TypSize (OPT_Struct typ) { - INTEGER f, c; - LONGINT offset, size, base, fbase, off0; + int32 f, c; + int64 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -88,7 +88,7 @@ void OPV_TypSize (OPT_Struct typ) base = OPC_SizeAlignment(OPM_RecSize); } else { OPV_TypSize(btyp); - offset = btyp->size - (SYSTEM_INT64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -119,7 +119,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -157,7 +157,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - LONGINT oldPos; + int64 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -193,7 +193,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - INTEGER i, j, k; + int32 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -223,7 +223,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - INTEGER mode; + int32 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -298,9 +298,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, INTEGER comp) +static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) { - INTEGER _o_result; + int32 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -433,7 +433,7 @@ static INTEGER OPV_Precedence (INTEGER class, INTEGER subclass, INTEGER form, IN __RETCHK; } -static void OPV_Len (OPT_Node n, LONGINT dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -462,7 +462,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, INTEGER prec) +static void OPV_Entier (OPT_Node n, int32 prec) { if (__IN(n->typ->form, 0x60)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -473,34 +473,18 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) } } -static void OPV_SizeCast (LONGINT from, LONGINT to) +static void OPV_SizeCast (int64 from, int64 to) { if ((from != to && (from > 4 || to != 4))) { - switch (to) { - case 1: - OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); - break; - case 2: - OPM_WriteString((CHAR*)"(SYSTEM_INT16)", 15); - break; - case 4: - OPM_WriteString((CHAR*)"(SYSTEM_INT32)", 15); - break; - case 8: - OPM_WriteString((CHAR*)"(SYSTEM_INT64)", 15); - break; - default: - OPM_LogWStr((CHAR*)"Unhandled case in OPC.SizeCast, to = ", 38); - OPM_LogWNum(to, 1); - OPM_LogWLn(); - break; - } + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) { - INTEGER from, to; + int32 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -562,7 +546,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -579,13 +563,13 @@ static void OPV_Index (OPT_Node n, OPT_Node d, INTEGER prec, INTEGER dim) } } -static void OPV_design (OPT_Node n, INTEGER prec) +static void OPV_design (OPT_Node n, int32 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - INTEGER class, designPrec, comp; + int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - INTEGER dims, i, _for__28; + int32 dims, i, _for__28; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -669,7 +653,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((SYSTEM_INT64)i < __ASHR(d->typ->size - 4, 2)) { + while ((int64)i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -758,7 +742,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) } } -static void OPV_ParIntLiteral (LONGINT n, LONGINT size) +static void OPV_ParIntLiteral (int64 n, int64 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -770,7 +754,7 @@ static void OPV_ParIntLiteral (LONGINT n, LONGINT size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - INTEGER comp, form, mode, prec, dim; + int32 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -869,9 +853,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, INTEGER prec) +static void OPV_expr (OPT_Node n, int32 prec) { - INTEGER class, subclass, form, exprPrec; + int32 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1187,7 +1171,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - LONGINT adr; + int64 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1237,8 +1221,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - LONGINT low, high; - INTEGER form, i; + int64 low, high; + int32 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1305,7 +1289,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - INTEGER nofdim, nofdyn; + int32 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3f699c1c..2724553b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -9,90 +9,90 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - LONGINT (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - LONGINT volume, indexhigh, indexlow, mtimehigh, mtimelow; + int64 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; -export LONGINT Platform_MainStackFrame, Platform_HaltCode; -export INTEGER Platform_PID; +export int64 Platform_MainStackFrame, Platform_HaltCode; +export int32 Platform_PID; export CHAR Platform_CWD[4096]; -export INTEGER Platform_ArgCount; -export LONGINT Platform_ArgVector; +export int32 Platform_ArgCount; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static LONGINT Platform_TimeStart; -export INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int64 Platform_TimeStart; +export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export LONGINT *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (INTEGER e); -export INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (LONGINT code); -export INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -export INTEGER Platform_Close (LONGINT h); -export BOOLEAN Platform_ConnectionFailed (INTEGER e); -export void Platform_Delay (LONGINT ms); -export BOOLEAN Platform_DifferentFilesystems (INTEGER e); -static void Platform_DisplayHaltCode (LONGINT code); -export INTEGER Platform_Error (void); -export void Platform_Exit (INTEGER code); -export void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (LONGINT *t, LONGINT *d); +export BOOLEAN Platform_Absent (int32 e); +export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int64 code); +export int32 Platform_Chdir (CHAR *n, LONGINT n__len); +export int32 Platform_Close (int64 h); +export BOOLEAN Platform_ConnectionFailed (int32 e); +export void Platform_Delay (int64 ms); +export BOOLEAN Platform_DifferentFilesystems (int32 e); +static void Platform_DisplayHaltCode (int64 code); +export int32 Platform_Error (void); +export void Platform_Exit (int32 code); +export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int64 *t, int64 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (INTEGER n, LONGINT *val); -export void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -export void Platform_Halt (LONGINT code); -export INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -export BOOLEAN Platform_Inaccessible (INTEGER e); -export void Platform_Init (INTEGER argc, LONGINT argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -export INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -export BOOLEAN Platform_NoSuchDirectory (INTEGER e); -export LONGINT Platform_OSAllocate (LONGINT size); -export void Platform_OSFree (LONGINT address); -export INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -export INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -export INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -export INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (int32 n, int64 *val); +export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +export void Platform_Halt (int64 code); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export BOOLEAN Platform_Inaccessible (int32 e); +export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +export BOOLEAN Platform_NoSuchDirectory (int32 e); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); +export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +export int32 Platform_Seek (int64 h, int64 o, int32 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -export INTEGER Platform_Size (LONGINT h, LONGINT *l); -export INTEGER Platform_Sync (LONGINT h); -export INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); +export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Sync (int64 h); +export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export LONGINT Platform_Time (void); -export BOOLEAN Platform_TimedOut (INTEGER e); -export BOOLEAN Platform_TooManyFiles (INTEGER e); -export INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -export INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -export INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d); +export int64 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int32 e); +export BOOLEAN Platform_TooManyFiles (int32 e); +export int32 Platform_Truncate (int64 h, int64 limit); +export int32 Platform_Unlink (CHAR *n, LONGINT n__len); +export int32 Platform_Write (int64 h, int64 p, int64 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); -static void Platform_errint (LONGINT l); +static void Platform_errint (int64 l); static void Platform_errln (void); -static void Platform_errposint (LONGINT l); +static void Platform_errposint (int64 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -176,68 +176,68 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (INTEGER e) +BOOLEAN Platform_TooManyFiles (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (INTEGER e) +BOOLEAN Platform_NoSuchDirectory (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (INTEGER e) +BOOLEAN Platform_DifferentFilesystems (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (INTEGER e) +BOOLEAN Platform_Inaccessible (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (INTEGER e) +BOOLEAN Platform_Absent (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (INTEGER e) +BOOLEAN Platform_TimedOut (int32 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (INTEGER e) +BOOLEAN Platform_ConnectionFailed (int32 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); return _o_result; } -LONGINT Platform_OSAllocate (LONGINT size) +int64 Platform_OSAllocate (int64 size) { - LONGINT _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (LONGINT address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (INTEGER argc, LONGINT argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -252,7 +252,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - INTEGER res; + int32 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -277,7 +277,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -286,10 +286,10 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (INTEGER n, LONGINT *val) +void Platform_GetIntArg (int32 n, int64 *val) { CHAR s[64]; - LONGINT k, d, i; + int64 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -312,10 +312,10 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) } } -INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len) +int32 Platform_ArgPos (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -333,28 +333,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (INTEGER ye, INTEGER mo, INTEGER da, INTEGER ho, INTEGER mi, INTEGER se, LONGINT *t, LONGINT *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d) { - *d = (__ASHL((SYSTEM_INT64)(int)__MOD(ye, 100), 9) + __ASHL((SYSTEM_INT64)(mo + 1), 5)) + (SYSTEM_INT64)da; - *t = (__ASHL((SYSTEM_INT64)ho, 12) + __ASHL((SYSTEM_INT64)mi, 6)) + (SYSTEM_INT64)se; + *d = (__ASHL((int64)(int)__MOD(ye, 100), 9) + __ASHL((int64)(mo + 1), 5)) + (int64)da; + *t = (__ASHL((int64)ho, 12) + __ASHL((int64)mi, 6)) + (int64)se; } -void Platform_GetClock (LONGINT *t, LONGINT *d) +void Platform_GetClock (int64 *t, int64 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -LONGINT Platform_Time (void) +int64 Platform_Time (void) { - LONGINT _o_result; - LONGINT ms; + int64 _o_result; + int64 ms; ms = Platform_GetTickCount(); _o_result = __MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (LONGINT ms) +void Platform_Delay (int64 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -365,7 +365,7 @@ void Platform_Delay (LONGINT ms) } } -void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) +void Platform_GetTimeOfDay (int64 *sec, int64 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -375,10 +375,10 @@ void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec) *usec = Platform_uluSec(); } -INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) +int32 Platform_System (CHAR *cmd, LONGINT cmd__len) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -394,17 +394,17 @@ INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -INTEGER Platform_Error (void) +int32 Platform_Error (void) { - INTEGER _o_result; + int32 _o_result; _o_result = Platform_err(); return _o_result; } -INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -417,10 +417,10 @@ INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -433,10 +433,10 @@ INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) +int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) { - INTEGER _o_result; - LONGINT fd; + int32 _o_result; + int64 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -449,9 +449,9 @@ INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h) __RETCHK; } -INTEGER Platform_Close (LONGINT h) +int32 Platform_Close (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -462,9 +462,9 @@ INTEGER Platform_Close (LONGINT h) __RETCHK; } -INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; + int32 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -479,11 +479,11 @@ INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT * return _o_result; } -INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) { - INTEGER _o_result; - LONGINT h; - INTEGER e, i; + int32 _o_result; + int64 h; + int32 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -518,16 +518,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INTEGER Platform_Size (LONGINT h, LONGINT *l) +int32 Platform_Size (int64 h, int64 *l) { - INTEGER _o_result; + int32 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -538,10 +538,10 @@ INTEGER Platform_Size (LONGINT h, LONGINT *l) return _o_result; } -INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) +int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; *n = 0; result = Platform_readfile(h, p, l, &*n); if (result == 0) { @@ -555,10 +555,10 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n) __RETCHK; } -INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { - INTEGER _o_result; - INTEGER result; + int32 _o_result; + int32 result; *n = 0; result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); if (result == 0) { @@ -572,9 +572,9 @@ INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n) __RETCHK; } -INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) +int32 Platform_Write (int64 h, int64 p, int64 l) { - INTEGER _o_result; + int32 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -585,9 +585,9 @@ INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l) __RETCHK; } -INTEGER Platform_Sync (LONGINT h) +int32 Platform_Sync (int64 h) { - INTEGER _o_result; + int32 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -598,10 +598,10 @@ INTEGER Platform_Sync (LONGINT h) __RETCHK; } -INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) +int32 Platform_Seek (int64 h, int64 o, int32 r) { - INTEGER _o_result; - INTEGER rc; + int32 _o_result; + int32 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -614,11 +614,11 @@ INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r) __RETCHK; } -INTEGER Platform_Truncate (LONGINT h, LONGINT limit) +int32 Platform_Truncate (int64 h, int64 limit) { - INTEGER _o_result; - INTEGER rc; - LONGINT oldpos; + int32 _o_result; + int32 rc; + int64 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -643,9 +643,9 @@ INTEGER Platform_Truncate (LONGINT h, LONGINT limit) return _o_result; } -INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) +int32 Platform_Unlink (CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -656,10 +656,10 @@ INTEGER Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) +int32 Platform_Chdir (CHAR *n, LONGINT n__len) { - INTEGER _o_result; - INTEGER r; + int32 _o_result; + int32 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -670,9 +670,9 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - INTEGER _o_result; + int32 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -683,7 +683,7 @@ INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INTEGER code) +void Platform_Exit (int32 code) { Platform_exit(code); } @@ -699,7 +699,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (LONGINT l) +static void Platform_errposint (int64 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -707,7 +707,7 @@ static void Platform_errposint (LONGINT l) Platform_errch((CHAR)(48 + __MOD(l, 10))); } -static void Platform_errint (LONGINT l) +static void Platform_errint (int64 l) { if (l < 0) { Platform_errch('-'); @@ -716,7 +716,7 @@ static void Platform_errint (LONGINT l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (LONGINT code) +static void Platform_DisplayHaltCode (int64 code) { switch (code) { case -1: @@ -757,9 +757,9 @@ static void Platform_DisplayHaltCode (LONGINT code) } } -void Platform_Halt (LONGINT code) +void Platform_Halt (int64 code) { - INTEGER e; + int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -771,12 +771,12 @@ void Platform_Halt (LONGINT code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } -void Platform_AssertFail (LONGINT code) +void Platform_AssertFail (int64 code) { - INTEGER e; + int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); @@ -784,7 +784,7 @@ void Platform_AssertFail (LONGINT code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(INTEGER, code)); + Platform_exit(__VAL(int32, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -794,7 +794,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - INTEGER i; + int32 i; i = 1; __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index cff07fba..13f60995 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -13,69 +13,69 @@ typedef } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(LONGINT); + void (*Platform_HaltProcedure)(int64); typedef - void (*Platform_SignalHandler)(INTEGER); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; -import LONGINT Platform_MainStackFrame, Platform_HaltCode; -import INTEGER Platform_PID; +import int64 Platform_MainStackFrame, Platform_HaltCode; +import int32 Platform_PID; import CHAR Platform_CWD[4096]; -import INTEGER Platform_ArgCount; -import LONGINT Platform_ArgVector; -import INTEGER Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import LONGINT Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int32 Platform_ArgCount; +import int64 Platform_ArgVector; +import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import LONGINT *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (INTEGER e); -import INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (LONGINT code); -import INTEGER Platform_Chdir (CHAR *n, LONGINT n__len); -import INTEGER Platform_Close (LONGINT h); -import BOOLEAN Platform_ConnectionFailed (INTEGER e); -import void Platform_Delay (LONGINT ms); -import BOOLEAN Platform_DifferentFilesystems (INTEGER e); -import INTEGER Platform_Error (void); -import void Platform_Exit (INTEGER code); -import void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (LONGINT *t, LONGINT *d); +import BOOLEAN Platform_Absent (int32 e); +import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int64 code); +import int32 Platform_Chdir (CHAR *n, LONGINT n__len); +import int32 Platform_Close (int64 h); +import BOOLEAN Platform_ConnectionFailed (int32 e); +import void Platform_Delay (int64 ms); +import BOOLEAN Platform_DifferentFilesystems (int32 e); +import int32 Platform_Error (void); +import void Platform_Exit (int32 code); +import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int64 *t, int64 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (INTEGER n, LONGINT *val); -import void Platform_GetTimeOfDay (LONGINT *sec, LONGINT *usec); -import void Platform_Halt (LONGINT code); -import INTEGER Platform_Identify (LONGINT h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import INTEGER Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); -import BOOLEAN Platform_Inaccessible (INTEGER e); -import void Platform_Init (INTEGER argc, LONGINT argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, LONGINT *t, LONGINT *d); -import INTEGER Platform_New (CHAR *n, LONGINT n__len, LONGINT *h); -import BOOLEAN Platform_NoSuchDirectory (INTEGER e); -import LONGINT Platform_OSAllocate (LONGINT size); -import void Platform_OSFree (LONGINT address); -import INTEGER Platform_OldRO (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_OldRW (CHAR *n, LONGINT n__len, LONGINT *h); -import INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n); -import INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n); -import INTEGER Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (int32 n, int64 *val); +import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); +import void Platform_Halt (int64 code); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import BOOLEAN Platform_Inaccessible (int32 e); +import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); +import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); +import BOOLEAN Platform_NoSuchDirectory (int32 e); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); +import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); +import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INTEGER Platform_Seek (LONGINT h, LONGINT o, INTEGER r); +import int32 Platform_Seek (int64 h, int64 o, int32 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); -import INTEGER Platform_Size (LONGINT h, LONGINT *l); -import INTEGER Platform_Sync (LONGINT h); -import INTEGER Platform_System (CHAR *cmd, LONGINT cmd__len); -import LONGINT Platform_Time (void); -import BOOLEAN Platform_TimedOut (INTEGER e); -import BOOLEAN Platform_TooManyFiles (INTEGER e); -import INTEGER Platform_Truncate (LONGINT h, LONGINT limit); -import INTEGER Platform_Unlink (CHAR *n, LONGINT n__len); -import INTEGER Platform_Write (LONGINT h, LONGINT p, LONGINT l); +import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Sync (int64 h); +import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int64 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int32 e); +import BOOLEAN Platform_TooManyFiles (int32 e); +import int32 Platform_Truncate (int64 h, int64 limit); +import int32 Platform_Unlink (CHAR *n, LONGINT n__len); +import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 98719812..5877bedc 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -6,19 +6,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -export INTEGER Reals_Expo (REAL x); -export INTEGER Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, INTEGER ex); -export REAL Reals_Ten (INTEGER e); -export LONGREAL Reals_TenL (INTEGER e); -static CHAR Reals_ToHex (INTEGER i); +export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +export int32 Reals_Expo (REAL x); +export int32 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int32 ex); +export REAL Reals_Ten (int32 e); +export LONGREAL Reals_TenL (int32 e); +static CHAR Reals_ToHex (int32 i); -REAL Reals_Ten (INTEGER e) +REAL Reals_Ten (int32 e) { REAL _o_result; LONGREAL r, power; @@ -35,7 +35,7 @@ REAL Reals_Ten (INTEGER e) return _o_result; } -LONGREAL Reals_TenL (INTEGER e) +LONGREAL Reals_TenL (int32 e) { LONGREAL _o_result; LONGREAL r, power; @@ -55,16 +55,16 @@ LONGREAL Reals_TenL (INTEGER e) __RETCHK; } -INTEGER Reals_Expo (REAL x) +int32 Reals_Expo (REAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 2, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, INTEGER ex) +void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); @@ -73,36 +73,36 @@ void Reals_SetExpo (REAL *x, INTEGER ex) __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -INTEGER Reals_ExpoL (LONGREAL x) +int32 Reals_ExpoL (LONGREAL x) { - INTEGER _o_result; - INTEGER i; - __GET((SYSTEM_ADRINT)&x + 6, i, INTEGER); + int32 _o_result; + int32 i; + __GET((SYSTEM_ADRINT)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) { - LONGINT i, j, k; + int64 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; i = __ENTIER(x); - while (k < (SYSTEM_INT64)n) { + while (k < (int64)n) { d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (INTEGER i) +static CHAR Reals_ToHex (int32 i) { CHAR _o_result; if (i < 10) { @@ -117,12 +117,12 @@ static CHAR Reals_ToHex (INTEGER i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - INTEGER i; - LONGINT l; + int32 i; + int64 l; CHAR by; i = 0; l = b__len; - while ((SYSTEM_INT64)i < l) { + while ((int64)i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 87c9aa45..cf944612 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -9,15 +9,15 @@ -import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); -import INTEGER Reals_Expo (REAL x); -import INTEGER Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, INTEGER ex); -import REAL Reals_Ten (INTEGER e); -import LONGREAL Reals_TenL (INTEGER e); +import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); +import int32 Reals_Expo (REAL x); +import int32 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int32 ex); +import REAL Reals_Ten (int32 e); +import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 24999430..85e9fca9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -7,22 +7,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -export void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -export INTEGER Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -INTEGER Strings_Length (CHAR *s, LONGINT s__len) +int32 Strings_Length (CHAR *s, LONGINT s__len) { - INTEGER _o_result; - INTEGER i; + int32 _o_result; + int32 i; __DUP(s, s__len, CHAR); i = 0; - while (((SYSTEM_INT64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -32,24 +32,24 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (SYSTEM_INT64)(i + n1) < dest__len)) { + while ((i < n2 && (int64)(i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((SYSTEM_INT64)(i + n1) < dest__len) { + if ((int64)(i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { - INTEGER n1, n2, i; + int32 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -60,10 +60,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((SYSTEM_INT64)(pos + n2) < dest__len) { + if ((int64)(pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((SYSTEM_INT64)(i + n2) < dest__len) { + if ((int64)(i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -77,9 +77,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) +void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) { - INTEGER len, i; + int32 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -92,7 +92,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((SYSTEM_INT64)(i - n) < s__len) { + if ((int64)(i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -100,7 +100,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -108,12 +108,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) { - INTEGER len, destLen, i; + int32 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (SYSTEM_INT32)dest__len - 1; + destLen = (int32)dest__len - 1; if (pos < 0) { pos = 0; } @@ -122,7 +122,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, return; } i = 0; - while (((((SYSTEM_INT64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -132,10 +132,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, __DEL(source); } -INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos) +int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) { - INTEGER _o_result; - INTEGER n1, n2, i, j; + int32 _o_result; + int32 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -170,7 +170,7 @@ INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__le void Strings_Cap (CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -184,9 +184,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INTEGER n, INTEGER m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9c2bad27..d703f8c0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -11,13 +11,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n); -import void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); -import INTEGER Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import INTEGER Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INTEGER pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest, LONGINT dest__len); +import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ff526cbc..0c5cb89c 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -14,9 +14,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -37,26 +37,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; - LONGINT W, H; + int64 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - LONGINT org, span; + int64 org, span; CHAR mod[32], proc[32]; }; @@ -65,7 +65,7 @@ typedef typedef struct Texts_BufDesc { - LONGINT len; + int64 len; Texts_Run head; } Texts_BufDesc; @@ -79,8 +79,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -95,7 +95,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_PieceDesc *Texts_Piece; @@ -103,57 +103,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - LONGINT len; + int64 len; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; BOOLEAN ascii; Files_File file; - LONGINT org; + int64 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - LONGINT org, off; + int64 org, off; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; Texts_Run head, cache; - LONGINT corg; + int64 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -179,50 +179,50 @@ export LONGINT *Texts_Writer__typ; export LONGINT *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +export void Texts_Delete (Texts_Text T, int64 beg, int64 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export LONGINT Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off); +export int64 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); -export void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); @@ -237,10 +237,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, LONGINT *off) +static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) { Texts_Run v = NIL; - LONGINT m; + int64 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -270,7 +270,7 @@ static void Texts_Find (Texts_Text T, LONGINT *pos, Texts_Run *u, LONGINT *org, } } -static void Texts_Split (LONGINT off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -369,11 +369,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -LONGINT Texts_ElemPos (Texts_Elem E) +int64 Texts_ElemPos (Texts_Elem E) { - LONGINT _o_result; + int64 _o_result; Texts_Run u = NIL; - LONGINT pos; + int64 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -388,7 +388,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t { Texts_Alien e = NIL; Files_Rider r; - LONGINT i; + int64 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -464,10 +464,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - LONGINT uo, ud, vo, vd; + int64 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -498,11 +498,11 @@ void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - LONGINT uo, ud, len; + int64 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -521,7 +521,7 @@ void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - LONGINT pos, len; + int64 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -536,10 +536,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) +void Texts_Delete (Texts_Text T, int64 beg, int64 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -561,10 +561,10 @@ void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end) } } -void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff) +void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - LONGINT co, uo, ud, vo, vd; + int64 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -600,7 +600,7 @@ void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_F } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos) +void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -617,7 +617,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT p void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) { Texts_Run u = NIL; - LONGINT pos; + int64 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -709,14 +709,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) { - LONGINT _o_result; + int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos) +void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -728,7 +728,7 @@ static struct Scan__31 { LONGINT *S__typ; CHAR *ch; BOOLEAN *negE; - INTEGER *e; + int32 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -756,9 +756,9 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - SHORTINT i, j, h; - INTEGER e; - LONGINT k; + int8 i, j, h; + int32 e; + int64 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -840,7 +840,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -930,7 +930,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (SYSTEM_INT64)(d[__X(j, 32)] - 48); + k = k * 10 + (int64)(d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -974,12 +974,12 @@ void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col) +void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff) +void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) { (*W).voff = voff; } @@ -1036,7 +1036,7 @@ void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) { - INTEGER i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1046,10 +1046,10 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { - INTEGER i; - LONGINT x0; + int32 i; + int64 x0; CHAR a[22]; i = 0; if (x < 0) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (SYSTEM_INT64)i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,10 +1081,10 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) +void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) { - INTEGER i; - LONGINT y; + int32 i; + int64 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1104,9 +1104,9 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) +void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) { - INTEGER e; + int32 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1177,15 +1177,15 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n) static struct WriteRealFix__53 { Texts_Writer *W; LONGINT *W__typ; - INTEGER *i; + int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (INTEGER n); -static void seq__56 (CHAR ch, INTEGER n); +static void dig__54 (int32 n); +static void seq__56 (CHAR ch, int32 n); -static void seq__56 (CHAR ch, INTEGER n) +static void seq__56 (CHAR ch, int32 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1193,7 +1193,7 @@ static void seq__56 (CHAR ch, INTEGER n) } } -static void dig__54 (INTEGER n) +static void dig__54 (int32 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1202,9 +1202,9 @@ static void dig__54 (INTEGER n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k) +void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) { - INTEGER e, i; + int32 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1276,7 +1276,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) { - INTEGER i; + int32 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1286,9 +1286,9 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n) +void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) { - INTEGER e; + int32 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1320,7 +1320,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = (SYSTEM_INT32)__ASHR((SYSTEM_INT64)(e - 1023) * 77, 8); + e = (int32)__ASHR((int64)(e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1360,7 +1360,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) { - INTEGER i; + int32 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1376,16 +1376,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, LONGINT x); +static void WritePair__44 (CHAR ch, int64 x); -static void WritePair__44 (CHAR ch, LONGINT x) +static void WritePair__44 (CHAR ch, int64 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) +void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1402,22 +1402,22 @@ void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d) static struct Load0__16 { Texts_Text *T; - SHORTINT *ecnt; + int8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - LONGINT org, ew, eh; - SHORTINT eno; + int64 org, ew, eh; + int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1467,8 +1467,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - LONGINT org, pos, hlen, plen; - SHORTINT ecnt, fno, fcnt, col, voff; + int64 org, pos, hlen, plen; + int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1538,7 +1538,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) { - INTEGER tag; + int32 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1553,7 +1553,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - LONGINT hlen; + int64 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1603,20 +1603,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - SHORTINT *ecnt; + int8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; - LONGINT org, span; - SHORTINT eno; + int64 org, span; + int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1647,8 +1647,8 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - LONGINT org, pos, delta, hlen, rlen; - SHORTINT ecnt, fno, fcnt; + int64 org, pos, delta, hlen, rlen; + int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; Texts_IdentifyMsg iden; @@ -1765,7 +1765,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - INTEGER i, res; + int32 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f36b27cf..2e48fe94 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -9,7 +9,7 @@ typedef struct Texts_BufDesc { - LONGINT len; + int64 len; char _prvt0[8]; } Texts_BufDesc; @@ -41,15 +41,15 @@ typedef typedef struct Texts_ElemDesc { char _prvt0[40]; - LONGINT W, H; + int64 W, H; Texts_Handler handle; char _prvt1[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - INTEGER id; - LONGINT pos; + int32 id; + int64 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, INTEGER, LONGINT, LONGINT); + void (*Texts_Notifier)(Texts_Text, int32, int64, int64); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; Texts_Elem elem; char _prvt0[64]; CHAR nextCh; - INTEGER line, class; - LONGINT i; + int32 line, class; + int64 i; REAL x; LONGREAL y; CHAR c; - SHORTINT len; + int8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - LONGINT len; + int64 len; Texts_Notifier notify; char _prvt0[24]; } Texts_TextDesc; @@ -109,7 +109,7 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - SHORTINT col, voff; + int8 col, voff; char _prvt0[54]; } Texts_Writer; @@ -130,41 +130,41 @@ import LONGINT *Texts_Scanner__typ; import LONGINT *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, LONGINT beg, LONGINT end, SET sel, Texts_FontsFont fnt, SHORTINT col, SHORTINT voff); +import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, LONGINT beg, LONGINT end); +import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import LONGINT Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, LONGINT pos, Texts_Buffer B); +import int64 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, LONGINT pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, LONGINT pos); +import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import LONGINT Texts_Pos (Texts_Reader *R, LONGINT *R__typ); +import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, LONGINT beg, LONGINT end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, SHORTINT col); +import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, SHORTINT voff); +import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d); +import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n); +import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER n); +import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, INTEGER k); +import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 65dd2639..c313eb20 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -21,7 +21,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (INTEGER sig); +static void Vishap_Trap (int32 sig); void Vishap_Module (BOOLEAN *done) @@ -127,7 +127,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (INTEGER sig) +static void Vishap_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 566e2b5c..bc32dc20 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -18,7 +18,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - INTEGER r, status, exitcode; + int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (OPM_Verbose) { diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index b9fb5373..a757d25d 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -9,36 +9,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (INTEGER n); -export void vt100_CNL (INTEGER n); -export void vt100_CPL (INTEGER n); -export void vt100_CUB (INTEGER n); -export void vt100_CUD (INTEGER n); -export void vt100_CUF (INTEGER n); -export void vt100_CUP (INTEGER n, INTEGER m); -export void vt100_CUU (INTEGER n); +export void vt100_CHA (int32 n); +export void vt100_CNL (int32 n); +export void vt100_CPL (int32 n); +export void vt100_CUB (int32 n); +export void vt100_CUD (int32 n); +export void vt100_CUF (int32 n); +export void vt100_CUP (int32 n, int32 m); +export void vt100_CUU (int32 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (INTEGER n); -export void vt100_ED (INTEGER n); -export void vt100_EL (INTEGER n); -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int32 n); +export void vt100_ED (int32 n); +export void vt100_EL (int32 n); +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (INTEGER n, INTEGER m); -export void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int32 n, int32 m); +export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); export void vt100_SCP (void); -export void vt100_SD (INTEGER n); -export void vt100_SGR (INTEGER n); -export void vt100_SGR2 (INTEGER n, INTEGER m); -export void vt100_SU (INTEGER n); +export void vt100_SD (int32 n); +export void vt100_SGR (int32 n); +export void vt100_SGR2 (int32 n, int32 m); +export void vt100_SU (int32 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) { CHAR h; while (start < end) { @@ -50,11 +50,11 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, INTEGER start, INTEGER } } -void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - INTEGER s, e; - SHORTINT maxLength; + int32 s, e; + int8 maxLength; maxLength = 20; if (int_ == (-9223372036854775807-1)) { __MOVE("-9223372036854775808", b, 21); @@ -89,7 +89,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -102,7 +102,7 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -115,7 +115,7 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -131,82 +131,82 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l __DEL(letter); } -void vt100_CUU (INTEGER n) +void vt100_CUU (int32 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (INTEGER n) +void vt100_CUD (int32 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (INTEGER n) +void vt100_CUF (int32 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (INTEGER n) +void vt100_CUB (int32 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (INTEGER n) +void vt100_CNL (int32 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (INTEGER n) +void vt100_CPL (int32 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (INTEGER n) +void vt100_CHA (int32 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (INTEGER n, INTEGER m) +void vt100_CUP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (INTEGER n) +void vt100_ED (int32 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (INTEGER n) +void vt100_EL (int32 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (INTEGER n) +void vt100_SU (int32 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (INTEGER n) +void vt100_SD (int32 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (INTEGER n, INTEGER m) +void vt100_HVP (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (INTEGER n) +void vt100_SGR (int32 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (INTEGER n, INTEGER m) +void vt100_SGR2 (int32 n, int32 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (INTEGER n) +void vt100_DSR (int32 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 745ff709..fb8a12d0 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -10,27 +10,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (INTEGER n); -import void vt100_CNL (INTEGER n); -import void vt100_CPL (INTEGER n); -import void vt100_CUB (INTEGER n); -import void vt100_CUD (INTEGER n); -import void vt100_CUF (INTEGER n); -import void vt100_CUP (INTEGER n, INTEGER m); -import void vt100_CUU (INTEGER n); +import void vt100_CHA (int32 n); +import void vt100_CNL (int32 n); +import void vt100_CPL (int32 n); +import void vt100_CUB (int32 n); +import void vt100_CUD (int32 n); +import void vt100_CUF (int32 n); +import void vt100_CUP (int32 n, int32 m); +import void vt100_CUU (int32 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (INTEGER n); -import void vt100_ED (INTEGER n); -import void vt100_EL (INTEGER n); -import void vt100_HVP (INTEGER n, INTEGER m); -import void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int32 n); +import void vt100_ED (int32 n); +import void vt100_EL (int32 n); +import void vt100_HVP (int32 n, int32 m); +import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (INTEGER n); -import void vt100_SGR (INTEGER n); -import void vt100_SGR2 (INTEGER n, INTEGER m); -import void vt100_SU (INTEGER n); +import void vt100_SD (int32 n); +import void vt100_SGR (int32 n); +import void vt100_SGR2 (int32 n, int32 m); +import void vt100_SU (int32 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 50ba59a0..e51f9704 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -41,7 +41,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) indentLevel: INTEGER; ptrinit, mainprog, ansi: BOOLEAN; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 36, 9 OF CHAR; + keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -117,6 +117,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF hashtab[h] >= 0 THEN IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END + ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN + OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN IF mode = OPT.TProc THEN Ident(obj^.link^.typ^.strobj) @@ -128,10 +130,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) OR (obj = OPT.ainttyp^.strobj) - OR (obj = OPT.int8typ^.strobj) - OR (obj = OPT.int16typ^.strobj) - OR (obj = OPT.int32typ^.strobj) - OR (obj = OPT.int64typ^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; @@ -1261,14 +1259,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE IntLiteral*(n, size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN - CASE size OF - |2: OPM.WriteString("((SYSTEM_INT16)("); - |4: OPM.WriteString("((SYSTEM_INT32)("); - |8: OPM.WriteString("((SYSTEM_INT64)("); - ELSE OPM.LogWStr("Unhandled case in OPC.IntLiteral, size = "); OPM.LogWNum(size,1); OPM.LogWLn; - END; - OPM.WriteInt(n); - OPM.WriteString("))") + OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); + OPM.WriteInt(n); OPM.WriteString("))") ELSE OPM.WriteInt(n) END @@ -1328,6 +1320,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN n := 0; FOR i := 0 TO 104 DO hashtab[i] := -1 END ; + Enter("adrint"); (* pseudo keyword used by voc *) Enter("asm"); Enter("auto"); Enter("break"); @@ -1341,24 +1334,33 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("else"); Enter("enum"); Enter("extern"); - Enter("export"); (* pseudo keyword used by voc *) + Enter("export"); (* pseudo keyword used by voc *) Enter("float"); Enter("for"); Enter("fortran"); Enter("goto"); Enter("if"); - Enter("import"); (* pseudo keyword used by voc *) + Enter("import"); (* pseudo keyword used by voc *) Enter("int"); + Enter("int16"); (* pseudo keyword used by voc *) + Enter("int32"); (* pseudo keyword used by voc *) + Enter("int64"); (* pseudo keyword used by voc *) + Enter("int8"); (* pseudo keyword used by voc *) Enter("long"); Enter("register"); Enter("return"); Enter("short"); Enter("signed"); Enter("sizeof"); + Enter("size_t"); Enter("static"); Enter("struct"); Enter("switch"); Enter("typedef"); + Enter("uint16"); (* pseudo keyword used by voc *) + Enter("uint32"); (* pseudo keyword used by voc *) + Enter("uint64"); (* pseudo keyword used by voc *) + Enter("uint8"); (* pseudo keyword used by voc *) Enter("union"); Enter("unsigned"); Enter("void"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 6eb2ffb0..089cd5e1 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -298,13 +298,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SizeCast(from, to: LONGINT); BEGIN IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - CASE to OF - |1: OPM.WriteString("(SYSTEM_INT8)"); - |2: OPM.WriteString("(SYSTEM_INT16)"); - |4: OPM.WriteString("(SYSTEM_INT32)"); - |8: OPM.WriteString("(SYSTEM_INT64)"); - ELSE OPM.LogWStr("Unhandled case in OPC.SizeCast, to = "); OPM.LogWNum(to,1); OPM.LogWLn; - END + OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") END END SizeCast; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 343404a4..11ec8fc5 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,19 +2,21 @@ #define SYSTEM__h #if defined(_WIN64) - typedef long long SYSTEM_INT64; - typedef unsigned long long SYSTEM_CARD64; + typedef long long int64; + typedef unsigned long long uint64; #else - typedef long SYSTEM_INT64; - typedef unsigned long SYSTEM_CARD64; + typedef long int64; + typedef unsigned long uint64; #endif -typedef int SYSTEM_INT32; -typedef unsigned int SYSTEM_CARD32; -typedef short int SYSTEM_INT16; -typedef unsigned short int SYSTEM_CARD16; -typedef signed char SYSTEM_INT8; -typedef unsigned char SYSTEM_CARD8; +typedef int int32; +typedef unsigned int uint32; + +typedef short int int16; +typedef unsigned short int uint16; + +typedef signed char int8; +typedef unsigned char uint8; #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) @@ -26,12 +28,30 @@ typedef unsigned char SYSTEM_CARD8; typedef unsigned int size_t; #endif -#define SYSTEM_ADRINT size_t -#define SYSTEM_ADDRESS size_t // Temporarily for bootstrap #define _SIZE_T_DECLARED // For FreeBSD #define _SIZE_T_DEFINED_ // For OpenBSD -void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); +void *memcpy(void *dest, const void *source, size_t size); + + +// Temporary while bootstrapping: + +#define SYSTEM_INT8 int8 +#define SYSTEM_INT16 int16 +#define SYSTEM_INT32 int32 +#define SYSTEM_INT64 int64 +#define SYSTEM_ADDRESS size_t + +#define U_SYSTEM_INT8 uint8 +#define U_SYSTEM_INT16 uint16 +#define U_SYSTEM_INT32 uint32 +#define U_SYSTEM_INT64 uint64 + +#define U_int8 uint8 +#define U_int16 uint16 +#define U_int32 uint32 +#define U_int64 uint64 + @@ -52,41 +72,53 @@ void *memcpy(void *dest, const void *source, SYSTEM_ADRINT size); // Oberon types -typedef char BOOLEAN; -typedef unsigned char SYSTEM_BYTE; -typedef unsigned char CHAR; -typedef signed char SHORTINT; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; +// typedef char BOOLEAN; +// typedef unsigned char SYSTEM_BYTE; +// typedef unsigned char CHAR; +// typedef signed char SHORTINT; +// typedef float REAL; +// typedef double LONGREAL; +// typedef void* SYSTEM_PTR; + +typedef int8 BOOLEAN; +typedef int8 SYSTEM_BYTE; +typedef uint8 U_SYSTEM_BYTE; +typedef uint8 CHAR; +typedef uint8 U_CHAR; +typedef int8 SHORTINT; +typedef uint8 U_SHORTINT; +typedef float REAL; +typedef double LONGREAL; +typedef void* SYSTEM_PTR; + +typedef size_t SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int INTEGER; // INTEGER is 32 bit. - typedef long long LONGINT; // LONGINT is 64 bit. (long long is always 64 bits, while long can be 32 bits e.g. under MSC/MingW) - typedef unsigned int U_INTEGER; - typedef unsigned long long U_LONGINT; + typedef int32 INTEGER; + typedef int64 LONGINT; + typedef uint32 U_INTEGER; + typedef uint64 U_LONGINT; #else - typedef short int INTEGER; // INTEGER is 16 bit. - typedef long LONGINT; // LONGINT is 32 bit. - typedef unsigned short int U_INTEGER; - typedef unsigned long U_LONGINT; + typedef int16 INTEGER; + typedef int32 LONGINT; + typedef uint16 U_INTEGER; + typedef uint32 U_LONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef unsigned char U_SYSTEM_BYTE; -typedef unsigned char U_CHAR; -typedef unsigned char U_SHORTINT; - typedef U_LONGINT SET; typedef U_LONGINT U_SET; -typedef SYSTEM_CARD8 U_SYSTEM_INT8; -typedef SYSTEM_CARD16 U_SYSTEM_INT16; -typedef SYSTEM_CARD32 U_SYSTEM_INT32; -typedef SYSTEM_CARD64 U_SYSTEM_INT64; + + + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + // OS Memory allocation interfaces are in PlatformXXX.Mod From 6851833a1ea4b49bfe308581a4e1a9d720d8f87e Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:45:23 +0100 Subject: [PATCH 012/140] Remove some temporary bottstrapping types. Change 'U_' to 'u'. --- bootstrap/unix-44/SYSTEM.c | 6 +-- bootstrap/unix-44/SYSTEM.h | 67 +++++++++------------------------- bootstrap/unix-48/SYSTEM.c | 6 +-- bootstrap/unix-48/SYSTEM.h | 67 +++++++++------------------------- bootstrap/unix-88/SYSTEM.c | 6 +-- bootstrap/unix-88/SYSTEM.h | 67 +++++++++------------------------- bootstrap/windows-48/SYSTEM.c | 6 +-- bootstrap/windows-48/SYSTEM.h | 67 +++++++++------------------------- bootstrap/windows-88/SYSTEM.c | 6 +-- bootstrap/windows-88/SYSTEM.h | 67 +++++++++------------------------- src/system/Platformwindows.Mod | 2 +- src/system/SYSTEM.c | 6 +-- src/system/SYSTEM.h | 67 +++++++++------------------------- src/tools/make/configure.c | 8 ++-- 14 files changed, 125 insertions(+), 323 deletions(-) diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index cfd080be..7511e427 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -232,7 +232,7 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(SYSTEM_CARD32)GetTickCount()"; +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; PROCEDURE Time*(): LONGINT; VAR ms: LONGINT; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 1077d3ce..9bc6b756 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -54,13 +54,13 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(U_LONGINT x, U_LONGINT y) +LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) { if ((LONGINT) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(U_LONGINT x, U_LONGINT y) -{ U_LONGINT m; +LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) +{ uLONGINT m; if ((LONGINT) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 11ec8fc5..2cab2429 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -34,27 +34,6 @@ typedef unsigned char uint8; void *memcpy(void *dest, const void *source, size_t size); -// Temporary while bootstrapping: - -#define SYSTEM_INT8 int8 -#define SYSTEM_INT16 int16 -#define SYSTEM_INT32 int32 -#define SYSTEM_INT64 int64 -#define SYSTEM_ADDRESS size_t - -#define U_SYSTEM_INT8 uint8 -#define U_SYSTEM_INT16 uint16 -#define U_SYSTEM_INT32 uint32 -#define U_SYSTEM_INT64 uint64 - -#define U_int8 uint8 -#define U_int16 uint16 -#define U_int32 uint32 -#define U_int64 uint64 - - - - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -72,21 +51,11 @@ void *memcpy(void *dest, const void *source, size_t size); // Oberon types -// typedef char BOOLEAN; -// typedef unsigned char SYSTEM_BYTE; -// typedef unsigned char CHAR; -// typedef signed char SHORTINT; -// typedef float REAL; -// typedef double LONGREAL; -// typedef void* SYSTEM_PTR; - typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 U_SYSTEM_BYTE; +typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 U_CHAR; -typedef int8 SHORTINT; -typedef uint8 U_SHORTINT; +typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -99,19 +68,17 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint32 U_INTEGER; - typedef uint64 U_LONGINT; + typedef uint64 uLONGINT; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint16 U_INTEGER; - typedef uint32 U_LONGINT; + typedef uint32 uLONGINT; #endif // Unsigned variants are for use by shift and rotate macros. -typedef U_LONGINT SET; -typedef U_LONGINT U_SET; +typedef uLONGINT SET; +typedef uLONGINT uSET; @@ -137,8 +104,8 @@ extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (U_LONGINT x, U_LONGINT y); -extern LONGINT SYSTEM_MOD (U_LONGINT x, U_LONGINT y); +extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); extern LONGINT SYSTEM_ENTIER (double x); @@ -186,22 +153,22 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) #define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x -#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n))) +#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) +#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) #define __ASHL(x, n) ((LONGINT)(x)<<(n)) #define __ASHR(x, n) ((LONGINT)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ROTL(x, n, t) ((t)((U_##t)(x)<<(n)|(U_##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((U_##t)(x)>>(n)|(U_##t)(x)<<(8*sizeof(t)-(n)))) +#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) +#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1) +#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) -#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) +#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -215,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((U_SET)(s))>>(x))&1)) +#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) #define __MASK(x, m) ((x)&~(m)) @@ -224,9 +191,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) #define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((U_LONGINT)(i)<(U_LONGINT)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) #define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 312b3ca5..28530ece 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -212,7 +212,7 @@ void determineBuildDate() { struct {char ch; CHAR x;} c; struct {char ch; BOOLEAN x;} b; -struct {char ch; SHORTINT x;} si; +//struct {char ch; SHORTINT x;} si; struct {char ch; INTEGER x;} i; struct {char ch; LONGINT x;} li; struct {char ch; SET x;} s; @@ -246,7 +246,7 @@ void ReportSizesAndAlignments() { printf("Type Size Align\n"); printf("CHAR %4zd %4td\n", sizeof(CHAR), (char*)&c.x - (char*)&c); printf("BOOLEAN %4zd %4td\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); - printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); +//printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); @@ -326,7 +326,7 @@ void testSystemDotH() { assert(sizeof(CHAR) == 1, "Size of CHAR not 1."); assert(sizeof(BOOLEAN) == 1, "Size of BOOLEAN not 1."); - assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); +//assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); assert(sizeof(INTEGER) == 2 || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); assert(sizeof(LONGINT) == 4 @@ -340,7 +340,7 @@ void testSystemDotH() { assert(((char*)&c.x - (char*)&c) == 1, "Alignment of CHAR not 1."); assert(((char*)&b.x - (char*)&b) == 1, "Alignment of BOOLEAN not 1."); - assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); +//assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); //assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); assert(((char*)&r.x - (char*)&r) == 4, "Alignment of REAL not 4 bytes."); assert(((char*)&lr.x - (char*)&lr) >= 4, "Alignment of LONGREAL less than 4 bytes."); From fdaa5ec81bfbdef469dc8355b9fd6a41fa5498a7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 1 Sep 2016 14:53:23 +0100 Subject: [PATCH 013/140] Fix outdated CARD32 type in PlatformWindows. --- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-88/Platform.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index b8a6b5a5..76fb4a1d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -109,7 +109,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2724553b..2e9530e6 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -110,7 +110,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(SYSTEM_CARD32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) From 11de6b8512385c05cdf9007f9ed55b437d648d7f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 2 Sep 2016 13:02:44 +0100 Subject: [PATCH 014/140] uintptr for alloc/free, some sys fns from LONGINT to int64. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 4 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 13 ++- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 6 +- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 3 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 23 +++--- bootstrap/unix-44/Platform.h | 11 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 31 +++---- bootstrap/unix-44/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 4 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 13 ++- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 6 +- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 3 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 23 +++--- bootstrap/unix-48/Platform.h | 11 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 31 +++---- bootstrap/unix-48/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 4 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 13 ++- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 6 +- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 3 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 21 ++--- bootstrap/unix-88/Platform.h | 11 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 31 +++---- bootstrap/unix-88/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 4 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 13 ++- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 6 +- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 3 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 31 +++---- bootstrap/windows-48/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 4 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 13 ++- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 6 +- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 3 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 31 +++---- bootstrap/windows-88/SYSTEM.h | 118 +++++++++++++++------------ bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 11 +++ src/compiler/OPC.Mod | 9 +- src/compiler/OPT.Mod | 17 ++-- src/compiler/OPV.Mod | 1 + src/compiler/Vishap.Mod | 2 +- src/system/Heap.Mod | 4 +- src/system/Platformunix.Mod | 12 +-- src/system/SYSTEM.c | 31 +++---- src/system/SYSTEM.h | 118 +++++++++++++++------------ 214 files changed, 850 insertions(+), 698 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 8c9c6910..baf934fc 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3c6594af..c971536e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d84672d4..f5c55397 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index c247eb06..f8dc8de8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -62,8 +63,8 @@ export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -118,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -212,14 +213,14 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +uintptr Platform_OSAllocate (uintptr size) { - int32 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } @@ -262,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = __VAL(Platform_ArgVec, Platform_ArgVector); __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 129004fd..a4c001f3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,11 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import uintptr Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -51,8 +52,8 @@ import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a736989a..4692859f 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index bba6eb24..e78a2d49 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 8c9c6910..baf934fc 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3c6594af..c971536e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d84672d4..f5c55397 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index c247eb06..f8dc8de8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -62,8 +63,8 @@ export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -118,14 +119,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -212,14 +213,14 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +uintptr Platform_OSAllocate (uintptr size) { - int32 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } @@ -262,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = __VAL(Platform_ArgVec, Platform_ArgVector); __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 129004fd..a4c001f3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,11 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import uintptr Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -51,8 +52,8 @@ import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8dea0639..e3516799 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index d946691c..b8f301f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index f4abd052..ea06c48a 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c756e930..1e741041 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b4cd60d3..32b4d836 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 987b5478..432a6e71 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 9ce98932..55714eaa 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index dee1234e..4dcd76c5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e96f7807..ba7f69f4 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 40c921e4..e07b0d1e 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5f85fd33..3cc9156d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d61c2889..f1bcc92f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 36f97a5d..ad99f16a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 61a0edcd..82eb03c4 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 8310f854..f67c2556 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -216,7 +220,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2081,6 +2085,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 3c5dedf4..42f6f30d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index d4b582de..fb89bcd6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index ccce7304..72257311 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 78136a18..e270236a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 863db6d6..9897c9c2 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index efd39a62..d07d06ca 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index c497e5c6..2aee5b21 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 287c2ba6..6fd27531 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,6 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1850,6 +1851,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 808e8043..349849e8 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5b1ffe19..d3aa0a87 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,6 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 914ff060..09b50b36 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index fd00502a..2a6381d8 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,11 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame, Platform_HaltCode; +export uintptr Platform_MainStackFrame; +export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[256]; export int32 Platform_ArgCount; -export int64 Platform_ArgVector; +export uintptr Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -63,8 +64,8 @@ export void Platform_Init (int32 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); +export uintptr Platform_OSAllocate (uintptr size); +export void Platform_OSFree (uintptr address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -119,14 +120,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno #define Platform_errc(c) write(1, &c, 1) #define Platform_errstring(s, s__len) write(1, s, s__len-1) #define Platform_exit(code) exit(code) -#define Platform_free(address) free((void*)(SYSTEM_ADRINT)address) +#define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) #define Platform_ftruncate(fd, l) ftruncate(fd, l) @@ -213,14 +214,14 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -int64 Platform_OSAllocate (int64 size) +uintptr Platform_OSAllocate (uintptr size) { - int64 _o_result; + uintptr _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int64 address) +void Platform_OSFree (uintptr address) { Platform_free(address); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index caba8898..63531c58 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,11 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame, Platform_HaltCode; +import uintptr Platform_MainStackFrame; +import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[256]; import int32 Platform_ArgCount; -import int64 Platform_ArgVector; +import uintptr Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -52,8 +53,8 @@ import void Platform_Init (int32 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); +import uintptr Platform_OSAllocate (uintptr size); +import void Platform_OSFree (uintptr address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 5877bedc..d6e77abf 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index cf944612..2c04bec3 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 85e9fca9..769cecb7 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d703f8c0..012e77f9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0c5cb89c..934bc227 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 2e48fe94..fbd8a7a4 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index c313eb20..f781d7ee 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index dc5320bb..b1aa1639 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d15a472c..049c862a 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index bc32dc20..51975db4 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 161e273a..3cba883d 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a757d25d..dfa8df9c 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index fb8a12d0..139b592e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index fb7df026..194e9da8 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 61b33bc5..fbca10e0 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 72c0b6bf..5b63f566 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 16287a76..3823dacc 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4aecc2ee..b53ae4ca 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index e85d1cfd..c216c6c6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a252264a..2315b64e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -100,7 +100,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a89f18fc..83733c20 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 7969f68f..e7006b76 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 8b271308..632138b5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bc74dd1d..fa8f98fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a4ccc86e..8b2baa5f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 08469d42..93d60530 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -215,7 +219,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2080,6 +2084,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 05c34fcc..78a60ed9 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8bf863b3..19ad29af 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 36eb4165..44fe5275 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a366ef24..b0cd8613 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 8bed9493..423013a4 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2b29372f..36b37592 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index e40119f7..dec9c209 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7fbad791..16dfc5b1 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,6 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1849,6 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 480267cc..c290d3de 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5ef539df..aeef6224 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,6 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 06bc39f1..8fd772f8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 76fb4a1d..67dc8e39 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 23922225..39074f3e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4b500170..4e271371 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index a1191c0b..b1e62271 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 6463db16..439a49e9 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 07051628..681fcf1c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8dea0639..e3516799 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index d946691c..b8f301f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index c8f81032..9224220a 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 3f916fe9..6e4f20e5 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 2afac320..f06c706d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b894b3f9..00be6a22 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ca635519..9d9202c0 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 46a1e460..8ca75a42 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index ad1ac948..901eed38 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index f4abd052..ea06c48a 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/01] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c756e930..1e741041 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 4331a772..7133027a 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 987b5478..432a6e71 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 0c20d87b..7eae4cc4 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 918f272c..9a9b3b58 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e96f7807..ba7f69f4 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; -extern LONGINT Platform_OSAllocate(LONGINT size); +extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 40c921e4..e07b0d1e 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5f85fd33..3cc9156d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d61c2889..f1bcc92f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 36f97a5d..ad99f16a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 61a0edcd..82eb03c4 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 8310f854..f67c2556 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,12 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - OPM_WriteString((CHAR*)"int", 4); - OPM_WriteInt(__ASHL(obj->typ->size, 3)); + if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + OPM_WriteString((CHAR*)"uintptr", 8); + } else { + OPM_WriteString((CHAR*)"int", 4); + OPM_WriteInt(__ASHL(obj->typ->size, 3)); + } } else { if (mode != 5 || obj->linkadr != 2) { if (mode == 13) { @@ -216,7 +220,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)OPM_modName, 32); } OPM_Write('_'); - } else if ((obj == OPT_sysptrtyp->strobj || obj == OPT_ainttyp->strobj) || obj == OPT_bytetyp->strobj) { + } else if (obj == OPT_sysptrtyp->strobj || obj == OPT_bytetyp->strobj) { OPM_WriteString((CHAR*)"SYSTEM_", 8); } OPM_WriteStringVar((void*)obj->name, 256); @@ -2081,6 +2085,7 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); + Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 3c5dedf4..42f6f30d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index d4b582de..fb89bcd6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index ccce7304..72257311 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 78136a18..e270236a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 863db6d6..9897c9c2 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index efd39a62..d07d06ca 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index c497e5c6..2aee5b21 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 287c2ba6..6fd27531 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,6 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_pinttyp); P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1850,6 +1851,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 808e8043..349849e8 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5b1ffe19..d3aa0a87 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,6 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; + OPT_pinttyp->strobj->linkadr = 2; OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 914ff060..09b50b36 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2e9530e6..456a43cf 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 13f60995..3691e5fb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 5877bedc..d6e77abf 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index cf944612..2c04bec3 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 85e9fca9..769cecb7 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d703f8c0..012e77f9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0c5cb89c..934bc227 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 2e48fe94..fbd8a7a4 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index c313eb20..f781d7ee 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_ainttyp->size = OPM_PointerSize; + OPT_pinttyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index dc5320bb..b1aa1639 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d15a472c..049c862a 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index bc32dc20..51975db4 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 161e273a..3cba883d 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a757d25d..dfa8df9c 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index fb8a12d0..139b592e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/01] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index eee8238a..3840589a 100644 --- a/makefile +++ b/makefile @@ -158,6 +158,9 @@ full: configuration +assemble: + @make -f src/tools/make/vishap.make -s assemble + # compile: compiler only, without cleaning compiler: configuration @@ -244,6 +247,14 @@ bootstrap: configuration make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym +bootstrapunclean: + rm -rf bootstrap/* + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + revertbootstrap: diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e51f9704..5b4f9195 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -7,7 +7,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IMPORT OPT, OPM, Configuration, SYSTEM; - CONST demoVersion = FALSE; @@ -118,7 +117,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + IF (obj.typ = OPT.pinttyp) OR (obj.typ = OPT.ainttyp) THEN + OPM.WriteString("uintptr") + ELSE + OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN IF mode = OPT.TProc THEN Ident(obj^.link^.typ^.strobj) @@ -129,7 +132,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; OPM.Write('_') ELSIF (obj = OPT.sysptrtyp^.strobj) - OR (obj = OPT.ainttyp^.strobj) OR (obj = OPT.bytetyp^.strobj) THEN OPM.WriteString("SYSTEM_") END; @@ -1357,6 +1359,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); + Enter("uintptr"); (* pseudo keyword used by voc *) Enter("uint16"); (* pseudo keyword used by voc *) Enter("uint32"); (* pseudo keyword used by voc *) Enter("uint64"); (* pseudo keyword used by voc *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index a60f30f8..135d1016 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - ainttyp*, + pinttyp*, ainttyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1186,13 +1186,14 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); + EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); + EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); + EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); (* Temporary for bootstrapping *) + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 089cd5e1..e23a89ad 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,6 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + OPT.pinttyp^.strobj^.linkadr := PredefinedType; OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 6d306e5e..615a032c 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.ainttyp.size := OPM.PointerSize; + OPT.pinttyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 5acbb04e..619daf53 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -162,8 +162,8 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern LONGINT Platform_OSAllocate(LONGINT size);"; - PROCEDURE -OSAllocate(size: LONGINT): LONGINT "Platform_OSAllocate(size)"; + PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; + PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; PROCEDURE NewChunk(blksz: LONGINT): LONGINT; VAR chnk: LONGINT; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index a55e1130..34ee60b6 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: LONGINT; + MainStackFrame-: SYSTEM.ADRINT; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: LONGINT; + ArgVector-: SYSTEM.ADRINT; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -106,11 +106,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate (size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "free((void*)(SYSTEM_ADRINT)address)"; -PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.UINTPTR) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 9bc6b756..16681ab8 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -18,8 +18,11 @@ #include -LONGINT SYSTEM_XCHK(LONGINT i, LONGINT ub) {return __X(i, ub);} -LONGINT SYSTEM_RCHK(LONGINT i, LONGINT ub) {return __R(i, ub);} +// Procedure verions of SYSTEM.H versions used when a multiply accessed +// parameter has side effects. + +int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} +int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} double SYSTEM_ABSD(double i) {return __ABS(i);} @@ -35,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((LONGINT)(SYSTEM_ADRINT)(*((void**)(adr)))); + P((uintptr)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -48,20 +51,20 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(LONGINT*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } } -LONGINT SYSTEM_DIV(uLONGINT x, uLONGINT y) -{ if ((LONGINT) x >= 0) return (x / y); +LONGINT SYSTEM_DIV(uint64 x, uint64 y) +{ if ((int64) x >= 0) return (x / y); else return -((y - 1 - x) / y); } -LONGINT SYSTEM_MOD(uLONGINT x, uLONGINT y) -{ uLONGINT m; - if ((LONGINT) x >= 0) return (x % y); +LONGINT SYSTEM_MOD(uint64 x, uint64 y) +{ uint64 m; + if ((int64) x >= 0) return (x % y); else { m = (-x) % y; if (m != 0) return (y - m); else return 0; } @@ -106,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[-1]; + p = (LONGINT*)(uintptr)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -119,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(SYSTEM_ADRINT)x[- 1]; + p = (LONGINT*)(uintptr)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -155,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, SYSTEM_ADRINT h) { + void SystemSetHandler(int s, uintptr h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -194,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(SYSTEM_ADRINT h) { + void SystemSetInterruptHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(SYSTEM_ADRINT h) { + void SystemSetQuitHandler(uintptr h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 2cab2429..c83f69f1 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,6 +1,27 @@ #ifndef SYSTEM__h #define SYSTEM__h +// Declare memcpy in a way compatible with C compilers intrinsic +// built in implementations. + +#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) + #if defined(_WIN64) + typedef unsigned long long size_t; + #else + typedef unsigned long size_t; + #endif +#else + typedef unsigned int size_t; +#endif + +#define _SIZE_T_DECLARED // For FreeBSD +#define _SIZE_T_DEFINED_ // For OpenBSD + +void *memcpy(void *dest, const void *source, size_t size); + + +// Declare fixed size versions of basic intger types + #if defined(_WIN64) typedef long long int64; typedef unsigned long long uint64; @@ -18,20 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) - #if defined(_WIN64) - typedef unsigned long long size_t; - #else - typedef unsigned long size_t; - #endif -#else - typedef unsigned int size_t; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -46,7 +54,7 @@ void *memcpy(void *dest, const void *source, size_t size); #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((LONGINT*)(1)) // not NIL and not a valid type +#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type // Oberon types @@ -60,7 +68,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef size_t SYSTEM_ADRINT; +typedef uintptr SYSTEM_ADRINT; // For 32 bit builds, the size of LONGINT depends on a make option: @@ -68,18 +76,19 @@ typedef size_t SYSTEM_ADRINT; #if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) typedef int32 INTEGER; typedef int64 LONGINT; - typedef uint64 uLONGINT; + typedef uint64 SET; + typedef uint64 uSET; #else typedef int16 INTEGER; typedef int32 LONGINT; - typedef uint32 uLONGINT; + typedef uint32 SET; + typedef uint32 uSET; #endif -// Unsigned variants are for use by shift and rotate macros. -typedef uLONGINT SET; -typedef uLONGINT uSET; +// Temporary defs while bootstrapping +#define uLONGINT uint64 @@ -90,32 +99,32 @@ typedef uLONGINT uSET; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern LONGINT Platform_OSAllocate (LONGINT size); -extern void Platform_OSFree (LONGINT addr); +extern uintptr Platform_OSAllocate (uintptr size); +extern void Platform_OSFree (uintptr addr); // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_XCHK (LONGINT i, LONGINT ub); -extern LONGINT SYSTEM_RCHK (LONGINT i, LONGINT ub); +extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); +extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uLONGINT x, uLONGINT y); -extern LONGINT SYSTEM_MOD (uLONGINT x, uLONGINT y); +extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); +extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, SYSTEM_ADRINT h); + extern void SystemSetHandler(int s, uintptr h); #else - extern void SystemSetInterruptHandler(SYSTEM_ADRINT h); - extern void SystemSetQuitHandler (SYSTEM_ADRINT h); + extern void SystemSetInterruptHandler(uintptr h); + extern void SystemSetQuitHandler (uintptr h); #endif @@ -138,11 +147,18 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADRINT)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADRINT)x) +#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +// Index and range checks + +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) + +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) /* SYSTEM ops */ @@ -150,24 +166,24 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(SYSTEM_ADRINT)(a) -#define __PUT(a, x, t) *(t*)(SYSTEM_ADRINT)(a)=x +#define __GET(a, x, t) x= *(t*)(uintptr)(a) +#define __PUT(a, x, t) *(t*)(uintptr)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) #define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) - #define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __BIT(x, n) (*(uLONGINT*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADRINT)(d),(char*)(SYSTEM_ADRINT)(s),n) +#define __ASHL(x, n) ((LONGINT)(x)<<(n)) +#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) + +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -191,10 +207,6 @@ static int __str_cmp(CHAR *x, CHAR *y){ // Runtime checks -#define __X(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((LONGINT)(i), (LONGINT)(ub)) -#define __R(i, ub) (((uLONGINT)(i)<(uLONGINT)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((LONGINT)(i),(LONGINT)(ub)) #define __RETCHK __retchk: __HALT(-3); return 0; #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) @@ -227,7 +239,7 @@ extern void Heap_INCREF(); extern void Platform_Init(INTEGER argc, LONGINT argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADRINT)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -248,7 +260,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -279,20 +291,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(SYSTEM_ADRINT)t##__typ; \ - t##__desc.module = (LONGINT)(SYSTEM_ADRINT)m; \ + t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ + t##__desc.module = (LONGINT)(uintptr)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(SYSTEM_ADRINT)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADRINT)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADRINT)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADRINT)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADRINT)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist From cdd8a26481abf43655291bcf64a4079ae78cf558 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 11:56:17 +0100 Subject: [PATCH 015/140] Moving Heap.Mod to SYSTEM.UINTPTR. Only 64 bit working for now. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 20 +++--- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 10 +-- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 4 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 +-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 8 +-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 14 ++-- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 14 ++-- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.h | 8 +-- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 20 +++--- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 10 +-- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 4 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 +-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 8 +-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 14 ++-- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 14 ++-- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.h | 8 +-- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 20 +++--- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 100 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 10 +-- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 4 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 8 +-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 16 ++--- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 14 ++-- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.h | 8 +-- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 20 +++--- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 100 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 10 +-- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 4 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 +-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 8 +-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 10 +-- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 14 ++-- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.h | 8 +-- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 20 +++--- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 100 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 10 +-- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 4 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 8 +-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 10 +-- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 14 ++-- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.h | 8 +-- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 2 +- src/compiler/OPV.Mod | 6 +- src/system/Heap.Mod | 38 +++++----- src/system/Platformunix.Mod | 6 +- src/system/SYSTEM.h | 8 +-- 205 files changed, 656 insertions(+), 650 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 4692859f..6157e386 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e78a2d49..76aee9f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 32b4d836..b285b3ec 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 55714eaa..14855929 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4dcd76c5..fb2ef55f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 2a6381d8..7895f7e6 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -140,13 +140,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -163,7 +163,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -231,7 +231,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -264,7 +264,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -531,7 +531,7 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { int32 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -767,7 +767,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 63531c58..7b310e29 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b63f566..c69949e1 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b53ae4ca..308a2a37 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c216c6c6..41cd7233 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 67dc8e39..95b8b50f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +559,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 _o_result; int16 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 39074f3e..6d983649 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7133027a..b73a59cc 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7eae4cc4..cf6feb16 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9a9b3b58..0be3f73d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 456a43cf..0135ee93 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +560,7 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) int32 _o_result; int32 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 3691e5fb..f3b3574f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 9f696edc..62be133a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1208,7 +1208,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) err(126) END; (* Warn if the result type includes memory past the end of the source variable *) - IF x.typ.size < p.typ.size THEN err(-308) END; + IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; (* IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index e23a89ad..cd387568 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -566,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(uintptr)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -579,7 +579,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(SYSTEM_ADRINT)") + OPM.WriteString("(uintptr)") END; expr(l, exprPrec) ELSE @@ -797,7 +797,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.PointerSize) - ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((uintptr)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 619daf53..6b6411a2 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -30,6 +30,7 @@ MODULE Heap; sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) NoPtrSntl = LONG(LONG(-SZL)); + (*NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL);*) LongZero = LONG(LONG(0)); TYPE @@ -64,7 +65,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: LONGINT; (* weak pointer *) + obj: SYSTEM.UINTPTR; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -75,13 +76,13 @@ MODULE Heap; freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) bigBlocks: LONGINT; - allocated*: LONGINT; + allocated*: SYSTEM.UINTPTR; firstTry: BOOLEAN; (* extensible heap *) - heap: LONGINT; (* the sorted list of heap chunks *) - heapend: LONGINT; (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) + heap: SYSTEM.UINTPTR; (* the sorted list of heap chunks *) + heapend: SYSTEM.UINTPTR; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.UINTPTR; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +154,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: LONGINT); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -165,8 +166,8 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; + PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; + VAR chnk: SYSTEM.UINTPTR; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -185,8 +186,13 @@ MODULE Heap; (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT - rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))"; + rather than loading 64 bits. + + NOTE - with uintpr work complete this function should be replaces withSYSTEM.GET + as there will be no need to extend addresses to larger types. + + *) + PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; @@ -213,16 +219,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) <= SIZE(LONGINT)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -305,8 +311,8 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) END NEWREC; - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) @@ -364,7 +370,7 @@ MODULE Heap; END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 34ee60b6..76c0db89 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADRINT)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"read(fd, (void*)(uintptr)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"write(fd, (void*)(uintptr)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) From a730d6c96bfbd0441f746d28801b0710825d8252 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 12:01:04 +0100 Subject: [PATCH 016/140] Switch SYSTEM.h uintptr type from int64 to size_t, 32 bit working again. --- bootstrap/unix-44/SYSTEM.h | 4 ++-- bootstrap/unix-48/SYSTEM.h | 4 ++-- bootstrap/unix-88/SYSTEM.h | 4 ++-- bootstrap/windows-48/SYSTEM.h | 4 ++-- bootstrap/windows-88/SYSTEM.h | 4 ++-- src/system/SYSTEM.h | 3 +-- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 31fa97c5..b7d405ff 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t +//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 31fa97c5..2622657f 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,8 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -//#define uintptr size_t -#define uintptr int64 +#define uintptr size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. From db18774de117339389d8af30c447f9abb9cf84e4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 17:47:55 +0100 Subject: [PATCH 017/140] Allow SYSTEM.VAL of constant in CONST and use in Heap.Mod. --- bootstrap/unix-44/OPB.c | 16 +++++++++------ bootstrap/unix-44/SYSTEM.h | 1 - bootstrap/unix-48/OPB.c | 16 +++++++++------ bootstrap/unix-48/SYSTEM.h | 1 - bootstrap/unix-88/OPB.c | 16 +++++++++------ bootstrap/unix-88/SYSTEM.h | 1 - bootstrap/windows-48/OPB.c | 16 +++++++++------ bootstrap/windows-48/SYSTEM.h | 1 - bootstrap/windows-88/OPB.c | 16 +++++++++------ bootstrap/windows-88/SYSTEM.h | 1 - src/compiler/OPB.Mod | 28 ++++++++++++++++---------- src/system/Heap.Mod | 37 +++++++++++++++++------------------ 12 files changed, 86 insertions(+), 64 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bab019ae..5ede35ed 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1125,7 +1125,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2200,11 +2200,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3af88ab8..07797236 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1124,7 +1124,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2199,11 +2199,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bab019ae..5ede35ed 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1125,7 +1125,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) if ((*x)->class == 7) { if (f == 4) { if (g == 4) { - if (f > g) { + if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { OPB_err(203); @@ -2200,11 +2200,15 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } - t = OPT_NewNode(11); - t->subcl = 29; - t->left = x; - x = t; - x->typ = p->typ; + if ((((x->class == 7 && x->typ->form == 4)) && p->typ->form == 4)) { + OPB_Convert(&x, p->typ); + } else { + t = OPT_NewNode(11); + t->subcl = 29; + t->left = x; + x = t; + x->typ = p->typ; + } p = x; break; case 30: diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index b7d405ff..2622657f 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -40,7 +40,6 @@ typedef signed char int8; typedef unsigned char uint8; #define uintptr size_t -//#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 62be133a..73832049 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -598,11 +598,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; - BEGIN f := x^.typ^.form; g := typ^.form; + BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN IF f = OPT.Int THEN IF g = OPT.Int THEN - IF f > g THEN SetIntType(x); + IF x.typ.size > typ.size THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END ELSIF g IN OPT.realSet THEN x^.conval^.realval := x^.conval^.intval; x^.conval^.intval := OPM.ConstNotAlloc @@ -1201,6 +1201,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; p^.typ := OPT.booltyp |OPT.valfn: (*SYSTEM.VAL*) (* type is changed without considering the byte ordering on the target machine *) + (* p (1st param): desired type *) + (* x (2nd param): constant or value to be converted to p *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (f IN {OPT.Undef, OPT.String, OPT.NoTyp}) @@ -1209,14 +1211,20 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END; (* Warn if the result type includes memory past the end of the source variable *) IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; - t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; - (* - IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN - t := OPT.NewNode(OPT.Nmop); t^.subcl := val; t^.left := x; x := t - ELSE x^.readonly := FALSE - END ; - *) - x^.typ := p^.typ; p := x + + IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN + Convert(x, p.typ) + ELSE + t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; + (* + IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN + t := OPT.NewNode(OPT.Nmop); t^.subcl := val; t^.left := x; x := t + ELSE x^.readonly := FALSE + END ; + *) + x^.typ := p^.typ; + END; + p := x |OPT.sysnewfn: (*SYSTEM.NEW*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 6b6411a2..11723ec5 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -20,18 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = LONG(LONG(0)); (* next heap chunk, sorted ascendingly! *) - endOff = LONG(LONG(SZL)); (* end of heap chunk *) - blkOff = LONG(LONG(3*SZL)); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* first block in a chunk *) (* heap blocks *) - tagOff = LONG(LONG(0)); (* block starts with tag *) - sizeOff = LONG(LONG(SZL)); (* block size in free block relative to block start *) - sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) - nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) - NoPtrSntl = LONG(LONG(-SZL)); - (*NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL);*) - LongZero = LONG(LONG(0)); + tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZL); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL); + AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -296,16 +295,16 @@ MODULE Heap; END ; i := adr + 4*SZL; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, LongZero); - SYSTEM.PUT(i + SZL, LongZero); - SYSTEM.PUT(i + 2*SZL, LongZero); - SYSTEM.PUT(i + 3*SZL, LongZero); + SYSTEM.PUT(i, AddressZero); + SYSTEM.PUT(i + SZL, AddressZero); + SYSTEM.PUT(i + 2*SZL, AddressZero); + SYSTEM.PUT(i + 3*SZL, AddressZero); INC(i, 4*SZL) END ; - SYSTEM.PUT(adr + nextOff, LongZero); + SYSTEM.PUT(adr + nextOff, AddressZero); SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, LongZero); - SYSTEM.PUT(adr + sntlOff, LongZero); + SYSTEM.PUT(adr + sizeOff, AddressZero); + SYSTEM.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) @@ -318,7 +317,7 @@ MODULE Heap; blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, LongZero); (*reserved for meta info*) + SYSTEM.PUT(tag - SZL, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZL, NoPtrSntl); SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); @@ -580,7 +579,7 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; BEGIN heap := NewChunk(heapSize0); heapend := FetchAddress(heap + endOff); - SYSTEM.PUT(heap, LongZero); + SYSTEM.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; interrupted := FALSE; From 4ec2e61ed03da1d79a5f1bd95e8530e7d2616ffa Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 18:55:55 +0100 Subject: [PATCH 018/140] Completely update addresing vars in heap from LONGINT to SYSTEM.UINTPTR. --- bootstrap/unix-44/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/unix-48/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/unix-88/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/windows-48/Heap.c | 128 ++++++++++++++++++------------------ bootstrap/windows-88/Heap.c | 128 ++++++++++++++++++------------------ src/system/Heap.Mod | 119 ++++++++++++++++----------------- 6 files changed, 380 insertions(+), 379 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1f1b65b4..6712b853 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -52,15 +52,15 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - int64 types; + uintptr types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -76,18 +76,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -96,11 +96,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -157,7 +157,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -175,8 +175,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 8, chnk + (24 + blksz), uintptr); __PUT(chnk + 24, chnk + 32, uintptr); __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 40, -8, uintptr); + __PUT(chnk + 48, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int64 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (int64 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -237,10 +237,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 5); end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -281,8 +281,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); if (restsize > 288) { __PUT(adr + 8, restsize, uintptr); } else { @@ -295,7 +295,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -304,16 +304,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 16, 0, uintptr); + __PUT(i + 24, 0, uintptr); i += 32; } - __PUT(adr + 24, 0, int64); + __PUT(adr + 24, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 8, 0, uintptr); + __PUT(adr + 16, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); @@ -328,29 +328,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int64)(uintptr)new) + blksz) - 24; - __PUT(tag - 8, 0, int64); + tag = ((uintptr)(uintptr)new + blksz) - 24; + __PUT(tag - 8, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, int64); - __PUT((int64)(uintptr)new - 8, tag, uintptr); + __PUT(tag + 8, -8, uintptr); + __PUT((uintptr)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int64 q) +static void Heap_Mark (uintptr q) { - int64 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, uintptr); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); - if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (int64 q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (int64 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, uintptr); + __PUT(q - 8, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -385,7 +385,7 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -410,14 +410,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -436,14 +436,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int64 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int64 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, int64); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8f51e615..a003e797 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -51,15 +51,15 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - int32 types; + uintptr types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -75,18 +75,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -95,11 +95,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -156,7 +156,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -174,8 +174,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 4, chnk + (12 + blksz), uintptr); __PUT(chnk + 12, chnk + 16, uintptr); __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 20, -4, uintptr); + __PUT(chnk + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int32 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (int32 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 4); end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -280,8 +280,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 8, -4, uintptr); + __PUT(end, end + 4, uintptr); if (restsize > 144) { __PUT(adr + 4, restsize, uintptr); } else { @@ -294,7 +294,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 12, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -303,16 +303,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, uintptr); + __PUT(i + 4, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 12, 0, uintptr); i += 16; } - __PUT(adr + 12, 0, int32); + __PUT(adr + 12, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 4, 0, uintptr); + __PUT(adr + 8, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); @@ -327,29 +327,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int32)(uintptr)new) + blksz) - 12; - __PUT(tag - 4, 0, int32); + tag = ((uintptr)(uintptr)new + blksz) - 12; + __PUT(tag - 4, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, int32); - __PUT((int32)(uintptr)new - 4, tag, uintptr); + __PUT(tag + 4, -4, uintptr); + __PUT((uintptr)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int32 q) +static void Heap_Mark (uintptr q) { - int32 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, uintptr); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); - if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -357,7 +357,7 @@ static void Heap_Mark (int32 q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -367,8 +367,8 @@ static void Heap_Mark (int32 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, uintptr); + __PUT(q - 4, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -384,7 +384,7 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -409,14 +409,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -435,14 +435,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 4, uintptr); __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, int32); + __PUT(start + 8, -4, uintptr); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int32 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int32 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -576,10 +576,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -596,7 +596,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,8 +618,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, int32); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1f1b65b4..6712b853 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -52,15 +52,15 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - int64 types; + uintptr types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; +static uintptr Heap_freeList[10]; +static uintptr Heap_bigBlocks; export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; static uintptr Heap_heap, Heap_heapend; @@ -76,18 +76,18 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (uintptr blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (uintptr q); +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); export SYSTEM_PTR Heap_NEWBLK (uintptr size); export SYSTEM_PTR Heap_NEWREC (uintptr tag); static uintptr Heap_NewChunk (uintptr blksz); @@ -96,11 +96,11 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern LONGINT Platform_MainStackFrame; +extern uintptr Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); #define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() @@ -157,7 +157,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) void Heap_REGTYP (Heap_Module m, uintptr typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, uintptr); m->types = typ; } @@ -175,8 +175,8 @@ static uintptr Heap_NewChunk (uintptr blksz) __PUT(chnk + 8, chnk + (24 + blksz), uintptr); __PUT(chnk + 24, chnk + 32, uintptr); __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 40, -8, uintptr); + __PUT(chnk + 48, Heap_bigBlocks, uintptr); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (uintptr blksz) { - int64 size, chnk, j, next; + uintptr size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (int64 blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, uintptr); + __PUT(j, chnk, uintptr); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -237,10 +237,10 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = __ASHL(di, 5); end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; adr += restsize; } @@ -281,8 +281,8 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) restsize = t - blksz; end = adr + restsize; __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 16, -8, uintptr); + __PUT(end, end + 8, uintptr); if (restsize > 288) { __PUT(adr + 8, restsize, uintptr); } else { @@ -295,7 +295,7 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) if (restsize > 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 24, Heap_freeList[di], uintptr); Heap_freeList[di] = adr; } } @@ -304,16 +304,16 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, uintptr); + __PUT(i + 8, 0, uintptr); + __PUT(i + 16, 0, uintptr); + __PUT(i + 24, 0, uintptr); i += 32; } - __PUT(adr + 24, 0, int64); + __PUT(adr + 24, 0, uintptr); __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 8, 0, uintptr); + __PUT(adr + 16, 0, uintptr); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); @@ -328,29 +328,29 @@ SYSTEM_PTR Heap_NEWBLK (uintptr size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((uintptr)&blksz); - tag = (((int64)(uintptr)new) + blksz) - 24; - __PUT(tag - 8, 0, int64); + tag = ((uintptr)(uintptr)new + blksz) - 24; + __PUT(tag - 8, 0, uintptr); __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, int64); - __PUT((int64)(uintptr)new - 8, tag, uintptr); + __PUT(tag + 8, -8, uintptr); + __PUT((uintptr)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (int64 q) +static void Heap_Mark (uintptr q) { - int64 p, tag, fld, n, offset, tagbits; + uintptr p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, uintptr); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); - if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __GET(tag, offset, uintptr); + if (__BIT((uintptr)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, uintptr); if (p == 0) { break; } @@ -358,7 +358,7 @@ static void Heap_Mark (int64 q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, uintptr); fld = q + offset; p = Heap_FetchAddress(fld); __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); @@ -368,8 +368,8 @@ static void Heap_Mark (int64 q) if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, uintptr); + __PUT(q - 8, tag + 1, uintptr); __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; @@ -385,7 +385,7 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(uintptr)p); + Heap_Mark((uintptr)(uintptr)p); } static void Heap_Scan (void) @@ -410,14 +410,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -436,14 +436,14 @@ static void Heap_Scan (void) start = adr - freesize; __PUT(start, start + 8, uintptr); __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, int64); + __PUT(start + 16, -8, uintptr); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], uintptr); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, uintptr); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) { - int64 i, j, x; + uintptr i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) { - int64 l, r, x; + uintptr l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + uintptr tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -577,10 +577,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + uintptr inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -597,7 +597,7 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, uintptr); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,8 +619,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + uintptr cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(uintptr)Heap_modules; @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(uintptr)obj; + f->obj = (uintptr)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, int64); + __PUT(Heap_heap, 0, uintptr); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 11723ec5..926fdaab 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -6,30 +6,30 @@ MODULE Heap; CONST ModNameLen = 20; CmdNameLen = 24; - SZL = SIZE(LONGINT); - Unit = 4*SZL; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) + SZA = SIZE(SYSTEM.UINTPTR); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: free blocks describe themselves: size = Unit tag = &tag++ ->block size - sentinel = -SZL + sentinel = -SZA next *) (* heap chunks *) nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* first block in a chunk *) + endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* first block in a chunk *) (* heap blocks *) tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZL); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZL); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZL); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL); + sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZA); AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); TYPE @@ -46,7 +46,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: LONGINT; + types: SYSTEM.UINTPTR; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -73,8 +73,8 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: LONGINT; + freeList: ARRAY nofLists + 1 OF SYSTEM.UINTPTR; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: SYSTEM.UINTPTR; allocated*: SYSTEM.UINTPTR; firstTry: BOOLEAN; @@ -193,8 +193,8 @@ MODULE Heap; *) PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; - PROCEDURE ExtendHeap(blksz: LONGINT); - VAR size, chnk, j, next: LONGINT; + PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); + VAR size, chnk, j, next: SYSTEM.UINTPTR; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -293,13 +293,13 @@ MODULE Heap; END ; INC(adr, restsize) END ; - i := adr + 4*SZL; end := adr + blksz; + i := adr + 4*SZA; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) SYSTEM.PUT(i, AddressZero); - SYSTEM.PUT(i + SZL, AddressZero); - SYSTEM.PUT(i + 2*SZL, AddressZero); - SYSTEM.PUT(i + 3*SZL, AddressZero); - INC(i, 4*SZL) + SYSTEM.PUT(i + SZA, AddressZero); + SYSTEM.PUT(i + 2*SZA, AddressZero); + SYSTEM.PUT(i + 3*SZA, AddressZero); + INC(i, 4*SZA) END ; SYSTEM.PUT(adr + nextOff, AddressZero); SYSTEM.PUT(adr, tag); @@ -307,57 +307,58 @@ MODULE Heap; SYSTEM.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) + RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); - blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) + blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(LONGINT, new) + blksz - 3*SZL; - SYSTEM.PUT(tag - SZL, AddressZero); (*reserved for meta info*) + tag := SYSTEM.VAL(SYSTEM.UINTPTR, new) + blksz - 3*SZA; + SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZL, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(LONGINT, new) - SZL, tag); + SYSTEM.PUT(tag + SZA, NoPtrSntl); + SYSTEM.PUT(SYSTEM.VAL(SYSTEM.UINTPTR, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: LONGINT); - VAR p, tag, fld, n, offset, tagbits: LONGINT; + PROCEDURE Mark(q: SYSTEM.UINTPTR); + VAR p, tag, offset, fld, n, tagbits: SYSTEM.UINTPTR; BEGIN IF q # 0 THEN - tagbits := FetchAddress(q - SZL); (* Load the tag for the record at q *) + tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) - SYSTEM.PUT(q - SZL, tagbits + 1); (* Mark it *) + SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; - tag := tagbits + SZL; (* Tag addresses first offset *) + tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* If sentinel. (Value is -8*(#fields+1) *) - SYSTEM.PUT(q - SZL, tag + offset + 1); (* Rotate base ptr into tag *) + IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.UINTPTR)*8 - 1) THEN + (* Sentinel reached: Value is -8*(#fields+1) *) + SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - tag := FetchAddress(q - SZL); DEC(tag, 1); + tag := FetchAddress(q - SZA); DEC(tag, 1); SYSTEM.GET(tag, offset); fld := q + offset; p := FetchAddress(fld); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) ELSE (* offset references a ptr field *) fld := q + offset; (* Address the pointer *) n := FetchAddress(fld); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - tagbits := FetchAddress(n - SZL); (* Consider record pointed to by this field *) + tagbits := FetchAddress(n - SZA); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZL, tagbits + 1); - SYSTEM.PUT(q - SZL, tag + 1); + SYSTEM.PUT(n - SZA, tagbits + 1); + SYSTEM.PUT(q - SZA, tag + 1); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, p)); p := q; q := n; tag := tagbits END END END ; - INC(tag, SZL) + INC(tag, SZA) END END END @@ -365,7 +366,7 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(LONGINT, p)) + Mark(SYSTEM.VAL(SYSTEM.UINTPTR, p)) END MarkP; PROCEDURE Scan; @@ -381,7 +382,7 @@ MODULE Heap; IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZA); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; @@ -402,7 +403,7 @@ MODULE Heap; END ; IF freesize > 0 THEN (*collect last block*) start := adr - freesize; - SYSTEM.PUT(start, start+SZL); + SYSTEM.PUT(start, start+SZA); SYSTEM.PUT(start+sizeOff, freesize); SYSTEM.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; @@ -414,8 +415,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: LONGINT; VAR a: ARRAY OF LONGINT); - VAR i, j, x: LONGINT; + PROCEDURE Sift (l, r: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); + VAR i, j, x: SYSTEM.UINTPTR; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -425,15 +426,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: LONGINT; VAR a: ARRAY OF LONGINT); - VAR l, r, x: LONGINT; + PROCEDURE HeapSort (n: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); + VAR l, r, x: SYSTEM.UINTPTR; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: LONGINT; VAR cand: ARRAY OF LONGINT); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: LONGINT; + PROCEDURE MarkCandidates(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.UINTPTR; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -446,7 +447,7 @@ MODULE Heap; size := FetchAddress(tag-1); INC(adr, size) ELSE size := FetchAddress(tag); - ptr := adr + SZL; + ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; next := adr + size; @@ -459,11 +460,11 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: LONGINT; + VAR n: FinNode; tag: SYSTEM.UINTPTR; BEGIN n := fin; WHILE n # NIL DO - tag := FetchAddress(n.obj - SZL); + tag := FetchAddress(n.obj - SZA); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -495,14 +496,14 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern LONGINT Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): LONGINT "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern uintptr Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): SYSTEM.UINTPTR "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: LONGINT; VAR cand: ARRAY OF LONGINT); + PROCEDURE MarkStack(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); VAR frame: SYSTEM.PTR; - inc, nofcand: LONGINT; - sp, p, stack0: LONGINT; + inc, nofcand: SYSTEM.UINTPTR; + sp, p, stack0: SYSTEM.UINTPTR; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -529,8 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: LONGINT; - cand: ARRAY 10000 OF LONGINT; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.UINTPTR; + cand: ARRAY 10000 OF SYSTEM.UINTPTR; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -565,7 +566,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(LONGINT, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(SYSTEM.UINTPTR, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; From 90737e5677fc54c93c12937915b1d0964680495f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 3 Sep 2016 23:28:50 +0100 Subject: [PATCH 019/140] Remove obsolete SYSTEM.ADRINT. (Not that I much like uintptr). --- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPT.c | 4 +--- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 1 - bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/SYSTEM.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPT.c | 4 +--- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 1 - bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/SYSTEM.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPT.c | 4 +--- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 1 - bootstrap/unix-88/SYSTEM.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPT.c | 4 +--- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 1 - bootstrap/windows-48/SYSTEM.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPT.c | 4 +--- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 1 - bootstrap/windows-88/SYSTEM.h | 2 +- src/compiler/OPC.Mod | 6 ++---- src/compiler/OPT.Mod | 3 +-- src/compiler/OPV.Mod | 1 - src/system/Heap.Mod | 4 ++-- src/system/Platformunix.Mod | 4 ++-- src/system/SYSTEM.h | 2 +- 33 files changed, 30 insertions(+), 49 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5b3bea8f..f7f6f6b6 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5b3bea8f..f7f6f6b6 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ee075a94..d4a0fc06 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -201,7 +201,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 94145f3d..d5057c1d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1769,7 +1769,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1852,7 +1851,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e2409b86..aefdfd2a 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index a99c5bfe..7edc861b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -287,7 +287,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 10b51482..8949813a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -200,7 +200,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 32d09e08..f151a183 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1851,7 +1850,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b12f68e2..41a1b2e4 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7a155032..4272132e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -286,7 +286,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ee075a94..d4a0fc06 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -201,7 +201,7 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp || obj->typ == OPT_ainttyp) { + if (obj->typ == OPT_pinttyp) { OPM_WriteString((CHAR*)"uintptr", 8); } else { OPM_WriteString((CHAR*)"int", 4); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 94145f3d..d5057c1d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1769,7 +1769,6 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_inttyp); P(OPT_linttyp); P(OPT_pinttyp); - P(OPT_ainttyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1852,7 +1851,6 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); - OPT_EnterTyp((CHAR*)"ADRINT", 4, OPM_PointerSize, &OPT_ainttyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e2409b86..aefdfd2a 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index a99c5bfe..7edc861b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -287,7 +287,6 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; OPT_pinttyp->strobj->linkadr = 2; - OPT_ainttyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 5b4f9195..f8c71ee8 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -117,10 +117,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - IF (obj.typ = OPT.pinttyp) OR (obj.typ = OPT.ainttyp) THEN - OPM.WriteString("uintptr") - ELSE - OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + IF obj.typ = OPT.pinttyp THEN OPM.WriteString("uintptr") + ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 135d1016..19bfdb47 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - pinttyp*, ainttyp*, + pinttyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1189,7 +1189,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); - EnterTyp("ADRINT", Int, OPM.PointerSize, ainttyp); (* Temporary for bootstrapping *) EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index cd387568..25cc2898 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -206,7 +206,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; OPT.pinttyp^.strobj^.linkadr := PredefinedType; - OPT.ainttyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 926fdaab..00c106dd 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -187,10 +187,10 @@ MODULE Heap; architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT rather than loading 64 bits. - NOTE - with uintpr work complete this function should be replaces withSYSTEM.GET + NOTE - with uintpr work complete this function should be replaced with SYSTEM.GET as there will be no need to extend addresses to larger types. - *) + PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 76c0db89..f950f2a3 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADRINT; + MainStackFrame-: SYSTEM.UINTPTR; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: SYSTEM.ADRINT; + ArgVector-: SYSTEM.UINTPTR; HaltHandler: HaltProcedure; TimeStart: LONGINT; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 2622657f..e7b38a26 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -67,7 +67,7 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -typedef uintptr SYSTEM_ADRINT; + // For 32 bit builds, the size of LONGINT depends on a make option: From a865643d6cc68233d213258b90408d369efb6514 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Sep 2016 14:34:24 +0100 Subject: [PATCH 020/140] Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 20 +-- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 9 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 8 +- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 10 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 51 +++--- bootstrap/unix-44/Platform.h | 18 +-- bootstrap/unix-44/Reals.c | 14 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 14 +- bootstrap/unix-44/SYSTEM.h | 48 +++--- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 20 +-- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 9 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 8 +- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 10 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 51 +++--- bootstrap/unix-48/Platform.h | 18 +-- bootstrap/unix-48/Reals.c | 14 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 14 +- bootstrap/unix-48/SYSTEM.h | 48 +++--- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 20 +-- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 9 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 8 +- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 10 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 51 +++--- bootstrap/unix-88/Platform.h | 18 +-- bootstrap/unix-88/Reals.c | 14 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 14 +- bootstrap/unix-88/SYSTEM.h | 48 +++--- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 20 +-- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 9 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 8 +- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 10 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 90 ++++++----- bootstrap/windows-48/Platform.h | 17 +- bootstrap/windows-48/Reals.c | 14 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 14 +- bootstrap/windows-48/SYSTEM.h | 48 +++--- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 20 +-- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 9 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 8 +- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 10 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 90 ++++++----- bootstrap/windows-88/Platform.h | 17 +- bootstrap/windows-88/Reals.c | 14 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 14 +- bootstrap/windows-88/SYSTEM.h | 48 +++--- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 1 + src/compiler/OPC.Mod | 5 +- src/compiler/OPT.Mod | 4 +- src/compiler/OPV.Mod | 8 +- src/compiler/Vishap.Mod | 2 +- src/system/Heap.Mod | 106 ++++++------- src/system/Platformunix.Mod | 34 ++-- src/system/Platformwindows.Mod | 71 +++++---- src/system/SYSTEM.c | 14 +- src/system/SYSTEM.h | 48 +++--- 215 files changed, 1441 insertions(+), 1410 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bed97db3..ab1d3003 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6157e386..8b4c3700 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 76aee9f2..4444900f 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bed97db3..ab1d3003 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 343d9491..b218c1b0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 776889ff..3174aa9b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b1d34288..c0502177 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index b285b3ec..13a36e69 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(1, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 14855929..0633202c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index fb2ef55f..340af571 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6712b853..b5749b04 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 7db3d54c..bce66b2e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index fe368fa3..544820fd 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5ede35ed..1414fc79 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d4a0fc06..fad896b9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 44c0d929..f410e6d3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 0ac463ca..6c3c14fe 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index bd26983c..9aba4ad7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 5fcf9030..1601514e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d5057c1d..c08c86af 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 7895f7e6..0aab8de3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,12 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[256]; export int32 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,16 +60,16 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Read (int64 h, address p, address l, address *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -88,7 +88,7 @@ export BOOLEAN Platform_TimedOut (int32 e); export BOOLEAN Platform_TooManyFiles (int32 e); export int32 Platform_Truncate (int64 h, int64 l); export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, int64 p, int64 l); +export int32 Platform_Write (int64 h, address p, address l); static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); static void Platform_errint (int64 l); @@ -120,7 +120,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -140,13 +140,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -163,7 +163,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -214,24 +214,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -264,7 +264,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -513,7 +513,7 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) +int32 Platform_Read (int64 h, address p, address l, address *n) { int32 _o_result; *n = Platform_readfile(h, p, l); @@ -528,10 +528,10 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int32 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -543,10 +543,10 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) __RETCHK; } -int32 Platform_Write (int64 h, int64 p, int64 l) +int32 Platform_Write (int64 h, address p, address l) { int32 _o_result; - int64 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -651,7 +651,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -767,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 7b310e29..324566bf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[256]; import int32 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -49,16 +49,16 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Read (int64 h, address p, address l, address *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -76,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int32 e); import BOOLEAN Platform_TooManyFiles (int32 e); import int32 Platform_Truncate (int64 h, int64 l); import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, int64 p, int64 l); +import int32 Platform_Write (int64 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 2, i, int32); + __GET((address)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1b6d1f96..da0c1f86 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 5280395c..88b212f1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index e8858afa..59d184b4 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 990d15c3..d779d5d5 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index bed71868..7a2484a5 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index c2bb7560..f917a7b6 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b9d03b09..d656f5be 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 30095155..1f0bb8e7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 5dd451e1..22698256 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index bcc323cc..f6c994fa 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index c69949e1..5b34dfb9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 308a2a37..0957fcfb 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 41cd7233..01dff049 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a003e797..02e6f1cb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 84914960..fab3561e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2409c160..13abd6d0 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 07797236..1d0b8774 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 8949813a..b702852c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1cd8fb97..70121d63 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index f0a96a82..fce4bdd3 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f727dcde..dc286221 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b8787f9f..e79b5819 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 7a14e8c2..b90cb34b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0e48367c..347c669a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index f151a183..ccfba447 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 95b8b50f..e3a21ae0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,12 +61,12 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -111,9 +112,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -224,24 +225,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +address Platform_OSAllocate (address size) { - int32 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +281,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +560,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 _o_result; int16 result; *n = 0; - result = Platform_readfile(h, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -745,8 +746,23 @@ static void Platform_DisplayHaltCode (int32 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -795,7 +811,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d983649..6d0de5b3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,11 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -49,12 +50,12 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -78,7 +79,7 @@ import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 38d206bb..9ebc1c17 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 343d9491..b218c1b0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 776889ff..3174aa9b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index f2e2ae7d..81b2d70f 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4415a5f2..696219d4 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 6a7aab56..553a3d7d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4e806a33..ba9937e8 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 447b9c81..ab305ed1 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 3d9d98a7..71079dc0 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b1d34288..c0502177 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index b73a59cc..83c649cf 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index cf6feb16..1f5e58a0 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0be3f73d..65de586e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6712b853..b5749b04 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 7db3d54c..bce66b2e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index fe368fa3..544820fd 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5ede35ed..1414fc79 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d4a0fc06..fad896b9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 44c0d929..f410e6d3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 0ac463ca..6c3c14fe 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index bd26983c..9aba4ad7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 5fcf9030..1601514e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d5057c1d..c08c86af 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0135ee93..128d21e0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,11 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[4096]; export int32 Platform_ArgCount; -export int64 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -61,12 +62,12 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -112,9 +113,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +123,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +175,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -225,24 +226,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -int64 Platform_OSAllocate (int64 size) +address Platform_OSAllocate (address size) { - int64 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int64 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +282,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +561,7 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) int32 _o_result; int32 result; *n = 0; - result = Platform_readfile(h, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -746,8 +747,23 @@ static void Platform_DisplayHaltCode (int64 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -796,7 +812,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index f3b3574f..25f6197f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -20,11 +20,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[4096]; import int32 Platform_ArgCount; -import int64 Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,12 +51,12 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -79,7 +80,7 @@ import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 2, i, int32); + __GET((address)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((uintptr)x + 3, c, CHAR); - __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((uintptr)x + 2, c, CHAR); - __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1b6d1f96..da0c1f86 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 5280395c..88b212f1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index e8858afa..59d184b4 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 990d15c3..d779d5d5 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index bed71868..7a2484a5 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index c2bb7560..f917a7b6 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b9d03b09..d656f5be 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 30095155..1f0bb8e7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 5dd451e1..22698256 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index bcc323cc..f6c994fa 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 73832049..44b11ad9 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1213,6 +1213,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN + (* Convert integer constants in place allowing usage in CONST section. *) Convert(x, p.typ) ELSE t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index f8c71ee8..362a72df 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -117,7 +117,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - IF obj.typ = OPT.pinttyp THEN OPM.WriteString("uintptr") + IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) END ELSE @@ -1320,7 +1320,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN n := 0; FOR i := 0 TO 104 DO hashtab[i] := -1 END ; - Enter("adrint"); (* pseudo keyword used by voc *) + Enter("address"); (* pseudo keyword used by voc *) Enter("asm"); Enter("auto"); Enter("break"); @@ -1357,7 +1357,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); - Enter("uintptr"); (* pseudo keyword used by voc *) Enter("uint16"); (* pseudo keyword used by voc *) Enter("uint32"); (* pseudo keyword used by voc *) Enter("uint64"); (* pseudo keyword used by voc *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 19bfdb47..8b21b9a5 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - pinttyp*, + adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1188,7 +1188,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); + EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 25cc2898..7cc0fe38 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,7 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; - OPT.pinttyp^.strobj^.linkadr := PredefinedType; + OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; @@ -565,7 +565,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(uintptr)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(address)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -578,7 +578,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(uintptr)") + OPM.WriteString("(address)") END; expr(l, exprPrec) ELSE @@ -796,7 +796,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.PointerSize) - ELSE OPM.WriteString("((uintptr)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 615a032c..3323883d 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.pinttyp.size := OPM.PointerSize; + OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 00c106dd..e1fc81c4 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -6,7 +6,7 @@ MODULE Heap; CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(SYSTEM.UINTPTR); (* Size of address *) + SZA = SIZE(SYSTEM.ADDRESS); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) nofLists = 9; (* number of free_lists *) heapSize0 = 8000*Unit; (* startup heap size *) @@ -20,17 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZA); - AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); + tagOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.ADDRESS, -SZA); + AddressZero = SYSTEM.VAL(SYSTEM.ADDRESS, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -46,7 +46,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: SYSTEM.UINTPTR; + types: SYSTEM.ADDRESS; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,7 +64,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: SYSTEM.UINTPTR; (* weak pointer *) + obj: SYSTEM.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -73,15 +73,15 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF SYSTEM.UINTPTR; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: SYSTEM.UINTPTR; - allocated*: SYSTEM.UINTPTR; + freeList: ARRAY nofLists + 1 OF SYSTEM.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: SYSTEM.ADDRESS; + allocated*: SYSTEM.ADDRESS; firstTry: BOOLEAN; (* extensible heap *) - heap: SYSTEM.UINTPTR; (* the sorted list of heap chunks *) - heapend: SYSTEM.UINTPTR; (* max possible pointer value (used for stack collection) *) - heapsize*: SYSTEM.UINTPTR; (* the sum of all heap chunk sizes *) + heap: SYSTEM.ADDRESS; (* the sorted list of heap chunks *) + heapend: SYSTEM.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +153,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.ADDRESS); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -162,11 +162,11 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; - PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; + PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -OSAllocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; - VAR chnk: SYSTEM.UINTPTR; + PROCEDURE NewChunk(blksz: SYSTEM.ADDRESS): SYSTEM.ADDRESS; + VAR chnk: SYSTEM.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -191,10 +191,10 @@ MODULE Heap; as there will be no need to extend addresses to larger types. *) - PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; + PROCEDURE -FetchAddress(pointer: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)(*((void**)((address)pointer)))"; - PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); - VAR size, chnk, j, next: SYSTEM.UINTPTR; + PROCEDURE ExtendHeap(blksz: SYSTEM.ADDRESS); + VAR size, chnk, j, next: SYSTEM.ADDRESS; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -218,16 +218,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.ADDRESS): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.ADDRESS)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -310,23 +310,23 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; - VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.ADDRESS): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(SYSTEM.UINTPTR, new) + blksz - 3*SZA; + tag := SYSTEM.VAL(SYSTEM.ADDRESS, new) + blksz - 3*SZA; SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(SYSTEM.UINTPTR, new) - SZA, tag); + SYSTEM.PUT(SYSTEM.VAL(SYSTEM.ADDRESS, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: SYSTEM.UINTPTR); - VAR p, tag, offset, fld, n, tagbits: SYSTEM.UINTPTR; + PROCEDURE Mark(q: SYSTEM.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: SYSTEM.ADDRESS; BEGIN IF q # 0 THEN tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) @@ -336,7 +336,7 @@ MODULE Heap; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.UINTPTR)*8 - 1) THEN + IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.ADDRESS)*8 - 1) THEN (* Sentinel reached: Value is -8*(#fields+1) *) SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; @@ -366,11 +366,11 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(SYSTEM.UINTPTR, p)) + Mark(SYSTEM.VAL(SYSTEM.ADDRESS, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.ADDRESS; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; @@ -415,8 +415,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR i, j, x: SYSTEM.UINTPTR; + PROCEDURE Sift (l, r: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR i, j, x: SYSTEM.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -426,15 +426,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR l, r, x: SYSTEM.UINTPTR; + PROCEDURE HeapSort (n: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR l, r, x: SYSTEM.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.UINTPTR; + PROCEDURE MarkCandidates(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -460,7 +460,7 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: SYSTEM.UINTPTR; + VAR n: FinNode; tag: SYSTEM.ADDRESS; BEGIN n := fin; WHILE n # NIL DO @@ -496,14 +496,14 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern uintptr Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): SYSTEM.UINTPTR "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): SYSTEM.ADDRESS "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); + PROCEDURE MarkStack(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); VAR frame: SYSTEM.PTR; - inc, nofcand: SYSTEM.UINTPTR; - sp, p, stack0: SYSTEM.UINTPTR; + inc, nofcand: SYSTEM.ADDRESS; + sp, p, stack0: SYSTEM.ADDRESS; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -530,8 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.UINTPTR; - cand: ARRAY 10000 OF SYSTEM.UINTPTR; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.ADDRESS; + cand: ARRAY 10000 OF SYSTEM.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -566,7 +566,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(SYSTEM.UINTPTR, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(SYSTEM.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index f950f2a3..cbd5b646 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.UINTPTR; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: SYSTEM.UINTPTR; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -106,11 +106,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate (size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: SYSTEM.UINTPTR) "free((void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -120,7 +120,7 @@ PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -368,16 +368,16 @@ END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"read(fd, (void*)(address)(p), l)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, p, l); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, SYSTEM.ADR(b), LEN(b)); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END @@ -385,11 +385,11 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"write(fd, (void*)(address)(p), l)"; -PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; - VAR written: LONGINT; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): ErrorCode; + VAR written: SYSTEM.ADDRESS; BEGIN written := writefile(h, p, l); IF written < 0 THEN RETURN err() ELSE RETURN 0 END @@ -467,7 +467,7 @@ BEGIN exit(code) END Exit; PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; +PROCEDURE errln; BEGIN errch(0AX) END errln; PROCEDURE errposint(l: LONGINT); BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 7511e427..272180b8 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -30,13 +30,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: LONGINT; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 4096 OF CHAR; ArgCount-: INTEGER; - ArgVector-: LONGINT; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -104,11 +104,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; -PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)"; -PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -118,7 +118,7 @@ PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADRINT)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADRINT)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -412,10 +412,10 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"(address)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) @@ -423,18 +423,18 @@ BEGIN IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN - n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) + n := 0; (* Clear n because readfile takes a SYSTEM.ADDRESS but only updates the bottom 32 bits *) result := readfile(h, SYSTEM.ADR(b), LEN(b), n); IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -552,7 +552,12 @@ BEGIN | -7: errstring("WITH statement type guard failed.") | -8: errstring("SHORT: Value too large for shorter type.") | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-15: errstring("Type descriptor size mismatch.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") |-20: errstring("Too many, or negative number of, elements in dynamic array.") ELSE END @@ -589,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 16681ab8..821a6096 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist From 682fa59e42b4953372ff297bb3ff5c4cdb7c94e1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Sep 2016 16:38:17 +0100 Subject: [PATCH 021/140] Fix mingw windows build. --- bootstrap/windows-48/Platform.c | 14 +++++++------- bootstrap/windows-48/Platform.h | 4 ++-- bootstrap/windows-88/Platform.c | 14 +++++++------- bootstrap/windows-88/Platform.h | 4 ++-- src/system/Platformwindows.Mod | 4 ++-- src/tools/make/configure.c | 1 + 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index e3a21ae0..62a367e1 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -69,8 +69,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -130,7 +130,7 @@ extern void Heap_InitHeap(); #define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) @@ -153,7 +153,7 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN @@ -174,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -538,7 +538,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; int16 result; @@ -555,7 +555,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; int16 result; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d0de5b3..0b6a48d8 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -58,8 +58,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 128d21e0..0f3aae72 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -70,8 +70,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Read (int64 h, address p, address l, address *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -131,7 +131,7 @@ extern void Heap_InitHeap(); #define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) @@ -154,7 +154,7 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN @@ -175,7 +175,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -539,7 +539,7 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) +int32 Platform_Read (int64 h, address p, address l, address *n) { int32 _o_result; int32 result; @@ -556,7 +556,7 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int32 _o_result; int32 result; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 25f6197f..0d17921c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -59,8 +59,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Read (int64 h, address p, address l, address *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 272180b8..9ed6bc8c 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -412,8 +412,8 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): SYSTEM.ADDRESS -"(address)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 28530ece..767763bc 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -19,6 +19,7 @@ #ifdef _WIN32 #define strncasecmp _strnicmp + char* getcwd(char* buf, size_t size); #else #include #include From ebfc60f49dc74e31c32917979054d17538bd9403 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 6 Sep 2016 20:48:22 +0100 Subject: [PATCH 022/140] Define integer sizes before including SYSTEM.h --- bootstrap/unix-44/Configuration.c | 9 +++- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Console.c | 7 ++- bootstrap/unix-44/Console.h | 4 +- bootstrap/unix-44/Files.c | 7 ++- bootstrap/unix-44/Files.h | 4 +- bootstrap/unix-44/Heap.c | 7 ++- bootstrap/unix-44/Heap.h | 6 +-- bootstrap/unix-44/Modules.c | 7 ++- bootstrap/unix-44/Modules.h | 4 +- bootstrap/unix-44/OPB.c | 9 +++- bootstrap/unix-44/OPB.h | 4 +- bootstrap/unix-44/OPC.c | 51 ++++++++++++------- bootstrap/unix-44/OPC.h | 4 +- bootstrap/unix-44/OPM.c | 7 ++- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 7 ++- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 7 ++- bootstrap/unix-44/OPS.h | 4 +- bootstrap/unix-44/OPT.c | 7 ++- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 36 ++++--------- bootstrap/unix-44/OPV.h | 4 +- bootstrap/unix-44/Platform.c | 9 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/Reals.c | 7 ++- bootstrap/unix-44/Reals.h | 4 +- bootstrap/unix-44/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-44/Strings.c | 7 ++- bootstrap/unix-44/Strings.h | 4 +- bootstrap/unix-44/Texts.c | 7 ++- bootstrap/unix-44/Texts.h | 6 +-- bootstrap/unix-44/Vishap.c | 7 ++- bootstrap/unix-44/errors.c | 7 ++- bootstrap/unix-44/errors.h | 4 +- bootstrap/unix-44/extTools.c | 7 ++- bootstrap/unix-44/extTools.h | 4 +- bootstrap/unix-44/vt100.c | 7 ++- bootstrap/unix-44/vt100.h | 4 +- bootstrap/unix-48/Configuration.c | 9 +++- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Console.c | 7 ++- bootstrap/unix-48/Console.h | 4 +- bootstrap/unix-48/Files.c | 7 ++- bootstrap/unix-48/Files.h | 4 +- bootstrap/unix-48/Heap.c | 7 ++- bootstrap/unix-48/Heap.h | 6 +-- bootstrap/unix-48/Modules.c | 7 ++- bootstrap/unix-48/Modules.h | 4 +- bootstrap/unix-48/OPB.c | 9 +++- bootstrap/unix-48/OPB.h | 4 +- bootstrap/unix-48/OPC.c | 51 ++++++++++++------- bootstrap/unix-48/OPC.h | 4 +- bootstrap/unix-48/OPM.c | 7 ++- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 7 ++- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 7 ++- bootstrap/unix-48/OPS.h | 4 +- bootstrap/unix-48/OPT.c | 7 ++- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 36 ++++--------- bootstrap/unix-48/OPV.h | 4 +- bootstrap/unix-48/Platform.c | 9 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/Reals.c | 7 ++- bootstrap/unix-48/Reals.h | 4 +- bootstrap/unix-48/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-48/Strings.c | 7 ++- bootstrap/unix-48/Strings.h | 4 +- bootstrap/unix-48/Texts.c | 7 ++- bootstrap/unix-48/Texts.h | 8 +-- bootstrap/unix-48/Vishap.c | 7 ++- bootstrap/unix-48/errors.c | 7 ++- bootstrap/unix-48/errors.h | 4 +- bootstrap/unix-48/extTools.c | 7 ++- bootstrap/unix-48/extTools.h | 4 +- bootstrap/unix-48/vt100.c | 7 ++- bootstrap/unix-48/vt100.h | 4 +- bootstrap/unix-88/Configuration.c | 10 ++-- bootstrap/unix-88/Configuration.h | 5 +- bootstrap/unix-88/Console.c | 8 ++- bootstrap/unix-88/Console.h | 5 +- bootstrap/unix-88/Files.c | 8 ++- bootstrap/unix-88/Files.h | 5 +- bootstrap/unix-88/Heap.c | 8 ++- bootstrap/unix-88/Heap.h | 7 ++- bootstrap/unix-88/Modules.c | 8 ++- bootstrap/unix-88/Modules.h | 5 +- bootstrap/unix-88/OPB.c | 10 ++-- bootstrap/unix-88/OPB.h | 5 +- bootstrap/unix-88/OPC.c | 52 ++++++++++++------- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 8 ++- bootstrap/unix-88/OPM.h | 5 +- bootstrap/unix-88/OPP.c | 8 ++- bootstrap/unix-88/OPP.h | 5 +- bootstrap/unix-88/OPS.c | 8 ++- bootstrap/unix-88/OPS.h | 5 +- bootstrap/unix-88/OPT.c | 8 ++- bootstrap/unix-88/OPT.h | 5 +- bootstrap/unix-88/OPV.c | 37 ++++---------- bootstrap/unix-88/OPV.h | 5 +- bootstrap/unix-88/Platform.c | 10 ++-- bootstrap/unix-88/Platform.h | 5 +- bootstrap/unix-88/Reals.c | 8 ++- bootstrap/unix-88/Reals.h | 5 +- bootstrap/unix-88/SYSTEM.h | 43 ++++++++-------- bootstrap/unix-88/Strings.c | 8 ++- bootstrap/unix-88/Strings.h | 5 +- bootstrap/unix-88/Texts.c | 8 ++- bootstrap/unix-88/Texts.h | 7 ++- bootstrap/unix-88/Vishap.c | 8 ++- bootstrap/unix-88/errors.c | 8 ++- bootstrap/unix-88/errors.h | 5 +- bootstrap/unix-88/extTools.c | 8 ++- bootstrap/unix-88/extTools.h | 5 +- bootstrap/unix-88/vt100.c | 8 ++- bootstrap/unix-88/vt100.h | 5 +- bootstrap/windows-48/Configuration.c | 9 +++- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Console.c | 7 ++- bootstrap/windows-48/Console.h | 4 +- bootstrap/windows-48/Files.c | 7 ++- bootstrap/windows-48/Files.h | 4 +- bootstrap/windows-48/Heap.c | 7 ++- bootstrap/windows-48/Heap.h | 6 +-- bootstrap/windows-48/Modules.c | 7 ++- bootstrap/windows-48/Modules.h | 4 +- bootstrap/windows-48/OPB.c | 9 +++- bootstrap/windows-48/OPB.h | 4 +- bootstrap/windows-48/OPC.c | 51 ++++++++++++------- bootstrap/windows-48/OPC.h | 4 +- bootstrap/windows-48/OPM.c | 7 ++- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 7 ++- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 7 ++- bootstrap/windows-48/OPS.h | 4 +- bootstrap/windows-48/OPT.c | 7 ++- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 36 ++++--------- bootstrap/windows-48/OPV.h | 4 +- bootstrap/windows-48/Platform.c | 9 ++-- bootstrap/windows-48/Platform.h | 6 +-- bootstrap/windows-48/Reals.c | 7 ++- bootstrap/windows-48/Reals.h | 4 +- bootstrap/windows-48/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-48/Strings.c | 7 ++- bootstrap/windows-48/Strings.h | 4 +- bootstrap/windows-48/Texts.c | 7 ++- bootstrap/windows-48/Texts.h | 8 +-- bootstrap/windows-48/Vishap.c | 7 ++- bootstrap/windows-48/errors.c | 7 ++- bootstrap/windows-48/errors.h | 4 +- bootstrap/windows-48/extTools.c | 7 ++- bootstrap/windows-48/extTools.h | 4 +- bootstrap/windows-48/vt100.c | 7 ++- bootstrap/windows-48/vt100.h | 4 +- bootstrap/windows-88/Configuration.c | 10 ++-- bootstrap/windows-88/Configuration.h | 5 +- bootstrap/windows-88/Console.c | 8 ++- bootstrap/windows-88/Console.h | 5 +- bootstrap/windows-88/Files.c | 8 ++- bootstrap/windows-88/Files.h | 5 +- bootstrap/windows-88/Heap.c | 8 ++- bootstrap/windows-88/Heap.h | 7 ++- bootstrap/windows-88/Modules.c | 8 ++- bootstrap/windows-88/Modules.h | 5 +- bootstrap/windows-88/OPB.c | 10 ++-- bootstrap/windows-88/OPB.h | 5 +- bootstrap/windows-88/OPC.c | 52 ++++++++++++------- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 8 ++- bootstrap/windows-88/OPM.h | 5 +- bootstrap/windows-88/OPP.c | 8 ++- bootstrap/windows-88/OPP.h | 5 +- bootstrap/windows-88/OPS.c | 8 ++- bootstrap/windows-88/OPS.h | 5 +- bootstrap/windows-88/OPT.c | 8 ++- bootstrap/windows-88/OPT.h | 5 +- bootstrap/windows-88/OPV.c | 37 ++++---------- bootstrap/windows-88/OPV.h | 5 +- bootstrap/windows-88/Platform.c | 10 ++-- bootstrap/windows-88/Platform.h | 7 ++- bootstrap/windows-88/Reals.c | 8 ++- bootstrap/windows-88/Reals.h | 5 +- bootstrap/windows-88/SYSTEM.h | 43 ++++++++-------- bootstrap/windows-88/Strings.c | 8 ++- bootstrap/windows-88/Strings.h | 5 +- bootstrap/windows-88/Texts.c | 8 ++- bootstrap/windows-88/Texts.h | 7 ++- bootstrap/windows-88/Vishap.c | 8 ++- bootstrap/windows-88/errors.c | 8 ++- bootstrap/windows-88/errors.h | 5 +- bootstrap/windows-88/extTools.c | 8 ++- bootstrap/windows-88/extTools.h | 5 +- bootstrap/windows-88/vt100.c | 8 ++- bootstrap/windows-88/vt100.h | 5 +- src/compiler/OPB.Mod | 2 +- src/compiler/OPC.Mod | 76 +++++++++++++++++++--------- src/compiler/OPM.cmdln.Mod | 8 +-- src/compiler/OPV.Mod | 16 +----- src/system/Platformunix.Mod | 2 - src/system/Platformwindows.Mod | 2 - src/system/SYSTEM.h | 43 ++++++++-------- src/tools/make/configure.c | 6 +++ 208 files changed, 1164 insertions(+), 787 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8b4c3700..9314c178 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 4444900f..ce868328 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -169,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 7a2cc9d0..8cbc9ce9 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 87b9a0a5..d596986e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4fc7ce7e..b0f34806 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 056a333c..43761270 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -728,7 +733,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -745,7 +749,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ab1d3003..0f9c0290 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -80,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 13a36e69..3dc7b5ab 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0633202c..29b0069e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 340af571..60221720 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 0aab8de3..70c9bcb7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -729,7 +733,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -746,7 +749,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 324566bf..1ffe3227 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef @@ -81,4 +80,4 @@ import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT import void *Platform__init(void); -#endif +#endif // Platform diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 560d018b..115f8dec 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" @@ -13,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index ac266eec..84e8427b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h @@ -12,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b34dfb9..0b87cb07 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index fd32774b..e9913d2d 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h @@ -20,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0957fcfb..930aa8c9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 01dff049..55b2a130 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h @@ -67,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 02e6f1cb..2bbe63b2 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index ca1d8e95..6694ef70 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -51,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index fab3561e..e31876fb 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 13abd6d0..4bd4082d 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h @@ -51,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 1d0b8774..0a1a9f63 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1912,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 465ba585..5ffa3869 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h @@ -46,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index b702852c..5666c7cd 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -834,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_EndStat(); } @@ -917,12 +922,20 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1210,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1297,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1310,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 2839fb0f..e1fc08ec 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h @@ -48,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 70121d63..461b5b85 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fce4bdd3..c60f6f98 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -62,4 +62,4 @@ import void OPM_err (int16 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dc286221..1ab60658 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e79b5819..ce85af11 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h @@ -13,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b90cb34b..3a1c4787 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 347c669a..512cfa75 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -25,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index ccfba447..1983daf5 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index ce146e6f..d3b24cc6 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -103,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index da9a8429..a62894dd 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -16,7 +21,6 @@ static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -34,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int32 dim); export void OPV_Module (OPT_Node prog); -static int32 OPV_NaturalAlignment (int32 size, int32 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int32 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); @@ -51,24 +54,6 @@ static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int32 OPV_NaturalAlignment (int32 size, int32 max) -{ - int32 _o_result; - int32 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int16 f, c; @@ -108,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -568,7 +550,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__28; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -644,9 +626,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 600b19bd..b10704dc 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h @@ -16,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 62a367e1..bdf72323 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef @@ -774,7 +779,6 @@ static void Platform_DisplayHaltCode (int32 code) void Platform_Halt (int32 code) { - int16 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -791,7 +795,6 @@ void Platform_Halt (int32 code) void Platform_AssertFail (int32 code) { - int16 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0b6a48d8..d1466be1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,7 @@ typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; @@ -82,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8fe37010..5f3d11a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9ebc1c17..cf931556 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -20,4 +20,4 @@ import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a642190c..7e1a6845 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index f537406e..59076121 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h @@ -20,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b218c1b0..a4267893 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 3174aa9b..2238689d 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -30,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int32 _prvt0; char _prvt1[15]; } Texts_RunDesc; @@ -86,7 +86,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - LONGREAL _prvt0; + int64 _prvt0; char _prvt1[24]; CHAR nextCh; int16 line, class; @@ -170,4 +170,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 81b2d70f..549268e2 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a5576d43..a2f7cf75 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 696219d4..bf0e9564 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h @@ -15,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 553a3d7d..27ef9f8f 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ba9937e8..c5d5c772 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h @@ -13,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index ab305ed1..912e5e83 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 71079dc0..36c0bc7e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h @@ -34,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c0502177..cfce02b8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" @@ -14,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 73002e87..84e8427b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h -#define LARGE #include "SYSTEM.h" @@ -13,4 +12,4 @@ import CHAR Configuration_versionLong[41]; import void *Configuration__init(void); -#endif +#endif // Configuration diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 83c649cf..c9058a13 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index bcf5714f..1f1182fd 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Console_String (CHAR *s, LONGINT s__len); import void *Console__init(void); -#endif +#endif // Console diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f5e58a0..61842215 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 65de586e..2c581e47 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h -#define LARGE #include "SYSTEM.h" typedef @@ -68,4 +67,4 @@ import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT import void *Files__init(void); -#endif +#endif // Files diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b5749b04..1fe3ce13 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b547af41..def46dcf 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h -#define LARGE #include "SYSTEM.h" typedef @@ -23,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[72]; } Heap_ModuleDesc; @@ -52,4 +51,4 @@ import void Heap_Unlock (void); import void *Heap__init(void); -#endif +#endif // Heap diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index bce66b2e..9d93e3d2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 544820fd..f9e49aa7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h -#define LARGE #include "SYSTEM.h" typedef @@ -52,4 +51,4 @@ import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m -#endif +#endif // Modules diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 1414fc79..11b9a1a9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -1913,7 +1917,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != (int64)OPM_LIntSize) { + if (x->typ->size != OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 718d88bb..c3c5c1e8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" #include "OPT.h" @@ -47,4 +46,4 @@ import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); -#endif +#endif // OPB diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fad896b9..e971762c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -835,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_LIntSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_EndStat(); } @@ -918,12 +922,20 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); - if (align == (int64)OPM_IntSize) { - OPM_WriteString((CHAR*)"INTEGER", 8); - } else if (align == (int64)OPM_LIntSize) { - OPM_WriteString((CHAR*)"LONGINT", 8); - } else if (align == (int64)OPM_LRealSize) { - OPM_WriteString((CHAR*)"LONGREAL", 9); + switch (align) { + case 2: + OPM_WriteString((CHAR*)"int16", 6); + break; + case 4: + OPM_WriteString((CHAR*)"int32", 6); + break; + case 8: + OPM_WriteString((CHAR*)"int64", 6); + break; + default: + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Unexpected enclosing alignment in FillGap.", 43); + break; } OPC_Str1((CHAR*)" _prvt#", 8, *n); *n += 1; @@ -1211,7 +1223,8 @@ void OPC_GenHdr (OPT_Node n) OPM_WriteLn(); OPC_CProcDefs(OPT_topScope->right, 1); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#endif", 7); + OPM_WriteString((CHAR*)"#endif // ", 11); + OPM_WriteStringVar((void*)OPM_modName, 32); OPM_WriteLn(); } @@ -1298,10 +1311,6 @@ void OPC_GenHdrIncludes (void) OPM_WriteString((CHAR*)"__h", 4); OPM_WriteLn(); OPM_WriteLn(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 1); OPM_WriteLn(); @@ -1311,10 +1320,17 @@ void OPC_GenBdy (OPT_Node n) { OPM_currFile = 1; OPC_GenHeaderMsg(); - if (OPM_LIntSize == 8) { - OPM_WriteString((CHAR*)"#define LARGE", 14); - OPM_WriteLn(); - } + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); + OPM_WriteLn(); + OPM_WriteLn(); OPC_Include((CHAR*)"SYSTEM", 7); OPC_IncludeImports(OPT_topScope->right, 0); OPM_WriteLn(); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ac5c7677..a218490a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -49,4 +48,4 @@ import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); -#endif +#endif // OPC diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f410e6d3..389fda93 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index cc77f079..51042a0e 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h -#define LARGE #include "SYSTEM.h" @@ -63,4 +62,4 @@ import void OPM_err (int32 n); import void *OPM__init(void); -#endif +#endif // OPM diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 6c3c14fe..9ab86b22 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9aba4ad7..ce85af11 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -14,4 +13,4 @@ import void OPP_Module (OPT_Node *prog, SET opt); import void *OPP__init(void); -#endif +#endif // OPP diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e0988fb0..8e53d027 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1601514e..ffbc5084 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h -#define LARGE #include "SYSTEM.h" typedef @@ -26,4 +25,4 @@ import void OPS_Init (void); import void *OPS__init(void); -#endif +#endif // OPS diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c08c86af..bd27c789 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f50911dd..583c31ff 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h -#define LARGE #include "SYSTEM.h" #include "OPS.h" @@ -104,4 +103,4 @@ import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); import void *OPT__init(void); -#endif +#endif // OPT diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b8c77e55..2d81dd31 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -17,7 +21,6 @@ static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -static BOOLEAN OPV_naturalAlignment; export LONGINT *OPV_ExitInfo__typ; @@ -35,7 +38,6 @@ export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); -static int64 OPV_NaturalAlignment (int64 size, int64 max); static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int64 size); static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); @@ -52,24 +54,6 @@ static void OPV_expr (OPT_Node n, int32 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -static int64 OPV_NaturalAlignment (int64 size, int64 max) -{ - int64 _o_result; - int64 i; - if (size >= max) { - _o_result = max; - return _o_result; - } else { - i = 1; - while (i < size) { - i += i; - } - _o_result = i; - return _o_result; - } - __RETCHK; -} - void OPV_TypSize (OPT_Struct typ) { int32 f, c; @@ -109,9 +93,6 @@ void OPV_TypSize (OPT_Struct typ) if (offset == 0) { offset = 1; } - if (OPM_RecSize == 0) { - base = OPV_NaturalAlignment(offset, OPC_SizeAlignment(OPM_RecSize)); - } OPC_Align(&offset, base); if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { OPV_recno += 1; @@ -569,7 +550,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPT_Struct typ = NIL; int32 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__28; + int32 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -645,9 +626,9 @@ static void OPV_design (OPT_Node n, int32 prec) } x = x->left; } - _for__28 = dims; + _for__27 = dims; i = 1; - while (i <= _for__28) { + while (i <= _for__27) { OPM_Write(')'); i += 1; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 92c13a0a..b10704dc 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h -#define LARGE #include "SYSTEM.h" #include "OPT.h" @@ -17,4 +16,4 @@ import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); -#endif +#endif // OPV diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0f3aae72..dda7a46a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef @@ -775,7 +779,6 @@ static void Platform_DisplayHaltCode (int64 code) void Platform_Halt (int64 code) { - int32 e; Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { (*Platform_HaltHandler)(code); @@ -792,7 +795,6 @@ void Platform_Halt (int64 code) void Platform_AssertFail (int64 code) { - int32 e; Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { Platform_errstring((CHAR*)" ASSERT code ", 14); diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0d17921c..472cf2f1 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,14 +1,13 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h -#define LARGE #include "SYSTEM.h" typedef struct Platform_FileIdentity { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[32]; } Platform_FileIdentity; @@ -83,4 +82,4 @@ import void *Platform__init(void); #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#endif +#endif // Platform diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 80ca4829..0b5761ee 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index da0c1f86..dfc56cef 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import LONGREAL Reals_TenL (int32 e); import void *Reals__init(void); -#endif +#endif // Reals diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f240e3b4..39f247ba 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 88b212f1..2c6a801d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h -#define LARGE #include "SYSTEM.h" @@ -21,4 +20,4 @@ import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR import void *Strings__init(void); -#endif +#endif // Strings diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 59d184b4..a78b77bb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index d779d5d5..7156eb22 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h -#define LARGE #include "SYSTEM.h" #include "Files.h" @@ -31,7 +30,7 @@ typedef typedef struct Texts_RunDesc { - LONGINT _prvt0; + int64 _prvt0; char _prvt1[27]; } Texts_RunDesc; @@ -170,4 +169,4 @@ import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGIN import void *Texts__init(void); -#endif +#endif // Texts diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7a2484a5..46a95ea9 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 1d7e852f..9c9ed747 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f917a7b6..bf0e9564 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h -#define LARGE #include "SYSTEM.h" typedef @@ -16,4 +15,4 @@ import errors_string errors_errors[350]; import void *errors__init(void); -#endif +#endif // errors diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d656f5be..c3dc490a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 1f0bb8e7..c5d5c772 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h -#define LARGE #include "SYSTEM.h" @@ -14,4 +13,4 @@ import void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEA import void *extTools__init(void); -#endif +#endif // extTools diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 22698256..fac0e0ba 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,5 +1,9 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ -#define LARGE +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ + +#define INTEGER int32 +#define LONGINT int64 +#define SET uint64 + #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f6c994fa..c2ebcd84 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,9 +1,8 @@ -/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h -#define LARGE #include "SYSTEM.h" @@ -35,4 +34,4 @@ import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); -#endif +#endif // vt100 diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 44b11ad9..ee6dc10a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1034,7 +1034,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END + IF x.typ.size # OPT.linttyp.size THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END |OPT.adrfn: (*SYSTEM.ADR*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 362a72df..c5b16ad0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.LIntSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); EndStat END TDescDecl; @@ -589,6 +589,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) RETURN alignment END SizeAlignment; + PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; VAR alignment: LONGINT; BEGIN @@ -606,16 +607,24 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); + (* gap: Required gap - already calculated based on alignment requirements + off: Current offset - where gap begins + align: Containing record type alignment + n: Next ordinal to use for private field names + curAlign: Largest alignment of any field so far + *) VAR adr: LONGINT; BEGIN adr := off; Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); BegStat; - IF align = OPM.IntSize THEN OPM.WriteString("INTEGER") - ELSIF align = OPM.LIntSize THEN OPM.WriteString("LONGINT") - ELSIF align = OPM.LRealSize THEN OPM.WriteString("LONGREAL") - END ; + CASE align OF + |2: OPM.WriteString("int16") + |4: OPM.WriteString("int32") + |8: OPM.WriteString("int64") + ELSE OPM.LogWLn; OPM.LogWStr("Unexpected enclosing alignment in FillGap.") + END; Str1(" _prvt#", n); INC(n); EndStat; curAlign := align END ; @@ -625,30 +634,44 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE FieldList (typ: OPT.Struct; last: BOOLEAN; VAR off, n, curAlign: LONGINT); VAR fld: OPT.Object; base: OPT.Struct; gap, adr, align, fldAlign: LONGINT; BEGIN - fld := typ.link; align := typ^.align MOD 10000H; + fld := typ.link; + align := typ^.align MOD 10000H; IF typ.BaseTyp # NIL THEN FieldList(typ.BaseTyp, FALSE, off, n, curAlign) ELSE off := 0; n := 0; curAlign := 1 - END ; + END; + (* off: Current offset into record + align: Overall (RECORD) alignment + curAlign: Current alignment - largest alignment of any field so far + n: Next ordinal to use for private field names + *) WHILE (fld # NIL) & (fld.mode = OPT.Fld) DO - IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) OR - (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + IF (OPM.currFile = OPM.HeaderFile) & (fld.vis = OPT.internal) + OR (OPM.currFile = OPM.BodyFile) & (fld.vis = OPT.internal) & (typ^.mno # 0) THEN + (* Skip private fields *) fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END ; + WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.vis = OPT.internal) DO fld := fld.link END; ELSE (* mimic OPV.TypSize to detect gaps caused by private fields *) - adr := off; fldAlign := BaseAlignment(fld^.typ); Align(adr, fldAlign); + adr := off; + fldAlign := BaseAlignment(fld^.typ); + Align(adr, fldAlign); gap := fld.adr - adr; - IF fldAlign > curAlign THEN curAlign := fldAlign END ; - IF gap > 0 THEN FillGap(gap, off, align, n, curAlign) END ; + IF fldAlign > curAlign THEN curAlign := fldAlign END; + IF gap > 0 THEN + FillGap(gap, off, align, n, curAlign) + END; BegStat; DeclareBase(fld); OPM.Write(' '); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; base := fld.typ; fld := fld.link; - WHILE (fld # NIL) & (fld.mode = OPT.Fld) & (fld.typ = base) & (fld.adr = off) + WHILE (fld # NIL) + & (fld.mode = OPT.Fld) + & (fld.typ = base) + & (fld.adr = off) (* ?? *) & ((OPM.currFile = OPM.BodyFile) OR (fld.vis # OPT.internal) OR (fld.typ.strobj = NIL)) DO OPM.WriteString(", "); DeclareObj(fld, FALSE); off := fld.adr + fld.typ.size; fld := fld.link - END ; + END; EndStat END - END ; + END; IF last THEN adr := typ.size - typ^.sysflag DIV 100H; IF adr = 0 THEN gap := 1 (* avoid empty struct *) ELSE gap := adr - off END ; @@ -807,7 +830,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteStringVar(OPM.modName); OPM.WriteString(BodyNameExt); EndStat; OPM.WriteLn; CProcDefs(OPT.topScope^.right, 1); OPM.WriteLn; - OPM.WriteString("#endif"); OPM.WriteLn + OPM.WriteString("#endif // "); OPM.WriteStringVar(OPM.modName); OPM.WriteLn END GenHdr; PROCEDURE GenHeaderMsg; @@ -848,7 +871,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("#ifndef "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteString("#define "); OPM.WriteStringVar(OPM.modName); OPM.WriteString(FlagExt); OPM.WriteLn; OPM.WriteLn; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 1); OPM.WriteLn END GenHdrIncludes; @@ -857,7 +880,14 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN OPM.currFile := OPM.BodyFile; GenHeaderMsg; - IF OPM.LIntSize = 8 THEN OPM.WriteString("#define LARGE"); OPM.WriteLn END; + OPM.WriteLn; + + (* Define adjustable type sizes *) + OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + OPM.WriteLn; + Include(BasicIncludeFile); IncludeImports(OPT.topScope^.right, 0); OPM.WriteLn; DefAnonRecs(n); @@ -1001,10 +1031,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) (* If there will be a result, provide a result variable. *) IF proc^.typ # OPT.notyp THEN BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; + Ident(proc^.typ^.strobj); + OPM.WriteString(" _o_result;"); + OPM.WriteLn; + END; scope := proc^.scope; IdentList(scope^.scope, 0); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 10ee8ebb..a7810f0c 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -9,7 +9,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CONST OptionChar* = "-"; - (* compiler options; don't change the encoding *) + (* compiler option flag bits; don't change the encoding *) inxchk* = 0; (* index check on *) ranchk* = 2; (* range check on *) typchk* = 3; (* type check on *) @@ -49,12 +49,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxStruct* = 255; - (* maximal number of pointer fields in a record: *) - MaxPtr* = MAX(LONGINT); - - (* maximal number of global pointers per module: *) - MaxGPtr* = MAX(LONGINT); - (* maximal number of hidden fields in an exported record: *) MaxHdFld* = 2048; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7cc0fe38..61125e5b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -50,24 +50,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR assert, inxchk, mainprog, ansi: BOOLEAN; stamp: INTEGER; (* unique number for nested objects *) - (*recno: INTEGER;*) (* number of anonymous record types *) recno: LONGINT; (* number of anonymous record types *) exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - naturalAlignment: BOOLEAN; - PROCEDURE NaturalAlignment(size, max: LONGINT): LONGINT; - VAR i: LONGINT; - BEGIN - IF size >= max THEN RETURN max - ELSE i := 1; - WHILE i < size DO INC(i, i) END ; - RETURN i - END - END NaturalAlignment; - PROCEDURE TypSize*(typ: OPT.Struct); VAR f, c: INTEGER; offset, size, base, fbase, off0: LONGINT; fld: OPT.Object; btyp: OPT.Struct; @@ -87,10 +75,10 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 fld^.adr := offset; INC(offset, size); IF fbase > base THEN base := fbase END ; fld := fld^.link - END ; + END; + (* base is now the largest alignment of any field *) off0 := offset; IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - IF OPM.RecSize = 0 THEN base := NaturalAlignment(offset, (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize)) END ; OPC.Align(offset, base); IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; typ^.size := offset; typ^.align := base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index cbd5b646..6c86de7c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -499,7 +499,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -510,7 +509,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 9ed6bc8c..a81507d9 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -564,7 +564,6 @@ BEGIN END DisplayHaltCode; PROCEDURE Halt*(code: LONGINT); -VAR e: ErrorCode; BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -575,7 +574,6 @@ BEGIN END Halt; PROCEDURE AssertFail*(code: LONGINT); -VAR e: ErrorCode; BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 8c6c335e..6fc57309 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -1,6 +1,24 @@ #ifndef SYSTEM__h #define SYSTEM__h + + +#ifndef LONGINT + #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #define INTEGER int32 + #define LONGINT int64 + #define SET uint64 + #else + #define INTEGER int16 + #define LONGINT int32 + #define SET uint32 + #endif +#endif + + + + + // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. @@ -22,10 +40,12 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if defined(_WIN64) +#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) + // ILP32 or LLP64 typedef long long int64; typedef unsigned long long uint64; #else + // LP64 typedef long int64; typedef unsigned long uint64; #endif @@ -67,29 +87,10 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; +#define uSET SET -// For 32 bit builds, the size of LONGINT depends on a make option: - -#if (__SIZEOF_POINTER__ == 8) || defined(LARGE) || defined(_WIN64) - typedef int32 INTEGER; - typedef int64 LONGINT; - typedef uint64 SET; - typedef uint64 uSET; -#else - typedef int16 INTEGER; - typedef int32 LONGINT; - typedef uint32 SET; - typedef uint32 uSET; -#endif - - -// Temporary defs while bootstrapping - -#define uLONGINT uint64 - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 767763bc..a74b40e8 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -421,6 +421,12 @@ void writeConfigurationMod() { int main(int argc, char *argv[]) { + // Make sure SYSTEM.h has set up our core data types correctly. + assert(sizeof(int8) == 1, "sizeof(int8) is not 1."); + assert(sizeof(int16) == 2, "sizeof(int16) is not 2."); + assert(sizeof(int32) == 4, "sizeof(int32) is not 4."); + assert(sizeof(int64) == 8, "sizeof(int64) is not 8."); + oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); if (argc>1) { From 83aaa702903322b1eb7b23f6a84e4765ce0ca39d Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 9 Sep 2016 14:47:40 +0100 Subject: [PATCH 023/140] SYSTEM.ADDRESS signed (again), DIV, MOD full integer support, ASH and checks support 64 bit ints. Change (back) to address type being signed. DIV and MOD fully defined for the full range of integer on both parameters. _X, _XF, _R and _RF checks upgraded for 64 bit support. ASH upgraded for 64 bit. Add div and mod tests to language confidence test. Enable debuggable C compiler options. --- makefile | 3 + src/system/Heap.Mod | 3 +- src/system/SYSTEM.c | 46 ++++++---- src/system/SYSTEM.h | 90 +++++++++++-------- src/test/confidence/language/TestLanguage.mod | 54 +++++++++++ src/test/confidence/planned-binary-change | 2 +- src/test/confidence/testenv.sh | 2 +- src/tools/make/configure.c | 10 +-- 8 files changed, 146 insertions(+), 64 deletions(-) diff --git a/makefile b/makefile index 3840589a..31f5fa39 100644 --- a/makefile +++ b/makefile @@ -226,6 +226,9 @@ uninstall: configuration confidence: configuration @make -f src/tools/make/vishap.make -s confidence +planned-binary-change: + @date >src/test/confidence/planned-binary-change + diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index e1fc81c4..bf3d0d7f 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -336,8 +336,7 @@ MODULE Heap; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.ADDRESS)*8 - 1) THEN - (* Sentinel reached: Value is -8*(#fields+1) *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6fc57309..881004ba 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,6 +2,8 @@ #define SYSTEM__h +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) @@ -25,11 +27,14 @@ #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) #if defined(_WIN64) typedef unsigned long long size_t; + typedef long long address; #else typedef unsigned long size_t; + typedef long address; #endif #else typedef unsigned int size_t; + typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -59,7 +64,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +108,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +158,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +179,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +195,28 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +269,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index d3653c0b..3db99f44 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -108,6 +108,59 @@ BEGIN END END TestValue; + +PROCEDURE side(i: INTEGER): INTEGER; BEGIN RETURN i END side; + +PROCEDURE DivMod; + VAR i,j: INTEGER; +BEGIN + j := 2; + i := 4; TestValue(i DIV j, 2, "4 DIV 2"); TestValue(side(i) DIV side(j), 2, "side(4) DIV side(2)"); + i := 5; TestValue(i DIV j, 2, "5 DIV 2"); TestValue(side(i) DIV side(j), 2, "side(5) DIV side(2)"); + i := 6; TestValue(i DIV j, 3, "6 DIV 2"); TestValue(side(i) DIV side(j), 3, "side(6) DIV side(2)"); + i := 7; TestValue(i DIV j, 3, "7 DIV 2"); TestValue(side(i) DIV side(j), 3, "side(7) DIV side(2)"); + i := -4; TestValue(i DIV j, -2, "(-4) DIV 2"); TestValue(side(i) DIV side(j), -2, "side(-4) DIV side(2)"); + i := -5; TestValue(i DIV j, -3, "(-5) DIV 2"); TestValue(side(i) DIV side(j), -3, "side(-5) DIV side(2)"); + i := -6; TestValue(i DIV j, -3, "(-6) DIV 2"); TestValue(side(i) DIV side(j), -3, "side(-6) DIV side(2)"); + i := -7; TestValue(i DIV j, -4, "(-7) DIV 2"); TestValue(side(i) DIV side(j), -4, "side(-7) DIV side(2)"); + + j := -2; + i := 4; TestValue(i DIV j, -2, "4 DIV (-2)"); TestValue(side(i) DIV side(j), -2, "side(4) DIV side(-2)"); + i := 5; TestValue(i DIV j, -3, "5 DIV (-2)"); TestValue(side(i) DIV side(j), -3, "side(5) DIV side(-2)"); + i := 6; TestValue(i DIV j, -3, "6 DIV (-2)"); TestValue(side(i) DIV side(j), -3, "side(6) DIV side(-2)"); + i := 7; TestValue(i DIV j, -4, "7 DIV (-2)"); TestValue(side(i) DIV side(j), -4, "side(7) DIV side(-2)"); + i := -4; TestValue(i DIV j, 2, "(-4) DIV (-2)"); TestValue(side(i) DIV side(j), 2, "side(-4) DIV side(-2)"); + i := -5; TestValue(i DIV j, 2, "(-5) DIV (-2)"); TestValue(side(i) DIV side(j), 2, "side(-5) DIV side(-2)"); + i := -6; TestValue(i DIV j, 3, "(-6) DIV (-2)"); TestValue(side(i) DIV side(j), 3, "side(-6) DIV side(-2)"); + i := -7; TestValue(i DIV j, 3, "(-7) DIV (-2)"); TestValue(side(i) DIV side(j), 3, "side(-7) DIV side(-2)"); + + (* x = (x DIV y) * y + (x MOD y) + => x MOd y = x - ((x DIV y) * y) + *) + + + i := 4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD 3"); + i := 5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD 3"); + i := 6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD 3"); + i := 7; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "7 MOD 3"); + + i := -4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-4 MOD 3"); + i := -5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-5 MOD 3"); + i := -6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-6 MOD 3"); + i := -7; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "-7 MOD 3"); + + i := 4; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD -3"); + i := 5; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD -3"); + i := 6; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD -3"); + i := 7; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "7 MOD -3"); + + i := -4; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-4 MOD -3"); + i := -5; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-5 MOD -3"); + i := -6; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-6 MOD -3"); + i := -7; j := -3; TestValue(i MOD j, i - ((i DIV j) * j), "-7 MOD -3"); +END DivMod; + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -136,6 +189,7 @@ END IntSize; BEGIN Shift; + DivMod; IntSize; Console.String("Language tests successful."); Console.Ln; END TestLanguage. diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 61780798..3c9d13b0 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -b +09 Sep 2016 14:20:47 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index 63d5fa26..d61ba439 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -22,5 +22,5 @@ rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm # NOTE 2: The cygwin 64 bit build has relocation errors with # these assembly generation options. if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ] -then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm" +then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map" fi diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index a74b40e8..b3c46d3e 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,20 +131,20 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g"; + cc = "i686-w64-mingw32-gcc -g -Og"; } else { - cc = "x86_64-w64-mingw32-gcc -g"; + cc = "x86_64-w64-mingw32-gcc -g -Og"; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g"; + cc = "clang -fPIC -g -O1"; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g"; + cc = "gcc -g -Og"; } else { - cc = "gcc -fPIC -g"; + cc = "gcc -fPIC -g -Og"; } #elif defined(_MSC_VER) compiler = "MSC"; From 24aa3c6508b9d8c93629c8afd6539ab54609e0a2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 10 Sep 2016 12:24:06 +0100 Subject: [PATCH 024/140] -Ob not working on my FreeBSD, use -O1. Better LP64 detection for OpenBSD. --- src/system/SYSTEM.h | 21 +++++++++++++-------- src/tools/make/configure.c | 8 ++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 881004ba..e32fb677 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -2,11 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + // Temporary while bootstrapping and clearing up SYSTEM.c. #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -24,7 +30,7 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; typedef long long address; @@ -45,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -205,7 +211,6 @@ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - extern int64 SYSTEM_DIV(int64 x, int64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index b3c46d3e..10886067 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -131,9 +131,9 @@ void determineCCompiler() { #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g -Og"; + cc = "i686-w64-mingw32-gcc -g -O1"; } else { - cc = "x86_64-w64-mingw32-gcc -g -Og"; + cc = "x86_64-w64-mingw32-gcc -g -O1"; } #elif defined(__clang__) compiler = "clang"; @@ -142,9 +142,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -Og"; + cc = "gcc -g -O1"; } else { - cc = "gcc -fPIC -g -Og"; + cc = "gcc -fPIC -g -O1"; } #elif defined(_MSC_VER) compiler = "MSC"; From 1bce6ac9b0d4f7e9e093965d9431299bd568542f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Sep 2016 18:00:35 +0100 Subject: [PATCH 025/140] Make address just a synonym for int32 or int64. --- src/system/SYSTEM.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index e32fb677..168b0beb 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -33,14 +33,14 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; - typedef long long address; +// typedef long long address; #else typedef unsigned long size_t; - typedef long address; +// typedef long address; #endif #else typedef unsigned int size_t; - typedef int address; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,6 +71,13 @@ typedef signed char int8; typedef unsigned char uint8; +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. From 74a085dda3b8c0e10cb12b43817015aa6043a511 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 11 Sep 2016 18:33:30 +0100 Subject: [PATCH 026/140] Update bootstrap. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 4 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 46 ++++++----- bootstrap/unix-44/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 4 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 46 ++++++----- bootstrap/unix-48/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 4 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 46 ++++++----- bootstrap/unix-88/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 4 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 46 ++++++----- bootstrap/windows-48/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 4 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 46 ++++++----- bootstrap/windows-88/SYSTEM.h | 116 +++++++++++++++++---------- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- 205 files changed, 715 insertions(+), 525 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 8cbc9ce9..6181cbfd 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index d596986e..f98f4e55 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b0f34806..de420c7c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 43761270..b8559160 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0f9c0290..868c4e52 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9314c178..ace0257e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ce868328..e52c65ca 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 8cbc9ce9..6181cbfd 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index d596986e..f98f4e55 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b0f34806..de420c7c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 43761270..b8559160 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0f9c0290..868c4e52 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index a4267893..c40b975f 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 2238689d..0aac4cc8 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index cfce02b8..b5ee44a5 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 3dc7b5ab..74de0b0a 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 1f1182fd..1d06d0fe 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 29b0069e..aabcb14d 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 60221720..054cde33 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1fe3ce13..d0175b87 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 8; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 63)) { + if (offset < 0) { __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index def46dcf..fabb54ef 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9d93e3d2..53bf2640 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f9e49aa7..8e54ce53 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 11b9a1a9..f22a9ab5 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index c3c5c1e8..aa26ea1c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e971762c..8916c00b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a218490a..71b95812 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 389fda93..b15aba16 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 51042a0e..d23aed25 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9ab86b22..3f77df4f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 8e53d027..491faa22 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index ffbc5084..3937b6f6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index bd27c789..da8bab08 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 583c31ff..668c3d79 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 2d81dd31..52fc9966 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 70c9bcb7..9142bf02 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1ffe3227..e52525fd 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0b5761ee..185aec0b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index dfc56cef..a2fc2612 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 39f247ba..d4ecf06e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 2c6a801d..b664568e 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a78b77bb..b3c1a3bf 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7156eb22..116ee5e3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 46a95ea9..a04ca149 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 9c9ed747..5dba1a33 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index c3dc490a..1080b9a3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index fac0e0ba..3efc2842 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c2ebcd84..71738164 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 115f8dec..5736ed9f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 0b87cb07..111663dc 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index e9913d2d..78586a68 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 930aa8c9..b50a99c2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 55b2a130..54236cf4 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2bbe63b2..58be6181 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 4; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 31)) { + if (offset < 0) { __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 6694ef70..827a3a7c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e31876fb..66a8c776 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4bd4082d..02abd713 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0a1a9f63..8d44024a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 5ffa3869..5aaa8469 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5666c7cd..1122a8d0 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e1fc08ec..1a9ad61f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 461b5b85..e6d709e7 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c60f6f98..c5192f5b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1ab60658..6e2d4cd0 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 3a1c4787..9b3bf8f0 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 512cfa75..8689aa3b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1983daf5..0d16f8ec 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d3b24cc6..b9e46b1a 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a62894dd..e36e3be5 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bdf72323..777ee3b8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d1466be1..587135b3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 5f3d11a5..c9e8e867 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index cf931556..bd36f8d6 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7e1a6845..af7a679b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 59076121..d145001a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index a4267893..c40b975f 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 2238689d..0aac4cc8 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 549268e2..b289dfa6 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index a2f7cf75..76fa35bf 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 27ef9f8f..3dbc28ba 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 912e5e83..2e236578 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 36c0bc7e..0eae5799 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index cfce02b8..b5ee44a5 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/06] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 84e8427b..31877f12 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index c9058a13..e24d169a 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 1f1182fd..1d06d0fe 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 61842215..0f262baa 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2c581e47..58cb3b1e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1fe3ce13..d0175b87 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -353,7 +353,7 @@ static void Heap_Mark (address q) tag = tagbits + 8; for (;;) { __GET(tag, offset, address); - if (__BIT((address)&offset, 63)) { + if (offset < 0) { __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index def46dcf..fabb54ef 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9d93e3d2..53bf2640 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f9e49aa7..8e54ce53 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 11b9a1a9..f22a9ab5 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index c3c5c1e8..aa26ea1c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e971762c..8916c00b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a218490a..71b95812 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 389fda93..b15aba16 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 51042a0e..d23aed25 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9ab86b22..3f77df4f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ce85af11..de48c5ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 8e53d027..491faa22 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index ffbc5084..3937b6f6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index bd27c789..da8bab08 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 583c31ff..668c3d79 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 2d81dd31..52fc9966 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b10704dc..c692efd8 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index dda7a46a..b862e3ee 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 472cf2f1..d74f41bc 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0b5761ee..185aec0b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index dfc56cef..a2fc2612 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 821a6096..d7603f8e 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -21,11 +21,34 @@ // Procedure verions of SYSTEM.H versions used when a multiply accessed // parameter has side effects. -int64 SYSTEM_XCHK(uint64 i, uint64 ub) {return __X(i, ub);} -int64 SYSTEM_RCHK(uint64 i, uint64 ub) {return __R(i, ub);} -LONGINT SYSTEM_ASH (LONGINT i, LONGINT n) {return __ASH(i, n);} -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} + + +LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} +double SYSTEM_ABSD(double i) {return __ABS(i);} + + +int64 SYSTEM_DIV(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x/y;} + else {return -((x-y-1)/(-y));} + else + if (y >= 0) {return -((y-x-1)/y);} + else {return (-x)/(-y);} +} + +int64 SYSTEM_MOD(int64 x, int64 y) +{ + if (x == 0) return 0; + if (x >= 0) + if (y >= 0) {return x % y;} + else {return (y+1) + ((x-1) % (-y));} + else + if (y >= 0) {return (y-1) - ((-x-1) % y);} + else {return -((-x) % (-y));} +} + void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) { @@ -57,19 +80,6 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) } } -LONGINT SYSTEM_DIV(uint64 x, uint64 y) -{ if ((int64) x >= 0) return (x / y); - else return -((y - 1 - x) / y); -} - -LONGINT SYSTEM_MOD(uint64 x, uint64 y) -{ uint64 m; - if ((int64) x >= 0) return (x % y); - else { m = (-x) % y; - if (m != 0) return (y - m); else return 0; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 6fc57309..168b0beb 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -2,9 +2,17 @@ #define SYSTEM__h +// 64 bit system detection + +#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) + #define __o_64 +#endif + +// Temporary while bootstrapping and clearing up SYSTEM.c. + #ifndef LONGINT - #if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) + #if defined (__o_64) #define INTEGER int32 #define LONGINT int64 #define SET uint64 @@ -22,14 +30,17 @@ // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if (__SIZEOF_POINTER__ == 8) || defined(_WIN64) || defined(__LP64__) +#if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; +// typedef long long address; #else typedef unsigned long size_t; +// typedef long address; #endif #else typedef unsigned int size_t; +//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -40,14 +51,14 @@ void *memcpy(void *dest, const void *source, size_t size); // Declare fixed size versions of basic intger types -#if (__SIZEOF_POINTER__ < 8) || defined(_WIN64) - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#else +#if defined (__o_64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; +#else + // ILP32 or LLP64 + typedef long long int64; + typedef unsigned long long uint64; #endif typedef int int32; @@ -59,7 +70,14 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define address size_t + +// 'address' is a synonym for an int32 of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -103,18 +121,40 @@ extern address Platform_OSAllocate (address size); extern void Platform_OSFree (address addr); +// Assertions and Halts + +extern void Platform_Halt(LONGINT x); +extern void Platform_AssertFail(LONGINT x); + +#define __HALT(x) Platform_Halt(x) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) + + +// Index checking + +static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) + + +// Range checking, and checked SHORT and CHR functions + +static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) +#define __CHR(x) ((CHAR)__R(x, 256)) +#define __CHRF(x) ((CHAR)__RF(x, 256)) + + + // Run time system routines in SYSTEM.c -extern int64 SYSTEM_XCHK (uint64 i, uint64 ub); -extern int64 SYSTEM_RCHK (uint64 i, uint64 ub); -extern LONGINT SYSTEM_ASH (LONGINT i, LONGINT n); + extern LONGINT SYSTEM_ABS (LONGINT i); extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_DIV (uint64 x, uint64 y); -extern LONGINT SYSTEM_MOD (uint64 x, uint64 y); extern LONGINT SYSTEM_ENTIER (double x); @@ -131,7 +171,7 @@ extern LONGINT SYSTEM_ENTIER (double x); // String comparison -static int __str_cmp(CHAR *x, CHAR *y){ +static inline int __str_cmp(CHAR *x, CHAR *y){ LONGINT i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; @@ -152,21 +192,12 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __DEL(x) Platform_OSFree((address)x) -// Index and range checks - -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) -#define __XF(i, ub) SYSTEM_XCHK((uint64)(i), (uint64)(ub)) - -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __RF(i, ub) SYSTEM_RCHK((uint64)(i),(uint64)(ub)) - - /* SYSTEM ops */ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(address)(a) +#define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) @@ -177,21 +208,27 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) #define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) -#define __ASHL(x, n) ((LONGINT)(x)<<(n)) -#define __ASHR(x, n) ((LONGINT)(x)>>(n)) +#define __ASHL(x, n) ((int64)(x)<<(n)) +#define __ASHR(x, n) ((int64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) +static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) -#define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) -#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) -#define __DIV(x, y) ((x)>=0?(x)/(y):-(((y)-1-(x))/(y))) -#define __DIVF(x, y) SYSTEM_DIV((LONGINT)(x),(LONGINT)(y)) -#define __MOD(x, y) ((x)>=0?(x)%(y):__MODF(x,y)) -#define __MODF(x, y) SYSTEM_MOD((LONGINT)(x),(LONGINT)(y)) + + +extern int64 SYSTEM_DIV(int64 x, int64 y); +#define __DIVF(x, y) SYSTEM_DIV(x, y) +#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) + + +extern int64 SYSTEM_MOD(int64 x, int64 y); +#define __MODF(x, y) SYSTEM_MOD(x, y) +#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) + + + #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) #define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) @@ -244,15 +281,6 @@ extern void Heap_FINALL(); #define __FINI Heap_FINALL(); return 0 -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - // Memory allocation extern SYSTEM_PTR Heap_NEWBLK (address size); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 39f247ba..d4ecf06e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 2c6a801d..b664568e 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a78b77bb..b3c1a3bf 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7156eb22..116ee5e3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 46a95ea9..a04ca149 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 9c9ed747..5dba1a33 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index bf0e9564..9d5bbe45 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index c3dc490a..1080b9a3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -64,7 +64,7 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); @@ -77,7 +77,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g", cmd, 7); + __MOVE("gcc -g -O1", cmd, 11); Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index c5d5c772..8bdd3b71 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index fac0e0ba..3efc2842 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c2ebcd84..71738164 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/06] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h From 9baf4c9429c7c6646c5b156c8d2b6738f236e2cf Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Sep 2016 15:55:54 +0100 Subject: [PATCH 027/140] Fix shift/rotate for all integer types, add tests, make build order work for SYSTEM.c/h changes. --- .gitignore | 8 +- bootstrap/{unix-44 => }/SYSTEM.c | 0 bootstrap/{unix-44 => }/SYSTEM.h | 35 +- bootstrap/{unix-44 => }/WindowsWrapper.h | 0 bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 4 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 4 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 220 ------------ bootstrap/unix-48/SYSTEM.h | 340 ------------------ bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/WindowsWrapper.h | 10 - bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 220 ------------ bootstrap/unix-88/SYSTEM.h | 340 ------------------ bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/WindowsWrapper.h | 10 - bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 4 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 220 ------------ bootstrap/windows-48/SYSTEM.h | 340 ------------------ bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/WindowsWrapper.h | 10 - bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 4 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 220 ------------ bootstrap/windows-88/SYSTEM.h | 340 ------------------ bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/WindowsWrapper.h | 10 - bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 2 + src/compiler/OPV.Mod | 2 +- src/system/SYSTEM.h | 35 +- src/test/confidence/language/TestLanguage.mod | 74 +++- src/test/confidence/planned-binary-change | 2 +- src/tools/make/vishap.make | 6 +- 217 files changed, 334 insertions(+), 2550 deletions(-) rename bootstrap/{unix-44 => }/SYSTEM.c (100%) rename bootstrap/{unix-44 => }/SYSTEM.h (94%) rename bootstrap/{unix-44 => }/WindowsWrapper.h (100%) delete mode 100644 bootstrap/unix-48/SYSTEM.c delete mode 100644 bootstrap/unix-48/SYSTEM.h delete mode 100644 bootstrap/unix-48/WindowsWrapper.h delete mode 100644 bootstrap/unix-88/SYSTEM.c delete mode 100644 bootstrap/unix-88/SYSTEM.h delete mode 100644 bootstrap/unix-88/WindowsWrapper.h delete mode 100644 bootstrap/windows-48/SYSTEM.c delete mode 100644 bootstrap/windows-48/SYSTEM.h delete mode 100644 bootstrap/windows-48/WindowsWrapper.h delete mode 100644 bootstrap/windows-88/SYSTEM.c delete mode 100644 bootstrap/windows-88/SYSTEM.h delete mode 100644 bootstrap/windows-88/WindowsWrapper.h diff --git a/.gitignore b/.gitignore index 0e401127..2c05bb3a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,12 @@ /build/* /*.exe /*.obj -/*.o +/*.[cho] /*.lib /*.map +/*.sym +/*.asm +/*.mod /olang /src/test/**/*.exe /src/test/**/*.c @@ -14,10 +17,11 @@ /src/test/**/*.o /src/test/**/*.obj /src/test/**/*.sym -/src/test/**/*.stackdump +**/*.stackdump /src/test/confidence/**/result /src/test/confidence/**/*.asm /src/test/confidence/**/*.s +/src/test/confidence/**/*.map /.DS_store **/.DS_store **/*.dSYM diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/SYSTEM.c similarity index 100% rename from bootstrap/unix-44/SYSTEM.c rename to bootstrap/SYSTEM.c diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/SYSTEM.h similarity index 94% rename from bootstrap/unix-44/SYSTEM.h rename to bootstrap/SYSTEM.h index 168b0beb..709c26a7 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -33,14 +33,11 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; -// typedef long long address; #else typedef unsigned long size_t; -// typedef long address; #endif #else typedef unsigned int size_t; -//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,14 +68,6 @@ typedef signed char int8; typedef unsigned char uint8; -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -98,9 +87,7 @@ typedef unsigned char uint8; typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -108,6 +95,16 @@ typedef void* SYSTEM_PTR; #define uSET SET +// 'address' is a synonym for an int of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif + + + // ---------------------------------------------------------------------- @@ -200,13 +197,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) +#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((int64)(x)<<(n)) #define __ASHR(x, n) ((int64)(x)>>(n)) diff --git a/bootstrap/unix-44/WindowsWrapper.h b/bootstrap/WindowsWrapper.h similarity index 100% rename from bootstrap/unix-44/WindowsWrapper.h rename to bootstrap/WindowsWrapper.h diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 6181cbfd..e33f3d7c 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index f98f4e55..ebdd14a9 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index de420c7c..42e60467 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index b8559160..4842a8c4 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 868c4e52..295013cf 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ace0257e..1d7b5409 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e52c65ca..d684a9c0 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 6181cbfd..e33f3d7c 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index f98f4e55..ebdd14a9 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index de420c7c..42e60467 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index b8559160..4842a8c4 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 868c4e52..295013cf 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/unix-48/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/unix-48/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c40b975f..c37a4a2c 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0aac4cc8..c6ee484f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/WindowsWrapper.h b/bootstrap/unix-48/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/unix-48/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b5ee44a5..b023c21b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 74de0b0a..3677dd09 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -58,7 +58,7 @@ void Console_Int (int64 i, int64 n) { CHAR s[32]; int64 i1, k; - if (i == __LSHL(1, 63, int64)) { + if (i == __LSHL(1, 63, 64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 1d06d0fe..27d906ad 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index aabcb14d..acdf5f8a 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 054cde33..7fb2cb03 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d0175b87..67044d79 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index fabb54ef..584661bc 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 53bf2640..547909bb 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 8e54ce53..2666971d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f22a9ab5..f048dc85 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index aa26ea1c..adefb869 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 8916c00b..aee5581c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 71b95812..aba4bdbb 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index b15aba16..55420864 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -537,7 +537,7 @@ void OPM_err (int32 n) void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); } void OPM_FPrintSet (int64 *fp, SET set) @@ -650,7 +650,7 @@ int64 OPM_SignedMaximum (int64 bytecount) int64 _o_result; int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d23aed25..1e5c3e72 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3f77df4f..f175938c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 491faa22..0c36910a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 3937b6f6..a16c2ce8 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index da8bab08..3006ea90 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 668c3d79..5f466ec4 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 52fc9966..082797f1 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int32 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9142bf02..cf8dfa9f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index e52525fd..708e58d7 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 185aec0b..2a753b7a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index a2fc2612..c3cac05a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/unix-88/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/unix-88/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index d4ecf06e..d8c606d3 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b664568e..130e1d06 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index b3c1a3bf..056c54e0 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 116ee5e3..1e734f9d 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index a04ca149..08b89b00 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/WindowsWrapper.h b/bootstrap/unix-88/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/unix-88/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5dba1a33..84d35faf 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 1080b9a3..7651bcf8 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 3efc2842..b7524886 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 71738164..ef3afa5a 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5736ed9f..cc4f7969 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 111663dc..6ad2295c 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -58,7 +58,7 @@ void Console_Int (int32 i, int32 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, int32)) { + if (i == __LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 78586a68..c6fe7fc4 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b50a99c2..1e560865 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 54236cf4..b082c461 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 58be6181..4d96ea89 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 827a3a7c..1a6c9e05 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 66a8c776..9834a814 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 02abd713..e34e59ed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8d44024a..92c0af42 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 5aaa8469..96866563 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1122a8d0..452c85d2 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1a9ad61f..81e8362d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e6d709e7..671a9d8f 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -537,7 +537,7 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int32 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, int32); + *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -652,7 +652,7 @@ int32 OPM_SignedMaximum (int32 bytecount) int32 _o_result; int32 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c5192f5b..0d9bcdeb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6e2d4cd0..de0afa51 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 9b3bf8f0..e6e99c02 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 8689aa3b..99448598 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0d16f8ec..4a645e7a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b9e46b1a..93975ea1 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index e36e3be5..b264d44e 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int16 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 777ee3b8..06824f8e 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 587135b3..a2301fff 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c9e8e867..e209af08 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index bd36f8d6..2779fc88 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/windows-48/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/windows-48/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index af7a679b..387345ab 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index d145001a..fe90bd09 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c40b975f..c37a4a2c 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0aac4cc8..c6ee484f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index b289dfa6..fb1c1662 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/WindowsWrapper.h b/bootstrap/windows-48/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/windows-48/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 76fa35bf..7feed8e7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3dbc28ba..0afff1f0 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 2e236578..8a5286ec 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 0eae5799..c09b4c71 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b5ee44a5..b023c21b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/11] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 31877f12..3ce4467e 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index e24d169a..1190773d 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -58,7 +58,7 @@ void Console_Int (int64 i, int64 n) { CHAR s[32]; int64 i1, k; - if (i == __LSHL(1, 63, int64)) { + if (i == __LSHL(1, 63, 64)) { __MOVE("8085774586302733229", s, 20); k = 19; } else { diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 1d06d0fe..27d906ad 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 0f262baa..dbe8d119 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 58cb3b1e..8a4fb7c5 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d0175b87..67044d79 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index fabb54ef..584661bc 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 53bf2640..547909bb 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 8e54ce53..2666971d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f22a9ab5..f048dc85 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index aa26ea1c..adefb869 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 8916c00b..aee5581c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 71b95812..aba4bdbb 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index b15aba16..55420864 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -537,7 +537,7 @@ void OPM_err (int32 n) void OPM_FPrint (int64 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, int64); + *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); } void OPM_FPrintSet (int64 *fp, SET set) @@ -650,7 +650,7 @@ int64 OPM_SignedMaximum (int64 bytecount) int64 _o_result; int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, int64); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d23aed25..1e5c3e72 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3f77df4f..f175938c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index de48c5ba..2d3ebd77 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 491faa22..0c36910a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 3937b6f6..a16c2ce8 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index da8bab08..3006ea90 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 668c3d79..5f466ec4 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 52fc9966..082797f1 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1039,7 +1039,7 @@ static void OPV_expr (OPT_Node n, int32 prec) } if (__IN(subclass, 0x18000000)) { OPM_WriteString((CHAR*)", ", 3); - OPC_Ident(l->typ->strobj); + OPM_WriteInt(__ASHL(l->typ->size, 3)); } OPM_Write(')'); break; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c692efd8..3b43e61e 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b862e3ee..b7705767 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d74f41bc..290fc518 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 185aec0b..2a753b7a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index a2fc2612..c3cac05a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c deleted file mode 100644 index d7603f8e..00000000 --- a/bootstrap/windows-88/SYSTEM.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* The body prefix file of the voc(jet backend) runtime system, Version 1.0 -* -* Copyright (c) Software Templ, 1994, 1995 -* -* Module SYSTEM is subject to change any time without prior notification. -* Software Templ disclaims all warranties with regard to module SYSTEM, -* in particular shall Software Templ not be liable for any damage resulting -* from inappropriate use or modification of module SYSTEM. -* -* Version 1.1 jt, 24.11.95 fixes for correct pointer arithmetic on Cray computers -* jt 31.1.2007 ANSI prototypes for malloc and exit in order to avoid cc warnings -* -*/ - -#include "SYSTEM.h" -#include "stdarg.h" -#include - - -// Procedure verions of SYSTEM.H versions used when a multiply accessed -// parameter has side effects. - - - -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - - -int64 SYSTEM_DIV(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x/y;} - else {return -((x-y-1)/(-y));} - else - if (y >= 0) {return -((y-x-1)/y);} - else {return (-x)/(-y);} -} - -int64 SYSTEM_MOD(int64 x, int64 y) -{ - if (x == 0) return 0; - if (x >= 0) - if (y >= 0) {return x % y;} - else {return (y+1) + ((x-1) % (-y));} - else - if (y >= 0) {return (y-1) - ((-x-1) % y);} - else {return -((-x) % (-y));} -} - - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - -LONGINT SYSTEM_ENTIER(double x) -{ - LONGINT y; - if (x >= 0) - return (LONGINT)x; - else { - y = (LONGINT)x; - if (y <= x) return y; else return y - 1; - } -} - -extern void Heap_Lock(); -extern void Heap_Unlock(); - -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) -{ - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; - va_list ap; - va_start(ap, nofdyn); - nofelems = 1; - while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; - if (nofelems <= 0) __HALT(-20); - } - va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { - n = dataoff % elemalgn; - if (n != 0) dataoff += elemalgn - n; - } - size = dataoff + nofelems * elemsz; - Heap_Lock(); - if (typ == NIL) { - /* element typ does not contain pointers */ - x = Heap_NEWBLK(size); - } - else if (typ == (LONGINT*)POINTER__typ) { - /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; - p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); - } - else { - /* element type is a record that contains pointers */ - ptab = typ + 1; nofptrs = 0; - while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ - nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; - p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ - p -= nptr - 1; n = 0; off = dataoff; - while (n < nofelems) {i = 0; - while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} - off += elemsz; n++; - } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); - } - if (nofdyn != 0) { - /* setup len vector for index checks */ - va_start(ap, nofdyn); - p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} - va_end(ap); - } - Heap_Unlock(); - return x; -} - - - - -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler - -#ifndef _WIN32 - - SystemSignalHandler handler[3] = {0}; - - // Provide signal handling for Unix based systems - void signalHandler(int s) { - if (s >= 2 && s <= 4) handler[s-2](s); - // (Ignore other signals) - } - - void SystemSetHandler(int s, address h) { - if (s >= 2 && s <= 4) { - int needtosetsystemhandler = handler[s-2] == 0; - handler[s-2] = (SystemSignalHandler)h; - if (needtosetsystemhandler) {signal(s, signalHandler);} - } - } - -#else - - // Provides Windows callback handlers for signal-like scenarios - #include "WindowsWrapper.h" - - SystemSignalHandler SystemInterruptHandler = 0; - SystemSignalHandler SystemQuitHandler = 0; - BOOL ConsoleCtrlHandlerSet = FALSE; - - BOOL WINAPI SystemConsoleCtrlHandler(DWORD ctrlType) { - if ((ctrlType == CTRL_C_EVENT) || (ctrlType == CTRL_BREAK_EVENT)) { - if (SystemInterruptHandler) { - SystemInterruptHandler(2); // SIGINT - return TRUE; - } - } else { // Close, logoff or shutdown - if (SystemQuitHandler) { - SystemQuitHandler(3); // SIGQUIT - return TRUE; - } - } - return FALSE; - } - - void EnsureConsoleCtrlHandler() { - if (!ConsoleCtrlHandlerSet) { - SetConsoleCtrlHandler(SystemConsoleCtrlHandler, TRUE); - ConsoleCtrlHandlerSet = TRUE; - } - } - - void SystemSetInterruptHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemInterruptHandler = (SystemSignalHandler)h; - } - - void SystemSetQuitHandler(address h) { - EnsureConsoleCtrlHandler(); - SystemQuitHandler = (SystemSignalHandler)h; - } - -#endif diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h deleted file mode 100644 index 168b0beb..00000000 --- a/bootstrap/windows-88/SYSTEM.h +++ /dev/null @@ -1,340 +0,0 @@ -#ifndef SYSTEM__h -#define SYSTEM__h - - -// 64 bit system detection - -#if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 -#endif - -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif - - - - - -// Declare memcpy in a way compatible with C compilers intrinsic -// built in implementations. - -#if defined (__o_64) - #if defined(_WIN64) - typedef unsigned long long size_t; -// typedef long long address; - #else - typedef unsigned long size_t; -// typedef long address; - #endif -#else - typedef unsigned int size_t; -//typedef int address; -#endif - -#define _SIZE_T_DECLARED // For FreeBSD -#define _SIZE_T_DEFINED_ // For OpenBSD - -void *memcpy(void *dest, const void *source, size_t size); - - -// Declare fixed size versions of basic intger types - -#if defined (__o_64) && !defined(_WIN64) - // LP64 - typedef long int64; - typedef unsigned long uint64; -#else - // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; -#endif - -typedef int int32; -typedef unsigned int uint32; - -typedef short int int16; -typedef unsigned short int uint16; - -typedef signed char int8; -typedef unsigned char uint8; - - -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - -// The compiler uses 'import' and 'export' which translate to 'extern' and -// nothing respectively. - -#define import extern -#define export - - - -// Known constants - -#define NIL ((void*)0) -#define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type - - -// Oberon types - -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; -typedef uint8 CHAR; -typedef uint8 uCHAR; -typedef float REAL; -typedef double LONGREAL; -typedef void* SYSTEM_PTR; - -#define uSET SET - - - - -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - - - -// OS Memory allocation interfaces are in PlatformXXX.Mod - -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); - - -// Assertions and Halts - -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); - -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) - - -// Index checking - -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) - - -// Range checking, and checked SHORT and CHR functions - -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) -#define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) -#define __CHR(x) ((CHAR)__R(x, 256)) -#define __CHRF(x) ((CHAR)__RF(x, 256)) - - - -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - -// Signal handling in SYSTEM.c - -#ifndef _WIN32 - extern void SystemSetHandler(int s, address h); -#else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); -#endif - - - -// String comparison - -static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; - CHAR ch1, ch2; - do {ch1 = x[i]; ch2 = y[i]; i++; - if (!ch1) return -(int)ch2; - } while (ch1==ch2); - return (int)ch1 - (int)ch2; -} -#define __STRCMP(a,b) __str_cmp((CHAR*)(a), (CHAR*)(b)) - - - -// Inline string, record and array copy - -#define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ - while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) - - -/* SYSTEM ops */ - -#define __VAL(t, x) (*(t*)&(x)) - - -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x - -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) - -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) - -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) -#define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) - -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) - - -extern int64 SYSTEM_DIV(int64 x, int64 y); -#define __DIVF(x, y) SYSTEM_DIV(x, y) -#define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) - - -extern int64 SYSTEM_MOD(int64 x, int64 y); -#define __MODF(x, y) SYSTEM_MOD(x, y) -#define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) - - - -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) -#define __CAP(ch) ((CHAR)((ch)&0x5f)) -#define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) - - - -// Runtime checks - -#define __RETCHK __retchk: __HALT(-3); return 0; -#define __CASECHK __HALT(-4) -#define __WITHCHK __HALT(-7) - -#define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) -#define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) -#define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) -#define __GUARDEQR(p, dyntyp, typ) if(dyntyp!=typ##__typ) __HALT(-6);*(p) -#define __GUARDEQP(p, typ) if(__TYPEOF(p)!=typ##__typ)__HALT(-6);*(p) - - - -// Module entry/registration/exit - -extern void Heap_REGCMD(); -extern SYSTEM_PTR Heap_REGMOD(); -extern void Heap_REGTYP(); -extern void Heap_INCREF(); - -#define __DEFMOD static void *m; if (m!=0) {return m;} -#define __REGCMD(name, cmd) Heap_REGCMD(m, (CHAR*)name, cmd) -#define __REGMOD(name, enum) if (m==0) {m = Heap_REGMOD((CHAR*)name,enum);} -#define __ENDMOD return m -#define __MODULE_IMPORT(name) Heap_INCREF(name##__init()) - - - -// Main module initialisation, registration and finalisation - -extern void Platform_Init(INTEGER argc, address argv); -extern void Heap_FINALL(); - -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); -#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) -#define __FINI Heap_FINALL(); return 0 - - -// Memory allocation - -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); - -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) -#define __NEWARR SYSTEM_NEWARR - - - -/* Type handling */ - -#define __TDESC(t, m, n) \ - static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ - char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ - } t##__desc - -#define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. -#define __EOM 1 -#define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) - -#define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ - if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ - SYSTEM_INHERIT(t##__typ, t0##__typ) - -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - -// Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist - - - - -#endif diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index d4ecf06e..d8c606d3 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b664568e..130e1d06 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index b3c1a3bf..056c54e0 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 116ee5e3..1e734f9d 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index a04ca149..08b89b00 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/WindowsWrapper.h b/bootstrap/windows-88/WindowsWrapper.h deleted file mode 100644 index b72c815a..00000000 --- a/bootstrap/windows-88/WindowsWrapper.h +++ /dev/null @@ -1,10 +0,0 @@ -// WindowsWrapper.h -// -// Includes Windows.h while avoiding conflicts with Oberon types. - - -#define BOOLEAN _BOOLEAN -#define CHAR _CHAR -#include -#undef BOOLEAN -#undef CHAR diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5dba1a33..84d35faf 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9d5bbe45..4fe434e1 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 1080b9a3..7651bcf8 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8bdd3b71..5d996dae 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 3efc2842..b7524886 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 71738164..ef3afa5a 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/11] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 31f5fa39..ade812e7 100644 --- a/makefile +++ b/makefile @@ -248,6 +248,7 @@ bootstrap: configuration make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + cp src/system/*.[ch] bootstrap bootstrapunclean: @@ -257,6 +258,7 @@ bootstrapunclean: make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + cp src/system/*.[ch] bootstrap diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 61125e5b..2f679ace 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -625,7 +625,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteInt(-r^.conval^.intval) ELSE expr(r, MinPrec) END ; - IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPC.Ident(l^.typ^.strobj) END ; + IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPM.WriteInt(l.typ.size*8) END; OPM.Write(CloseParen) | OPS.eql .. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 168b0beb..709c26a7 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -33,14 +33,11 @@ #if defined (__o_64) #if defined(_WIN64) typedef unsigned long long size_t; -// typedef long long address; #else typedef unsigned long size_t; -// typedef long address; #endif #else typedef unsigned int size_t; -//typedef int address; #endif #define _SIZE_T_DECLARED // For FreeBSD @@ -71,14 +68,6 @@ typedef signed char int8; typedef unsigned char uint8; -// 'address' is a synonym for an int32 of pointer size - -#if defined (__o_64) - #define address int64 -#else - #define address int32 -#endif - // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -98,9 +87,7 @@ typedef unsigned char uint8; typedef int8 BOOLEAN; typedef int8 SYSTEM_BYTE; -typedef uint8 uSYSTEM_BYTE; typedef uint8 CHAR; -typedef uint8 uCHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; @@ -108,6 +95,16 @@ typedef void* SYSTEM_PTR; #define uSET SET +// 'address' is a synonym for an int of pointer size + +#if defined (__o_64) + #define address int64 +#else + #define address int32 +#endif + + + // ---------------------------------------------------------------------- @@ -200,13 +197,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x -#define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) -#define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) -#define __LSH(x, n, t) ((n)>=0? __LSHL(x, n, t): __LSHR(x, -(n), t)) +#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) +#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, t) ((t)((u##t)(x)<<(n)|(u##t)(x)>>(8*sizeof(t)-(n)))) -#define __ROTR(x, n, t) ((t)((u##t)(x)>>(n)|(u##t)(x)<<(8*sizeof(t)-(n)))) -#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t)) +#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((int64)(x)<<(n)) #define __ASHR(x, n) ((int64)(x)>>(n)) diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 3db99f44..724ae63a 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -2,8 +2,20 @@ MODULE TestLanguage; IMPORT SYSTEM, Console; +PROCEDURE TestShiftResult(of, by, actual, expected: LONGINT; msg: ARRAY OF CHAR); +BEGIN + IF actual # expected THEN + Console.String(msg); + Console.String(" of $"); Console.Hex(of); + Console.String(" by "); Console.Int(by,1); + Console.String(" is $"); Console.Hex(actual); + Console.String(" but should be $"); Console.Hex(expected); + Console.Ln; + END +END TestShiftResult; + PROCEDURE Shift; -VAR c: CHAR; b: SYSTEM.BYTE; s,t,u: SHORTINT; h,i,j,k: INTEGER; l,m,n: LONGINT; +VAR c: CHAR; b: SYSTEM.BYTE; s,t,u: SHORTINT; h,i,j,k: INTEGER; l,m,n,r: LONGINT; (* Aritmetic shift always returns type LONGINT. Defined as x * 2**n. LSH and ROT produces results of the same type as the value being shifted. @@ -13,8 +25,8 @@ BEGIN i := 0; m := 1; WHILE i < SIZE(LONGINT)*8 DO - l := 1; l := SYSTEM.LSH(l,i); ASSERT(l = m, 16); - l := 1; l := SYSTEM.ROT(l,i); ASSERT(l = m, 17); + l := 1; r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, m, "LSH"); + l := 1; r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT(1)"); m := m * 2; INC(i); END; @@ -84,9 +96,55 @@ BEGIN END; + (* Positive LSH shifts and ROTs with overflow *) + + i := 1; m := 1; + WHILE i < SIZE(LONGINT)*8 DO + l := MAX(LONGINT); INC(l); r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, 0, "LSH"); + l := MAX(LONGINT); INC(l); r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT(2)"); + m := m * 2; INC(i); + END; + + i := 1; k := 1; + WHILE i < SIZE(INTEGER)*8 DO + j := MAX(INTEGER); INC(j); r := SYSTEM.LSH(j,i); TestShiftResult(j, i, r, 0, "LSH"); + j := MAX(INTEGER); INC(j); r := SYSTEM.ROT(j,i); TestShiftResult(j, i, r, k, "ROT(3)"); + k := k * 2; INC(i); + END; + + i := 1; t := 1; + WHILE i < SIZE(SHORTINT)*8 DO + s := MAX(SHORTINT); INC(s); r := SYSTEM.LSH(s,i); TestShiftResult(s, i, r, 0, "LSH"); + s := MAX(SHORTINT); INC(s); r := SYSTEM.ROT(s,i); TestShiftResult(s, i, r, t, "ROT(4)"); + t := t * 2; INC(i); + END; + + (* Negative LSH shifts and ROTs without overflow *) + + i := -1; m := MAX(LONGINT); INC(m); + WHILE i > -SIZE(LONGINT)*8 DO + l := 1; r := SYSTEM.LSH(l,i); TestShiftResult(l, i, r, 0, "LSH"); + l := 1; r := SYSTEM.ROT(l,i); TestShiftResult(l, i, r, m, "ROT"); + m := SYSTEM.LSH(m,-1); (* m := m DIV 2; *) + DEC(i); + END; + + i := -1; k := MAX(INTEGER); INC(k); + WHILE i > -SIZE(INTEGER)*8 DO + j := 1; r := SYSTEM.LSH(j,i); TestShiftResult(j, i, r, 0, "LSH"); + j := 1; r := SYSTEM.ROT(j,i); TestShiftResult(j, i, r, k, "ROT"); + k := SYSTEM.LSH(k,-1); (* k := k DIV 2; *) + DEC(i); + END; + + i := -1; t := MAX(SHORTINT); INC(t); + WHILE i > -SIZE(SHORTINT)*8 DO + s := 1; r := SYSTEM.LSH(s,i); TestShiftResult(s, i, r, 0, "LSH"); + s := 1; r := SYSTEM.ROT(s,i); TestShiftResult(s, i, r, t, "ROT"); + t := SYSTEM.LSH(t,-1); (* t := t DIV 2; *) + DEC(i); + END; - (* Also need tests that bits that are shifted / rotated off the end - are zeroed or wrapped correctly. *) (* Also need full tests for CHAR, and poossibly SYSTEM.BYTE. Here's a simple one *) @@ -138,7 +196,6 @@ BEGIN => x MOd y = x - ((x DIV y) * y) *) - i := 4; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "4 MOD 3"); i := 5; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "5 MOD 3"); i := 6; j := 3; TestValue(i MOD j, i - ((i DIV j) * j), "6 MOD 3"); @@ -161,6 +218,8 @@ BEGIN END DivMod; + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -187,6 +246,9 @@ BEGIN END; END IntSize; + + + BEGIN Shift; DivMod; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 3c9d13b0..ebcef2cb 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -09 Sep 2016 14:20:47 +12 Sep 2016 15:40:20 diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 838b5ef7..faacf33f 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -70,6 +70,8 @@ assemble: SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o + + cp src/system/*.[ch] $(BUILDDIR) @printf "$(VISHAP) created.\n" @@ -79,7 +81,9 @@ compilerfromsavedsource: @echo Populating clean build directory from bootstrap C sources. @mkdir -p $(BUILDDIR) @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @cp bootstrap/*.[ch] $(BUILDDIR) @make -f src/tools/make/vishap.make -s assemble + @cp bootstrap/*.[ch] $(BUILDDIR) @@ -119,8 +123,6 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPP.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/Vishap.Mod - cp src/system/*.[ch] $(BUILDDIR) - @printf "$(BUILDDIR) filled with compiler C source.\n" From 516e261242dee20da76a9114b647f2720580fc0a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 12 Sep 2016 17:03:02 +0100 Subject: [PATCH 028/140] Support int64 in ABS. Remove unneccessary cast in __XF, __RF. --- src/system/SYSTEM.c | 3 --- src/system/SYSTEM.h | 19 ++++++++++++------- src/test/confidence/language/TestLanguage.mod | 18 ++++++++++++++++++ src/test/confidence/planned-binary-change | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index d7603f8e..defcc9fa 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -23,9 +23,6 @@ -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - int64 SYSTEM_DIV(int64 x, int64 y) { diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 709c26a7..fa63a9ab 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -130,13 +130,13 @@ extern void Platform_AssertFail(LONGINT x); // Index checking static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) #define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -147,8 +147,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Run time system routines in SYSTEM.c -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); @@ -227,9 +225,16 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) + +#define __ABS(x) (((x)<0)?-(x):(x)) + +static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} +static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) + +static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} +#define __ABSFD(x) SYSTEM_ABSD(x) + #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) #define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 724ae63a..6ae8c9e7 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -220,6 +220,23 @@ END DivMod; +PROCEDURE Abs; + VAR + i: INTEGER; + l: LONGINT; + h: SYSTEM.INT64; +BEGIN + i := 5; TestValue(ABS(i), 5, "ABS(INTEGER 5)"); + i := -5; TestValue(ABS(i), 5, "ABS(INTEGER -5)"); + l := 5; TestValue(ABS(l), 5, "ABS(LONGINT 5)"); + l := -5; TestValue(ABS(l), 5, "ABS(LONGINT -5)"); + h := 5; TestValue(SYSTEM.VAL(LONGINT,ABS(h)), 5, "ABS(SYSTEM.INT64 5)"); + h := -5; TestValue(SYSTEM.VAL(LONGINT,ABS(h)), 5, "ABS(SYSTEM.INT64 -5)"); +END Abs; + + + + PROCEDURE IntSize; VAR l: LONGINT; BEGIN @@ -253,5 +270,6 @@ BEGIN Shift; DivMod; IntSize; + Abs; Console.String("Language tests successful."); Console.Ln; END TestLanguage. diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index ebcef2cb..601e55c7 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -12 Sep 2016 15:40:20 +12 Sep 2016 17:01:41 From 68c105b48c6b56189ccac3408578d090e3628c31 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 19:44:01 +0100 Subject: [PATCH 029/140] Add tests for ENTIER. --- src/system/SYSTEM.h | 18 +++++++-------- src/test/confidence/language/TestLanguage.mod | 23 +++++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index fa63a9ab..d5f53efa 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -144,15 +144,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return -// Run time system routines in SYSTEM.c - - -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - // Signal handling in SYSTEM.c #ifndef _WIN32 @@ -223,8 +214,9 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) +extern LONGINT SYSTEM_ENTIER (double x); +#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) @@ -237,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) + #define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) #define __SETOF(x) ((SET)1<<(x)) #define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) @@ -297,6 +290,11 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); /* Type handling */ +extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); +extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); + + #define __TDESC(t, m, n) \ static struct t##__desc { \ LONGINT tproc[m]; /* Proc for each ptr field */ \ diff --git a/src/test/confidence/language/TestLanguage.mod b/src/test/confidence/language/TestLanguage.mod index 6ae8c9e7..7399b006 100644 --- a/src/test/confidence/language/TestLanguage.mod +++ b/src/test/confidence/language/TestLanguage.mod @@ -2,6 +2,8 @@ MODULE TestLanguage; IMPORT SYSTEM, Console; + VAR gz: LONGREAL; + PROCEDURE TestShiftResult(of, by, actual, expected: LONGINT; msg: ARRAY OF CHAR); BEGIN IF actual # expected THEN @@ -236,6 +238,26 @@ END Abs; +(* LR does nothing numerically, but is enough to stop the C compiler + optimizing away the LR assignment and ENTIER implementation. *) +PROCEDURE LR(lr: LONGREAL): LONGREAL; BEGIN RETURN lr + gz; END LR; + +PROCEDURE Entier; + VAR lr: LONGREAL; +BEGIN + gz := 0.0; + lr := LR(-0.01); TestValue(ENTIER(lr), -1, "ENTIER(-0.01"); + lr := LR( 0.00); TestValue(ENTIER(lr), 0, "ENTIER(0.00"); + lr := LR( 5.00); TestValue(ENTIER(lr), 5, "ENTIER(5.00"); + lr := LR( 5.50); TestValue(ENTIER(lr), 5, "ENTIER(5.50"); + lr := LR( 5.99); TestValue(ENTIER(lr), 5, "ENTIER(5.99"); + lr := LR(-5.00); TestValue(ENTIER(lr), -5, "ENTIER(-5.00"); + lr := LR(-5.50); TestValue(ENTIER(lr), -6, "ENTIER(-5.50"); + lr := LR(-5.99); TestValue(ENTIER(lr), -6, "ENTIER(-5.99"); +END Entier; + + + PROCEDURE IntSize; VAR l: LONGINT; @@ -271,5 +293,6 @@ BEGIN DivMod; IntSize; Abs; + Entier; Console.String("Language tests successful."); Console.Ln; END TestLanguage. From b8496c37369da7c24511a3c73bbf18972a3e7a5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 20:14:17 +0100 Subject: [PATCH 030/140] Pass set size to __IN, remove uSET Ctype, optimize __IN size test. --- src/compiler/OPV.Mod | 7 +++++-- src/system/SYSTEM.h | 13 +++++++------ src/test/confidence/planned-binary-change | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 2f679ace..ef8a1394 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -624,8 +624,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF (subclass IN {OPT.ash, OPT.lsh, OPT.rot}) & (r^.class = OPT.Nconst) & (r^.conval^.intval < 0) THEN OPM.WriteInt(-r^.conval^.intval) ELSE expr(r, MinPrec) - END ; - IF subclass IN {OPT.lsh, OPT.rot} THEN OPM.WriteString(Comma); OPM.WriteInt(l.typ.size*8) END; + END; + IF subclass IN {OPS.in, OPT.lsh, OPT.rot} THEN + OPM.WriteString(Comma); + IF subclass = OPS.in THEN OPM.WriteInt(r.typ.size*8) ELSE OPM.WriteInt(l.typ.size*8) END + END; OPM.Write(CloseParen) | OPS.eql .. OPS.geq: IF l^.typ^.form IN {OPT.String, OPT.Comp} THEN diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index d5f53efa..896934e7 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -92,7 +92,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -#define uSET SET // 'address' is a synonym for an int of pointer size @@ -200,7 +199,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) @@ -230,10 +228,13 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) +//#define __IN(x, s, size) ((x)>=0 && (x)>(x))&1)) + +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x) ((SET)1<<(x)) +#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 601e55c7..a2fd3632 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -12 Sep 2016 17:01:41 +13 Sep 2016 20:12:45 From f13130bbd3e47f2aed485f655e15ff2ede5687d2 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 13 Sep 2016 20:35:29 +0100 Subject: [PATCH 031/140] Add set size to __SETOF and __SETRNG. --- src/compiler/OPV.Mod | 15 ++++++++------- src/system/SYSTEM.h | 11 +++++------ src/tools/make/configure.c | 5 ++++- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index ef8a1394..f4a82ca5 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -27,8 +27,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 GuardPtrFunc = "__GUARDP("; GuardRecFunc = "__GUARDR("; TypeFunc = "__TYPEOF("; - SetOfFunc = "__SETOF("; - SetRangeFunc = "__SETRNG("; CopyFunc = "__COPY("; MoveFunc = "__MOVE("; GetFunc = "__GET("; @@ -293,7 +291,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Convert(n: OPT.Node; newtype: OPT.Struct; prec: INTEGER); VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; - IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) + IF to = OPT.Set THEN + OPM.WriteString("__SETOF("); Entier(n, MinPrec); + OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) ELSIF to = OPT.Int THEN IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; @@ -527,8 +527,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 CASE class OF | OPT.Nconst: OPC.Constant(n^.conval, form) | OPT.Nupto: (* n^.typ = OPT.settyp *) - OPM.WriteString(SetRangeFunc); expr(l, MinPrec); OPM.WriteString(Comma); expr (r, MinPrec); - OPM.Write(CloseParen) + OPM.WriteString("__SETRNG("); expr(l, MinPrec); OPM.WriteString(Comma); expr(r, MinPrec); + OPM.WriteString(Comma); OPM.WriteInt(n.typ.size*8); OPM.Write(CloseParen) | OPT.Nmop: CASE subclass OF | OPS.not: OPM.Write("!"); expr(l, exprPrec) @@ -865,8 +865,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.incfn, OPT.decfn: expr(n^.left, MinPrec); OPC.Increment(n^.subcl = OPT.decfn); expr(n^.right, MinPrec) | OPT.inclfn, - OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); OPM.WriteString(SetOfFunc); expr(n^.right, MinPrec); - OPM.Write(CloseParen) + OPT.exclfn: expr(n^.left, MinPrec); OPC.SetInclude(n^.subcl = OPT.exclfn); + OPM.WriteString("__SETOF("); expr(n^.right, MinPrec); + OPM.WriteString(","); OPM.WriteInt(n.left.typ.size*8); OPM.Write(CloseParen) | OPT.copyfn: OPM.WriteString(CopyFunc); expr(n^.right, MinPrec); OPM.WriteString(Comma); expr(n^.left, MinPrec); OPM.WriteString(Comma); Len(n^.left, 0); OPM.Write(CloseParen) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 896934e7..7c645e85 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -228,13 +228,12 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -//#define __IN(x, s, size) ((x)>=0 && (x)>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x, size) ((uint##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 10886067..f976c756 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -313,7 +313,10 @@ void testSystemDotH() { /* test the __SETRNG macro */ long x = 0; long y = sizeof(SET)*8 - 1; - assert(__SETRNG(x, y) == -1, "SETRNG(0, MAX(SET)) != -1."); + if (sizeof(SET) == 4) + assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); + else + assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); /* test string comparison for extended ascii */ {char a[10], b[10]; From 7efd5a0158079febaa2b40d4f398ff016b709873 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 13:02:00 +0100 Subject: [PATCH 032/140] More LONGINTS changed to Address. Remove special FetchAddress code in Heap. --- bootstrap/SYSTEM.c | 99 ++++++++-------- bootstrap/SYSTEM.h | 99 ++++++++-------- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 13 ++- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 130 +++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 26 ++--- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 24 ++-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 26 ++--- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 14 +-- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 74 ++++++------ bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 8 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 13 ++- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 130 +++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 26 ++--- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 24 ++-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 26 ++--- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 14 +-- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 74 ++++++------ bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 8 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 13 ++- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 130 +++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 26 ++--- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 24 ++-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 26 ++--- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 14 +-- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 74 ++++++------ bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 8 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 13 ++- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 130 +++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 26 ++--- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 24 ++-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 26 ++--- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 14 +-- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 74 ++++++------ bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 8 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 13 ++- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 130 +++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 26 ++--- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 24 ++-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 26 ++--- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 14 +-- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 74 ++++++------ bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 8 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/system/Heap.Mod | 112 +++++++++---------- src/system/SYSTEM.c | 96 ++++++++-------- src/system/SYSTEM.h | 56 +++++----- src/test/confidence/planned-binary-change | 2 +- 201 files changed, 1227 insertions(+), 1132 deletions(-) diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index d7603f8e..6efc8321 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -23,9 +23,6 @@ -LONGINT SYSTEM_ABS (LONGINT i) {return __ABS(i);} -double SYSTEM_ABSD(double i) {return __ABS(i);} - int64 SYSTEM_DIV(int64 x, int64 y) { @@ -49,37 +46,6 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; @@ -91,22 +57,55 @@ LONGINT SYSTEM_ENTIER(double x) } } + + + +void SYSTEM_INHERIT(address *t, address *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +{ + while (n > 0) { + P((address)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +{ + address *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + nofelems = nofelems * va_arg(ap, address); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { + dataoff = nofdyn * sizeof(address); + if (elemalgn > sizeof(address)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -116,37 +115,37 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (LONGINT*)POINTER__typ) { + else if (typ == (address*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(address)); + p = (address*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); + while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} + *p = - (nofelems + 1) * sizeof(address); /* sentinel */ + x[-1] -= nofelems * sizeof(address); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(address)); + p = (address*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); + *p = - (nptr + 1) * sizeof(address); /* sentinel */ + x[-1] -= nptr * sizeof(address); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 709c26a7..ddd85144 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -92,7 +92,6 @@ typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -#define uSET SET // 'address' is a synonym for an int of pointer size @@ -130,13 +129,13 @@ extern void Platform_AssertFail(LONGINT x); // Index checking static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} -#define __X(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-2),0)) +#define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} -#define __R(i, ub) (((uint64)(i)<(uint64)(ub))?i:(__HALT(-8),0)) +#define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) #define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -144,17 +143,6 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return -// Run time system routines in SYSTEM.c - - -extern LONGINT SYSTEM_ABS (LONGINT i); -extern double SYSTEM_ABSD (double i); -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); -extern LONGINT SYSTEM_ENTIER (double x); - - // Signal handling in SYSTEM.c #ifndef _WIN32 @@ -211,7 +199,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} #define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) #define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) @@ -225,17 +212,28 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) +extern LONGINT SYSTEM_ENTIER (double x); +#define __ENTIER(x) SYSTEM_ENTIER(x) + + +#define __ABS(x) (((x)<0)?-(x):(x)) + +static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} +static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) + +static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} +#define __ABSFD(x) SYSTEM_ABSD(x) -#define __ENTIER(x) SYSTEM_ENTIER(x) -#define __ABS(x) (((x)<0)?-(x):(x)) -#define __ABSF(x) SYSTEM_ABS((LONGINT)(x)) -#define __ABSFD(x) SYSTEM_ABSD((double)(x)) #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s) ((x)>=0 && (x)<(8*sizeof(SET)) && ((((uSET)(s))>>(x))&1)) -#define __SETOF(x) ((SET)1<<(x)) -#define __SETRNG(l, h) ((~(SET)0<<(l))&~(SET)0>>(8*sizeof(SET)-1-(h))) -#define __MASK(x, m) ((x)&~(m)) + +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __SETOF(x, size) ((uint##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) + +#define __MASK(x, m) ((x)&~(m)) +#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) @@ -245,6 +243,10 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) @@ -284,51 +286,52 @@ extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) +#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ +extern void SYSTEM_INHERIT(address *t, address *t0); +extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); + + #define __TDESC(t, m, n) \ static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ + address tproc[m]; /* Proc for each ptr field */ \ + address tag; \ + address next; /* Module table type list points here */ \ + address level; \ + address module; \ char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + address basep[__MAXEXT]; /* List of bases this extends */ \ + address reserved; \ + address blksz; /* xxx_typ points here */ \ + address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ + t##__typ = (address*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ + t##__desc.basep[level] = (address)t##__typ; \ + t##__desc.module = (address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ + Heap_REGTYP(m, (address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc #define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index e33f3d7c..5a0b29a2 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ebdd14a9..58145066 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 42e60467..521906c3 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4842a8c4..1bf0628e 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 295013cf..7c0b2d21 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 1d7b5409..503c4e06 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d684a9c0..b5b22e1b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index e33f3d7c..5a0b29a2 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ebdd14a9..58145066 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 42e60467..521906c3 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4842a8c4..1bf0628e 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 295013cf..7c0b2d21 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c37a4a2c..4d12f6cb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index c6ee484f..2b694f6c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b023c21b..f3f2e52d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 3677dd09..5039dae6 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 27d906ad..8336a3d0 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index acdf5f8a..1f4e38bf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7fb2cb03..b1a16504 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 67044d79..626812cb 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 584661bc..08afe43e 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 547909bb..3a48e24a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2666971d..3ebde4f3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f048dc85..883d2559 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 64)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 64))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 64)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 64)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 64)) { + if (__IN(g, 0x60, 64)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 64)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 64); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 64); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,64); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 64) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 64)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 64)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 64)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 64)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 64)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 64)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int32)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 64)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 64)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 64)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index adefb869..35fb2186 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index aee5581c..ef8f41a1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 64); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 64); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int32 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 64)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 64)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 64)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 63) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 64)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 64)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int32 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index aba4bdbb..646d0151 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 55420864..96868200 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 64); + OPM_dontLink = __IN(14, OPM_opt, 64); + OPM_mainProg = __IN(10, OPM_opt, 64); + OPM_mainLinkStat = __IN(15, OPM_opt, 64); + OPM_notColorOutput = __IN(16, OPM_opt, 64); + OPM_forceNewSym = __IN(17, OPM_opt, 64); + OPM_Verbose = __IN(18, OPM_opt, 64); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -771,7 +771,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { Files_Register(OPM_newSFile); } } @@ -970,10 +970,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 64)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 64)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 1e5c3e72..d4b77c79 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index f175938c..7e958472 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 64)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int64 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 64)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 64)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 64)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0c36910a..208f4934 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a16c2ce8..bb045fe9 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3006ea90..afc5a8b6 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 64); + OPT_findpc = __IN(8, opt, 64); + OPT_extsf = OPT_newsf || __IN(9, opt, 64); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 64)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 64)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 64)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 5f466ec4..090d9111 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 082797f1..098463c4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 64); + OPV_inxchk = __IN(0, OPM_opt, 64); + OPV_mainprog = __IN(10, OPM_opt, 64); + OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 64)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 64)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 64)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int32 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 64)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 64)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 64)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if (obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 64)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 64)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 64)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index cf8dfa9f..f428c2b1 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 708e58d7..d9212710 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2a753b7a..b3e89e04 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index c3cac05a..3892d49c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index d8c606d3..1eef261b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 130e1d06..8145aa00 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 056c54e0..d8710e54 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 64) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 64)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 64)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1e734f9d..8389bc47 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 08b89b00..3972af10 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 84d35faf..8864c777 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 7651bcf8..bb60848a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index b7524886..c143a6b3 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index ef3afa5a..11a9c941 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index cc4f7969..d8c934bf 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 6ad2295c..359bad0a 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index c6fe7fc4..0af02096 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1e560865..01218f26 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b082c461..ffdc05f6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4d96ea89..f03a4d7e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 1a6c9e05..29b4cb26 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9834a814..a71d3e4d 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e34e59ed..6a744f9b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 92c0af42..a905da35 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-2147483647-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int16)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 96866563..f9bf31fe 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 452c85d2..1fecd152 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 32); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 32); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 81e8362d..b8f44225 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 671a9d8f..6af53f8c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 32); + OPM_dontLink = __IN(14, OPM_opt, 32); + OPM_mainProg = __IN(10, OPM_opt, 32); + OPM_mainLinkStat = __IN(15, OPM_opt, 32); + OPM_notColorOutput = __IN(16, OPM_opt, 32); + OPM_forceNewSym = __IN(17, OPM_opt, 32); + OPM_Verbose = __IN(18, OPM_opt, 32); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -773,7 +773,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -972,10 +972,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 0d9bcdeb..67edafa5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index de0afa51..d8dee08e 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 32)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e6e99c02..cd51e788 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 99448598..658c87db 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 4a645e7a..ab44584b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 93975ea1..978ae16b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b264d44e..c20aef90 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 32); + OPV_inxchk = __IN(0, OPM_opt, 32); + OPV_mainprog = __IN(10, OPM_opt, 32); + OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int16 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int16 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int16 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 06824f8e..8740b5b0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a2301fff..ce51df39 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e209af08..a64c2d13 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 2779fc88..d7981245 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 387345ab..67c0f055 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index fe90bd09..6f4f1073 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c37a4a2c..4d12f6cb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index c6ee484f..2b694f6c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index fb1c1662..2efce68f 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 7feed8e7..6f8e3d33 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 0afff1f0..bbecb9f2 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8a5286ec..b5422c40 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c09b4c71..85494a63 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b023c21b..f3f2e52d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/12] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 3ce4467e..2b7bdf82 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 1190773d..f1d67d28 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 27d906ad..8336a3d0 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index dbe8d119..6c40d595 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8a4fb7c5..d3432e7a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 67044d79..626812cb 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 @@ -82,6 +82,7 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); +static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -106,7 +107,6 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern address Platform_MainStackFrame; extern address Platform_OSAllocate(address size); -#define Heap_FetchAddress(pointer) (address)(*((void**)((address)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -188,6 +188,15 @@ static address Heap_NewChunk (address blksz) return _o_result; } +static address Heap_FetchAddress (address pointer) +{ + address _o_result; + address r; + __GET(pointer, r, address); + _o_result = r; + return _o_result; +} + static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 584661bc..08afe43e 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 547909bb..3a48e24a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2666971d..3ebde4f3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f048dc85..883d2559 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -345,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300)) { + } else if (f != 4 || __IN(y->class, 0x0300, 64)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -372,7 +372,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010))) { + if ((y != NIL && __IN(y->mode, 0x2010, 64))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -476,7 +476,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -572,12 +572,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70)) { + if (!__IN(f, 0x70, 64)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0)) { + if (__IN(f, 0xf0, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -586,7 +586,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -600,7 +600,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70)) { + if (__IN(f, 0x70, 64)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -747,7 +747,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0)) { + if (__IN(y->mode, 0x04c0, 64)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -923,7 +923,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -954,7 +954,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -978,7 +978,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1032,7 +1032,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1054,7 +1054,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1082,28 +1082,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84)) { + if (__IN(f, 0x0a84, 64)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1136,7 +1136,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1145,8 +1145,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60)) { - if (__IN(g, 0x60)) { + } else if (__IN(f, 0x60, 64)) { + if (__IN(g, 0x60, 64)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1195,8 +1195,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1255,7 +1255,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70)) { + } else if (__IN(g, 0x70, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1264,23 +1264,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70)) { + if (__IN(g, 0x70, 64)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60)) { + } else if (__IN(g, 0x60, 64)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800)) { + if (!__IN(g, 0x1800, 64)) { OPB_err(100); } break; @@ -1341,7 +1341,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1)) { + } else if (!__IN(f, 0xe1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1357,7 +1357,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1424,7 +1424,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(105); typ = OPT_undftyp; } @@ -1443,7 +1443,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1)) { + if (!__IN(f, 0xf1, 64)) { OPB_err(106); typ = OPT_undftyp; } @@ -1467,7 +1467,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1476,7 +1476,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1518,10 +1518,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l); + (*x)->conval->setval = __SETRNG(k, l, 64); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k); + (*x)->conval->setval = __SETRNG(l, k, 64); } (*x)->obj = NIL; } else { @@ -1543,7 +1543,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k); + (*x)->conval->setval = __SETOF(k,64); } else { OPB_err(202); } @@ -1588,7 +1588,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a) && y->size == 1))) { + if (!((__IN(g, 0x1a, 64) && y->size == 1))) { OPB_err(113); } break; @@ -1603,12 +1603,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30)) { + if (!__IN(g, 0x30, 64)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70)) { + if (!__IN(g, 0x70, 64)) { OPB_err(113); } break; @@ -1656,7 +1656,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1664,7 +1664,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1691,7 +1691,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30))) && __IN(f, 0x70))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { OPB_Convert(&ynode, x); } } @@ -1729,7 +1729,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c)) { + if (__IN(f, 0x1c, 64)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1762,7 +1762,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60)) { + } else if (__IN(f, 0x60, 64)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1837,7 +1837,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11)) { + } else if (__IN(f, 0x11, 64)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1898,7 +1898,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c)) { + if (!__IN(x->typ->comp, 0x0c, 64)) { OPB_err(131); } break; @@ -1909,7 +1909,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1933,7 +1933,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe) || __IN(x->typ->comp, 0x14)) { + } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1948,7 +1948,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a)) { + } else if (!__IN(f, 0x9a, 64)) { OPB_err(111); } break; @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -1974,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2070,11 +2070,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = (int32)x->conval->intval; typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { OPB_err(132); } else { x->obj = NIL; @@ -2098,7 +2098,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2172,7 +2172,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff)) { + } else if (__IN(f, 0x18ff, 64)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2198,7 +2198,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2230,7 +2230,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2384,12 +2384,12 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x1e) && atyp->size == 1))) { - if (__IN(18, OPM_opt)) { + if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 64)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c)) { + } else if (__IN(f, 0x0c, 64)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2428,7 +2428,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2467,7 +2467,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); @@ -2494,7 +2494,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } @@ -2589,7 +2589,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index adefb869..35fb2186 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index aee5581c..ef8f41a1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -93,9 +93,9 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt); + OPC_ptrinit = __IN(5, OPM_opt, 64); OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt); + OPC_ansi = __IN(6, OPM_opt, 64); if (OPC_ansi) { __MOVE("__init(void)", OPC_BodyNameExt, 13); } else { @@ -196,7 +196,7 @@ void OPC_Ident (OPT_Object obj) int32 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62) && level > 0) || __IN(mode, 0x14)) { + if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -236,7 +236,7 @@ static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) int32 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c)) { + if (__IN(typ->comp, 0x0c, 64)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -293,7 +293,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c)) { + } else if (form == 12 || __IN(comp, 0x0c, 64)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -708,7 +708,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c)) { + } else if (__IN(str->comp, 0x0c, 64)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -1019,7 +1019,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { if (obj->typ != base || obj->vis != lastvis) { if (!first) { OPC_EndStat(); @@ -1144,7 +1144,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1238,7 +1238,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 63) { - if (__IN(i, OPM_glbopt)) { + if (__IN(i, OPM_glbopt, 64)) { switch (i) { case 0: OPM_Write('x'); @@ -1600,7 +1600,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1648,7 +1648,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c)) { + if (__IN(var->typ->comp, 0x0c, 64)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -2006,7 +2006,7 @@ void OPC_Constant (OPT_Const con, int32 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index aba4bdbb..646d0151 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 55420864..96868200 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -288,15 +288,15 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt); - OPM_dontLink = __IN(14, OPM_opt); - OPM_mainProg = __IN(10, OPM_opt); - OPM_mainLinkStat = __IN(15, OPM_opt); - OPM_notColorOutput = __IN(16, OPM_opt); - OPM_forceNewSym = __IN(17, OPM_opt); - OPM_Verbose = __IN(18, OPM_opt); + OPM_dontAsm = __IN(13, OPM_opt, 64); + OPM_dontLink = __IN(14, OPM_opt, 64); + OPM_mainProg = __IN(10, OPM_opt, 64); + OPM_mainLinkStat = __IN(15, OPM_opt, 64); + OPM_notColorOutput = __IN(16, OPM_opt, 64); + OPM_forceNewSym = __IN(17, OPM_opt, 64); + OPM_Verbose = __IN(18, OPM_opt, 64); if (OPM_mainLinkStat) { - OPM_glbopt |= __SETOF(10); + OPM_glbopt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -771,7 +771,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { Files_Register(OPM_newSFile); } } @@ -970,10 +970,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt)) { + if (!__IN(10, OPM_opt, 64)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt)) { + } else if (!__IN(10, OPM_opt, 64)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 1e5c3e72..d4b77c79 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index f175938c..7e958472 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c)) { + if (__IN(id->typ->comp, 0x1c, 64)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -998,7 +998,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int64 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0))) && !__IN(1, fwd->conval->setval))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1178,7 +1178,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18)) { + if (__IN(f, 0x18, 64)) { xval = x->conval->intval; } else { OPP_err(61); @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18)) { + } else if (!__IN((*x)->typ->form, 0x18, 64)) { OPP_err(125); } OPP_CheckSym(25); @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c)) { + if (__IN(obj->typ->comp, 0x1c, 64)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 2d3ebd77..9ddded2f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0c36910a..208f4934 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a16c2ce8..bb045fe9 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3006ea90..afc5a8b6 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -274,9 +274,9 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt); - OPT_findpc = __IN(8, opt); - OPT_extsf = OPT_newsf || __IN(9, opt); + OPT_newsf = __IN(4, opt, 64); + OPT_findpc = __IN(8, opt, 64); + OPT_extsf = OPT_newsf || __IN(9, opt, 64); OPT_sfpresent = 1; } @@ -609,7 +609,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c)) { + } else if (__IN(c, 0x0c, 64)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -680,7 +680,7 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480)) { + } else if (__IN(obj->mode, 0x0480, 64)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); @@ -1573,7 +1573,7 @@ static void OPT_OutObj (OPT_Object obj) OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea)) { + if (__IN(obj->mode, 0x06ea, 64)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 5f466ec4..090d9111 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 082797f1..098463c4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -130,10 +130,10 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt); - OPV_inxchk = __IN(0, OPM_opt); - OPV_mainprog = __IN(10, OPM_opt); - OPV_ansi = __IN(6, OPM_opt); + OPV_assert = __IN(7, OPM_opt, 64); + OPV_inxchk = __IN(0, OPM_opt, 64); + OPV_mainprog = __IN(10, OPM_opt, 64); + OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -150,7 +150,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { @@ -230,12 +230,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26)) { + if (__IN(mode, 0x26, 64)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0)) { + } else if (__IN(mode, 0x26c0, 64)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -289,7 +289,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { _o_result = 10; return _o_result; } else { @@ -298,7 +298,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c)) { + if (__IN(comp, 0x0c, 64)) { _o_result = 10; return _o_result; } else { @@ -445,7 +445,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) static void OPV_Entier (OPT_Node n, int32 prec) { - if (__IN(n->typ->form, 0x60)) { + if (__IN(n->typ->form, 0x60, 64)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -471,9 +471,11 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) if (to == 7) { OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -488,7 +490,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt)) { + if (__IN(2, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -511,7 +513,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15)) { + } else if (__IN(n->class, 0x15, 64)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -572,7 +574,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c)) { + if (!__IN(comp, 0x0c, 64)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -651,7 +653,7 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if (obj->mnolev != OPM_level) { @@ -690,7 +692,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt)) { + if (__IN(3, OPM_opt, 64)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -749,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c)) { + if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { if ((OPV_ansi && typ != n->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -757,13 +759,13 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else if (OPV_ansi) { - if ((__IN(comp, 0x0c) && n->class == 7)) { + if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x60) && n->typ->form == 4)) { + if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; } else if (form == 4) { @@ -846,7 +848,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { OPM_Write('('); } switch (class) { @@ -858,6 +860,8 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); OPV_expr(r, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(__ASHL(n->typ->size, 3)); OPM_Write(')'); break; case 11: @@ -924,18 +928,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x1890) && __IN(l->typ->form, 0x1890))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { + if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1032,20 +1036,24 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18000000)) { + if (__IN(subclass, 0x18008000, 64)) { OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(__ASHL(l->typ->size, 3)); + if (subclass == 15) { + OPM_WriteInt(__ASHL(r->typ->size, 3)); + } else { + OPM_WriteInt(__ASHL(l->typ->size, 3)); + } } OPM_Write(')'); break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100)) { + if (__IN(l->typ->form, 0x2100, 64)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1142,7 +1150,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { OPM_Write(')'); } } @@ -1432,7 +1440,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { OPV_NewArr(n->left, n->right); } break; @@ -1446,6 +1454,8 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPC_SetInclude(n->subcl == 16); OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_expr(n->right, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(n->left->typ->size, 3)); OPM_Write(')'); break; case 18: @@ -1623,7 +1633,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000)) { + if (!__IN(n->class, 0x09744000, 64)) { OPC_EndStat(); } n = n->link; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 3b43e61e..ea1f9aaa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index b7705767..3bb993de 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 290fc518..c1175e02 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2a753b7a..b3e89e04 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index c3cac05a..3892d49c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index d8c606d3..1eef261b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 130e1d06..8145aa00 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 056c54e0..d8710e54 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel) && fnt != NIL)) { + if ((__IN(0, sel, 64) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel)) { + if (__IN(1, sel, 64)) { un->col = col; } - if (__IN(2, sel)) { + if (__IN(2, sel, 64)) { un->voff = voff; } Texts_Merge(T, u, &un); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1e734f9d..8389bc47 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 08b89b00..3972af10 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 84d35faf..8864c777 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 4fe434e1..58286fd8 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 7651bcf8..bb60848a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 5d996dae..8a0d60be 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index b7524886..c143a6b3 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index ef3afa5a..11a9c941 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/12] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index bf3d0d7f..00023a0a 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -3,10 +3,12 @@ MODULE Heap; IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete before any other modules are initialized. *) + TYPE Address = SYSTEM.ADDRESS; + CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(SYSTEM.ADDRESS); (* Size of address *) + SZA = SIZE(Address); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) nofLists = 9; (* number of free_lists *) heapSize0 = 8000*Unit; (* startup heap size *) @@ -20,17 +22,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(Address, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(Address, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(Address, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.ADDRESS, -SZA); - AddressZero = SYSTEM.VAL(SYSTEM.ADDRESS, 0); + tagOff = SYSTEM.VAL(Address, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(Address, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(Address, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(Address, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(Address, -SZA); + AddressZero = SYSTEM.VAL(Address, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -46,7 +48,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: SYSTEM.ADDRESS; + types: Address; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,7 +66,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: SYSTEM.ADDRESS; (* weak pointer *) + obj: Address; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -73,15 +75,15 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF SYSTEM.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: SYSTEM.ADDRESS; - allocated*: SYSTEM.ADDRESS; + freeList: ARRAY nofLists + 1 OF Address; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: Address; + allocated*: Address; firstTry: BOOLEAN; (* extensible heap *) - heap: SYSTEM.ADDRESS; (* the sorted list of heap chunks *) - heapend: SYSTEM.ADDRESS; (* max possible pointer value (used for stack collection) *) - heapsize*: SYSTEM.ADDRESS; (* the sum of all heap chunk sizes *) + heap: Address; (* the sorted list of heap chunks *) + heapend: Address; (* max possible pointer value (used for stack collection) *) + heapsize*: Address; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +155,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: SYSTEM.ADDRESS); + PROCEDURE REGTYP*(m: Module; typ: Address); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -163,10 +165,10 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "Platform_OSAllocate(size)"; + PROCEDURE -OSAllocate(size: Address): Address "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: SYSTEM.ADDRESS): SYSTEM.ADDRESS; - VAR chnk: SYSTEM.ADDRESS; + PROCEDURE NewChunk(blksz: Address): Address; + VAR chnk: Address; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -182,19 +184,13 @@ MODULE Heap; END NewChunk; - (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works - correctly regardless of the size of an address. Specifically on 32 bit address - architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT - rather than loading 64 bits. - - NOTE - with uintpr work complete this function should be replaced with SYSTEM.GET - as there will be no need to extend addresses to larger types. + (* + PROCEDURE -FetchAddress(pointer: Address): Address "(address)(*((void**)((address)pointer)))"; *) + PROCEDURE FetchAddress(pointer: Address): Address; VAR r: Address; BEGIN SYSTEM.GET(pointer, r); RETURN r END FetchAddress; - PROCEDURE -FetchAddress(pointer: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)(*((void**)((address)pointer)))"; - - PROCEDURE ExtendHeap(blksz: SYSTEM.ADDRESS); - VAR size, chnk, j, next: SYSTEM.ADDRESS; + PROCEDURE ExtendHeap(blksz: Address); + VAR size, chnk, j, next: Address; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -218,16 +214,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: SYSTEM.ADDRESS): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: Address): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.ADDRESS; + i, i0, di, blksz, restsize, t, adr, end, next, prev: Address; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.ADDRESS)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -310,23 +306,23 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: SYSTEM.ADDRESS): SYSTEM.PTR; - VAR blksz, tag: SYSTEM.ADDRESS; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: Address): SYSTEM.PTR; + VAR blksz, tag: Address; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(SYSTEM.ADDRESS, new) + blksz - 3*SZA; + tag := SYSTEM.VAL(Address, new) + blksz - 3*SZA; SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(SYSTEM.ADDRESS, new) - SZA, tag); + SYSTEM.PUT(SYSTEM.VAL(Address, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: SYSTEM.ADDRESS); - VAR p, tag, offset, fld, n, tagbits: SYSTEM.ADDRESS; + PROCEDURE Mark(q: Address); + VAR p, tag, offset, fld, n, tagbits: Address; BEGIN IF q # 0 THEN tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) @@ -365,11 +361,11 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(SYSTEM.ADDRESS, p)) + Mark(SYSTEM.VAL(Address, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.ADDRESS; + VAR chnk, adr, end, start, tag, i, size, freesize: Address; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; @@ -414,8 +410,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); - VAR i, j, x: SYSTEM.ADDRESS; + PROCEDURE Sift (l, r: Address; VAR a: ARRAY OF Address); + VAR i, j, x: Address; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -425,15 +421,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); - VAR l, r, x: SYSTEM.ADDRESS; + PROCEDURE HeapSort (n: Address; VAR a: ARRAY OF Address); + VAR l, r, x: Address; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.ADDRESS; + PROCEDURE MarkCandidates(n: Address; VAR cand: ARRAY OF Address); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: Address; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -459,7 +455,7 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: SYSTEM.ADDRESS; + VAR n: FinNode; tag: Address; BEGIN n := fin; WHILE n # NIL DO @@ -496,13 +492,13 @@ MODULE Heap; END FINALL; PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): SYSTEM.ADDRESS "Platform_MainStackFrame"; + PROCEDURE -PlatformMainStackFrame(): Address "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); + PROCEDURE MarkStack(n: Address; VAR cand: ARRAY OF Address); VAR frame: SYSTEM.PTR; - inc, nofcand: SYSTEM.ADDRESS; - sp, p, stack0: SYSTEM.ADDRESS; + inc, nofcand: Address; + sp, p, stack0: Address; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -529,8 +525,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.ADDRESS; - cand: ARRAY 10000 OF SYSTEM.ADDRESS; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: Address; + cand: ARRAY 10000 OF Address; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -565,7 +561,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(SYSTEM.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(Address, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index defcc9fa..6efc8321 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -46,37 +46,6 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } - -void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) -{ - t -= __TPROC0OFF; - t0 -= __TPROC0OFF; - while (*t0 != __EOM) {*t = *t0; t--; t0--;} -} - - -void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) -{ - while (n > 0) { - P((address)(*((void**)(adr)))); - adr = ((void**)adr) + 1; - n--; - } -} - -void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) -{ - LONGINT *t, off; - typ++; - while (n > 0) { - t = typ; - off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} - adr = ((char*)adr) + size; - n--; - } -} - LONGINT SYSTEM_ENTIER(double x) { LONGINT y; @@ -88,22 +57,55 @@ LONGINT SYSTEM_ENTIER(double x) } } + + + +void SYSTEM_INHERIT(address *t, address *t0) +{ + t -= __TPROC0OFF; + t0 -= __TPROC0OFF; + while (*t0 != __EOM) {*t = *t0; t--; t0--;} +} + + +void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +{ + while (n > 0) { + P((address)(*((void**)(adr)))); + adr = ((void**)adr) + 1; + n--; + } +} + +void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +{ + address *t, off; + typ++; + while (n > 0) { + t = typ; + off = *t; + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + adr = ((char*)adr) + size; + n--; + } +} + extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - LONGINT nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, LONGINT); nofdim--; + nofelems = nofelems * va_arg(ap, address); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(LONGINT); - if (elemalgn > sizeof(LONGINT)) { + dataoff = nofdyn * sizeof(address); + if (elemalgn > sizeof(address)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -113,37 +115,37 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (LONGINT*)POINTER__typ) { + else if (typ == (address*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(address)); + p = (address*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} - *p = - (nofelems + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nofelems * sizeof(LONGINT); + while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} + *p = - (nofelems + 1) * sizeof(address); /* sentinel */ + x[-1] -= nofelems * sizeof(address); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(address)); + p = (address*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(LONGINT); /* sentinel */ - x[-1] -= nptr * sizeof(LONGINT); + *p = - (nptr + 1) * sizeof(address); /* sentinel */ + x[-1] -= nptr * sizeof(address); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, LONGINT); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 7c645e85..ddd85144 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -243,6 +243,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) +#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) @@ -282,56 +286,52 @@ extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) +#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0); -extern void SYSTEM_ENUMP (void *adr, LONGINT n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()); +extern void SYSTEM_INHERIT(address *t, address *t0); +extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - LONGINT tproc[m]; /* Proc for each ptr field */ \ - LONGINT tag; \ - LONGINT next; /* Module table type list points here */ \ - LONGINT level; \ - LONGINT module; \ + address tproc[m]; /* Proc for each ptr field */ \ + address tag; \ + address next; /* Module table type list points here */ \ + address level; \ + address module; \ char name[24]; \ - LONGINT basep[__MAXEXT]; /* List of bases this extends */ \ - LONGINT reserved; \ - LONGINT blksz; /* xxx_typ points here */ \ - LONGINT ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + address basep[__MAXEXT]; /* List of bases this extends */ \ + address reserved; \ + address blksz; /* xxx_typ points here */ \ + address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(LONGINT)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (LONGINT)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (LONGINT)(size), (LONGINT)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (LONGINT*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ - t##__desc.module = (LONGINT)(address)m; \ + t##__typ = (address*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ + t##__desc.basep[level] = (address)t##__typ; \ + t##__desc.module = (address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ + Heap_REGTYP(m, (address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) -#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc #define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index a2fd3632..b9c5c369 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -13 Sep 2016 20:12:45 +14 Sep 2016 13:00:54 From a36e04ebd72fd23ab7480d773423daa17d00c959 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 14:01:31 +0100 Subject: [PATCH 033/140] Replace FetchAddress with (original) SYSTEM.GET. --- bootstrap/unix-44/Heap.c | 60 ++++++++++------------- bootstrap/unix-48/Heap.c | 60 ++++++++++------------- bootstrap/unix-88/Heap.c | 60 ++++++++++------------- bootstrap/windows-48/Heap.c | 60 ++++++++++------------- bootstrap/windows-88/Heap.c | 60 ++++++++++------------- src/system/Heap.Mod | 56 ++++++++++----------- src/test/confidence/planned-binary-change | 2 +- 7 files changed, 151 insertions(+), 207 deletions(-) diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 626812cb..26f7af6f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 8); + __GET(adr + 8, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 24); + __GET(adr + 24, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 288) { __PUT(adr + 8, restsize, address); } else { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 8); + __GET(q - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 8, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 8); + __GET(q - 8, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 8); + __GET(n - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, address); __PUT(q - 8, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - end = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - lim1 = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 8); + __GET(n->obj - 8, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __GET(Heap_heap + 8, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f03a4d7e..b3a5908c 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 4); + __GET(adr + 4, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 12); + __GET(adr + 12, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 144) { __PUT(adr + 4, restsize, address); } else { - next = Heap_FetchAddress(adr + 12); + __GET(adr + 12, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 4); + __GET(q - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 4, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 4); + __GET(q - 4, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 4); + __GET(n - 4, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, address); __PUT(q - 4, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - end = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - lim1 = Heap_FetchAddress(chnk + 4); + __GET(chnk + 4, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 4); + __GET(n->obj - 4, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 4); + __GET(Heap_heap + 4, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 626812cb..26f7af6f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -82,7 +82,6 @@ export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); -static address Heap_FetchAddress (address pointer); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); static void Heap_HeapSort (address n, address *a, LONGINT a__len); @@ -188,15 +187,6 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static address Heap_FetchAddress (address pointer) -{ - address _o_result; - address r; - __GET(pointer, r, address); - _o_result = r; - return _o_result; -} - static void Heap_ExtendHeap (address blksz) { address size, chnk, j, next; @@ -212,16 +202,16 @@ static void Heap_ExtendHeap (address blksz) Heap_heap = chnk; } else { j = Heap_heap; - next = Heap_FetchAddress(j); + __GET(j, next, address); while ((next != 0 && chnk > next)) { j = next; - next = Heap_FetchAddress(j); + __GET(j, next, address); } __PUT(chnk, next, address); __PUT(j, chnk, address); } if (next == 0) { - Heap_heapend = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, Heap_heapend, address); } } } @@ -232,7 +222,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - blksz = Heap_FetchAddress(tag); + __GET(tag, blksz, address); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -243,7 +233,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); Heap_freeList[i] = next; if (i != i0) { di = i - i0; @@ -284,12 +274,12 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - t = Heap_FetchAddress(adr + 8); + __GET(adr + 8, t, address); if (t >= blksz) { break; } prev = adr; - adr = Heap_FetchAddress(adr + 24); + __GET(adr + 24, adr, address); } restsize = t - blksz; end = adr + restsize; @@ -299,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (address tag) if (restsize > 288) { __PUT(adr + 8, restsize, address); } else { - next = Heap_FetchAddress(adr + 24); + __GET(adr + 24, next, address); if (prev == 0) { Heap_bigBlocks = next; } else { @@ -355,7 +345,7 @@ static void Heap_Mark (address q) { address p, tag, offset, fld, n, tagbits; if (q != 0) { - tagbits = Heap_FetchAddress(q - 8); + __GET(q - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(q - 8, tagbits + 1, address); p = 0; @@ -369,17 +359,17 @@ static void Heap_Mark (address q) } n = q; q = p; - tag = Heap_FetchAddress(q - 8); + __GET(q - 8, tag, address); tag -= 1; __GET(tag, offset, address); fld = q + offset; - p = Heap_FetchAddress(fld); + __GET(fld, p, address); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - n = Heap_FetchAddress(fld); + __GET(fld, n, address); if (n != 0) { - tagbits = Heap_FetchAddress(n - 8); + __GET(n - 8, tagbits, address); if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, address); __PUT(q - 8, tag + 1, address); @@ -415,9 +405,9 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - end = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, end, address); while (adr < end) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; @@ -436,11 +426,11 @@ static void Heap_Scan (void) } tag -= 1; __PUT(adr, tag, address); - size = Heap_FetchAddress(tag); + __GET(tag, size, address); Heap_allocated += size; adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); freesize += size; adr += size; } @@ -460,7 +450,7 @@ static void Heap_Scan (void) Heap_bigBlocks = start; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -509,17 +499,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - lim1 = Heap_FetchAddress(chnk + 8); + __GET(chnk + 8, lim1, address); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - tag = Heap_FetchAddress(adr); + __GET(adr, tag, address); if (__ODD(tag)) { - size = Heap_FetchAddress(tag - 1); + __GET(tag - 1, size, address); adr += size; } else { - size = Heap_FetchAddress(tag); + __GET(tag, size, address); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -534,7 +524,7 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - chnk = Heap_FetchAddress(chnk); + __GET(chnk, chnk, address); } } @@ -544,7 +534,7 @@ static void Heap_CheckFin (void) address tag; n = Heap_fin; while (n != NIL) { - tag = Heap_FetchAddress(n->obj - 8); + __GET(n->obj - 8, tag, address); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -723,7 +713,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - Heap_heapend = Heap_FetchAddress(Heap_heap + 8); + __GET(Heap_heap + 8, Heap_heapend, address); __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 00023a0a..0ba6d076 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -183,12 +183,6 @@ MODULE Heap; RETURN chnk END NewChunk; - - (* - PROCEDURE -FetchAddress(pointer: Address): Address "(address)(*((void**)((address)pointer)))"; - *) - PROCEDURE FetchAddress(pointer: Address): Address; VAR r: Address; BEGIN SYSTEM.GET(pointer, r); RETURN r END FetchAddress; - PROCEDURE ExtendHeap(blksz: Address); VAR size, chnk, j, next: Address; BEGIN @@ -201,14 +195,14 @@ MODULE Heap; IF chnk < heap THEN SYSTEM.PUT(chnk, heap); heap := chnk ELSE - j := heap; next := FetchAddress(j); + j := heap; SYSTEM.GET(j, next); WHILE (next # 0) & (chnk > next) DO j := next; - next := FetchAddress(j) + SYSTEM.GET(j, next) END; SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) END ; - IF next = 0 THEN heapend := FetchAddress(chnk+endOff) END + IF next = 0 THEN SYSTEM.GET(chnk+endOff, heapend) END END END ExtendHeap; @@ -220,7 +214,7 @@ MODULE Heap; new: SYSTEM.PTR; BEGIN Lock(); - blksz := FetchAddress(tag); + SYSTEM.GET(tag, blksz); ASSERT((Unit = 16) OR (Unit = 32)); ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); @@ -231,7 +225,7 @@ MODULE Heap; WHILE adr = 0 DO INC(i); adr := freeList[i] END END ; IF i < nofLists THEN (* unlink *) - next := FetchAddress(adr + nextOff); + SYSTEM.GET(adr + nextOff, next); freeList[i] := next; IF i # i0 THEN (* split *) di := i - i0; restsize := di * Unit; end := adr + restsize; @@ -265,9 +259,9 @@ MODULE Heap; Unlock(); RETURN NIL END END ; - t := FetchAddress(adr+sizeOff); + SYSTEM.GET(adr+sizeOff, t); IF t >= blksz THEN EXIT END ; - prev := adr; adr := FetchAddress(adr + nextOff) + prev := adr; SYSTEM.GET(adr + nextOff, adr) END ; restsize := t - blksz; end := adr + restsize; SYSTEM.PUT(end + sizeOff, blksz); @@ -276,7 +270,7 @@ MODULE Heap; IF restsize > nofLists * Unit THEN (*resize*) SYSTEM.PUT(adr + sizeOff, restsize) ELSE (*unlink*) - next := FetchAddress(adr + nextOff); + SYSTEM.GET(adr + nextOff, next); IF prev = 0 THEN bigBlocks := next ELSE SYSTEM.PUT(prev + nextOff, next); END ; @@ -325,7 +319,7 @@ MODULE Heap; VAR p, tag, offset, fld, n, tagbits: Address; BEGIN IF q # 0 THEN - tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) + SYSTEM.GET(q - SZA, tagbits); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; @@ -336,14 +330,14 @@ MODULE Heap; SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - tag := FetchAddress(q - SZA); DEC(tag, 1); + SYSTEM.GET(q - SZA, tag); DEC(tag, 1); SYSTEM.GET(tag, offset); fld := q + offset; - p := FetchAddress(fld); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) + SYSTEM.GET(fld, p); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) ELSE (* offset references a ptr field *) fld := q + offset; (* Address the pointer *) - n := FetchAddress(fld); (* Load the pointer *) + SYSTEM.GET(fld, n); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - tagbits := FetchAddress(n - SZA); (* Consider record pointed to by this field *) + SYSTEM.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN SYSTEM.PUT(n - SZA, tagbits + 1); SYSTEM.PUT(q - SZA, tag + 1); @@ -371,9 +365,9 @@ MODULE Heap; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO adr := chnk + blkOff; - end := FetchAddress(chnk + endOff); + SYSTEM.GET(chnk + endOff, end); WHILE adr < end DO - tag := FetchAddress(adr); + SYSTEM.GET(adr, tag); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; @@ -387,11 +381,11 @@ MODULE Heap; END ; DEC(tag, 1); SYSTEM.PUT(adr, tag); - size := FetchAddress(tag); + SYSTEM.GET(tag, size); INC(allocated, size); INC(adr, size) ELSE (*unmarked*) - size := FetchAddress(tag); + SYSTEM.GET(tag, size); INC(freesize, size); INC(adr, size) END @@ -406,7 +400,7 @@ MODULE Heap; ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; - chnk := FetchAddress(chnk) + SYSTEM.GET(chnk, chnk) END END Scan; @@ -434,14 +428,14 @@ MODULE Heap; chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO adr := chnk + blkOff; - lim1 := FetchAddress(chnk + endOff); + SYSTEM.GET(chnk + endOff, lim1); IF lim < lim1 THEN lim1 := lim END ; WHILE adr < lim1 DO - tag := FetchAddress(adr); + SYSTEM.GET(adr, tag); IF ODD(tag) THEN (*already marked*) - size := FetchAddress(tag-1); INC(adr, size) + SYSTEM.GET(tag-1, size); INC(adr, size) ELSE - size := FetchAddress(tag); + SYSTEM.GET(tag, size); ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; @@ -450,7 +444,7 @@ MODULE Heap; adr := next END END ; - chnk := FetchAddress(chnk) + SYSTEM.GET(chnk, chnk) END END MarkCandidates; @@ -459,7 +453,7 @@ MODULE Heap; BEGIN n := fin; WHILE n # NIL DO - tag := FetchAddress(n.obj - SZA); + SYSTEM.GET(n.obj - SZA, tag); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -574,7 +568,7 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; initialised, to enable NEW, SYSTEM.NEW *) BEGIN heap := NewChunk(heapSize0); - heapend := FetchAddress(heap + endOff); + SYSTEM.GET(heap + endOff, heapend); SYSTEM.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index b9c5c369..9613b179 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -14 Sep 2016 13:00:54 +14 Sep 2016 13:59:08 From 7fad168e4081c27d7bd266edb51b49b9a70f23fd Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 14 Sep 2016 14:22:24 +0100 Subject: [PATCH 034/140] Tidy source of HEAP a bit. --- src/system/Heap.Mod | 308 ++++++++++++++++++++++---------------------- 1 file changed, 153 insertions(+), 155 deletions(-) diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 0ba6d076..b05b218b 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -1,17 +1,15 @@ MODULE Heap; - IMPORT SYSTEM; (* Cannot import anything else as heap initialization must complete - before any other modules are initialized. *) - - TYPE Address = SYSTEM.ADDRESS; + IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete + before any other modules are initialized. *) CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(Address); (* Size of address *) - Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) + SZA = SIZE(S.ADDRESS); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) (* all blocks look the same: free blocks describe themselves: size = Unit @@ -22,17 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(Address, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(Address, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(Address, 3*SZA); (* first block in a chunk *) + nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) + blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(Address, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(Address, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(Address, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(Address, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(Address, -SZA); - AddressZero = SYSTEM.VAL(Address, 0); + tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) + sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = S.VAL(S.ADDRESS, -SZA); + AddressZero = S.VAL(S.ADDRESS, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -41,14 +39,14 @@ MODULE Heap; Module = POINTER TO ModuleDesc; Cmd = POINTER TO CmdDesc; - EnumProc = PROCEDURE(P: PROCEDURE(p: SYSTEM.PTR)); + EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); ModuleDesc = RECORD next: Module; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: Address; + types: S.ADDRESS; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -61,29 +59,29 @@ MODULE Heap; cmd: Command END ; - Finalizer = PROCEDURE(obj: SYSTEM.PTR); + Finalizer = PROCEDURE(obj: S.PTR); FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: Address; (* weak pointer *) + obj: S.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; VAR (* the list of loaded (=initialization started) modules *) - modules*: SYSTEM.PTR; + modules*: S.PTR; - freeList: ARRAY nofLists + 1 OF Address; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: Address; - allocated*: Address; + freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: S.ADDRESS; + allocated*: S.ADDRESS; firstTry: BOOLEAN; (* extensible heap *) - heap: Address; (* the sorted list of heap chunks *) - heapend: Address; (* max possible pointer value (used for stack collection) *) - heapsize*: Address; (* the sum of all heap chunk sizes *) + heap: S.ADDRESS; (* the sorted list of heap chunks *) + heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -122,20 +120,20 @@ MODULE Heap; END TAS; *) - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): SYSTEM.PTR; + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; VAR m: Module; BEGIN (* REGMOD is called at the start of module initialisation code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the Heap module itself, we - must use SYSTEM.NEW. *) + must use S.NEW. *) IF name = "Heap" THEN - SYSTEM.NEW(m, SIZE(ModuleDesc)) + S.NEW(m, SIZE(ModuleDesc)) ELSE NEW(m) END; m.types := 0; m.cmds := NIL; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := SYSTEM.VAL(Module, modules); + COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); modules := m; RETURN m END REGMOD; @@ -146,17 +144,17 @@ MODULE Heap; (* REGCMD is called during module initialisation code before that modules type descriptors have been set up. 'NEW' depends on the Heap modules type descriptors being ready for use, therefore, just for the commands registered - by the Heap module itself, we must use SYSTEM.NEW. *) + by the Heap module itself, we must use S.NEW. *) IF m.name = "Heap" THEN - SYSTEM.NEW(c, SIZE(CmdDesc)) + S.NEW(c, SIZE(CmdDesc)) ELSE NEW(c) END; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: Address); - BEGIN SYSTEM.PUT(typ, m.types); m.types := typ + PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); + BEGIN S.PUT(typ, m.types); m.types := typ END REGTYP; PROCEDURE INCREF*(m: Module); @@ -165,26 +163,26 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: Address): Address "Platform_OSAllocate(size)"; + PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: Address): Address; - VAR chnk: Address; + PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; + VAR chnk: S.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN - SYSTEM.PUT(chnk + endOff, chnk + (blkOff + blksz)); - SYSTEM.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - SYSTEM.PUT(chnk + (blkOff + sizeOff), blksz); - SYSTEM.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - SYSTEM.PUT(chnk + (blkOff + nextOff), bigBlocks); + S.PUT(chnk + endOff, chnk + (blkOff + blksz)); + S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + S.PUT(chnk + (blkOff + sizeOff), blksz); + S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); + S.PUT(chnk + (blkOff + nextOff), bigBlocks); bigBlocks := chnk + blkOff; INC(heapsize, blksz) END ; RETURN chnk END NewChunk; - PROCEDURE ExtendHeap(blksz: Address); - VAR size, chnk, j, next: Address; + PROCEDURE ExtendHeap(blksz: S.ADDRESS); + VAR size, chnk, j, next: S.ADDRESS; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -193,31 +191,31 @@ MODULE Heap; IF chnk # 0 THEN (*sorted insertion*) IF chnk < heap THEN - SYSTEM.PUT(chnk, heap); heap := chnk + S.PUT(chnk, heap); heap := chnk ELSE - j := heap; SYSTEM.GET(j, next); + j := heap; S.GET(j, next); WHILE (next # 0) & (chnk > next) DO j := next; - SYSTEM.GET(j, next) + S.GET(j, next) END; - SYSTEM.PUT(chnk, next); SYSTEM.PUT(j, chnk) + S.PUT(chnk, next); S.PUT(j, chnk) END ; - IF next = 0 THEN SYSTEM.GET(chnk+endOff, heapend) END + IF next = 0 THEN S.GET(chnk+endOff, heapend) END END END ExtendHeap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: Address): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: Address; - new: SYSTEM.PTR; + i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; + new: S.PTR; BEGIN Lock(); - SYSTEM.GET(tag, blksz); + S.GET(tag, blksz); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(Address)); + ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -225,15 +223,15 @@ MODULE Heap; WHILE adr = 0 DO INC(i); adr := freeList[i] END END ; IF i < nofLists THEN (* unlink *) - SYSTEM.GET(adr + nextOff, next); + S.GET(adr + nextOff, next); freeList[i] := next; IF i # i0 THEN (* split *) di := i - i0; restsize := di * Unit; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); freeList[di] := adr; INC(adr, restsize) END @@ -259,25 +257,25 @@ MODULE Heap; Unlock(); RETURN NIL END END ; - SYSTEM.GET(adr+sizeOff, t); + S.GET(adr+sizeOff, t); IF t >= blksz THEN EXIT END ; - prev := adr; SYSTEM.GET(adr + nextOff, adr) + prev := adr; S.GET(adr + nextOff, adr) END ; restsize := t - blksz; end := adr + restsize; - SYSTEM.PUT(end + sizeOff, blksz); - SYSTEM.PUT(end + sntlOff, NoPtrSntl); - SYSTEM.PUT(end, end + sizeOff); + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); IF restsize > nofLists * Unit THEN (*resize*) - SYSTEM.PUT(adr + sizeOff, restsize) + S.PUT(adr + sizeOff, restsize) ELSE (*unlink*) - SYSTEM.GET(adr + nextOff, next); + S.GET(adr + nextOff, next); IF prev = 0 THEN bigBlocks := next - ELSE SYSTEM.PUT(prev + nextOff, next); + ELSE S.PUT(prev + nextOff, next); END ; IF restsize > 0 THEN (*move*) di := restsize DIV Unit; - SYSTEM.PUT(adr + sizeOff, restsize); - SYSTEM.PUT(adr + nextOff, freeList[di]); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); freeList[di] := adr END END ; @@ -285,63 +283,63 @@ MODULE Heap; END ; i := adr + 4*SZA; end := adr + blksz; WHILE i < end DO (*deliberately unrolled*) - SYSTEM.PUT(i, AddressZero); - SYSTEM.PUT(i + SZA, AddressZero); - SYSTEM.PUT(i + 2*SZA, AddressZero); - SYSTEM.PUT(i + 3*SZA, AddressZero); + S.PUT(i, AddressZero); + S.PUT(i + SZA, AddressZero); + S.PUT(i + 2*SZA, AddressZero); + S.PUT(i + 3*SZA, AddressZero); INC(i, 4*SZA) END ; - SYSTEM.PUT(adr + nextOff, AddressZero); - SYSTEM.PUT(adr, tag); - SYSTEM.PUT(adr + sizeOff, AddressZero); - SYSTEM.PUT(adr + sntlOff, AddressZero); + S.PUT(adr + nextOff, AddressZero); + S.PUT(adr, tag); + S.PUT(adr + sizeOff, AddressZero); + S.PUT(adr + sntlOff, AddressZero); INC(allocated, blksz); Unlock(); - RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) + RETURN S.VAL(S.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: Address): SYSTEM.PTR; - VAR blksz, tag: Address; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; + VAR blksz, tag: S.ADDRESS; new: S.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(Address, new) + blksz - 3*SZA; - SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) - SYSTEM.PUT(tag, blksz); - SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(Address, new) - SZA, tag); + new := NEWREC(S.ADR(blksz)); + tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; + S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) + S.PUT(tag, blksz); + S.PUT(tag + SZA, NoPtrSntl); + S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: Address); - VAR p, tag, offset, fld, n, tagbits: Address; + PROCEDURE Mark(q: S.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; BEGIN IF q # 0 THEN - SYSTEM.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) IF ~ODD(tagbits) THEN (* If it has not already been marked *) - SYSTEM.PUT(q - SZA, tagbits + 1); (* Mark it *) + S.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP - SYSTEM.GET(tag, offset); (* Get next ptr field offset *) + S.GET(tag, offset); (* Get next ptr field offset *) IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) - SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) + S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; - SYSTEM.GET(q - SZA, tag); DEC(tag, 1); - SYSTEM.GET(tag, offset); fld := q + offset; - SYSTEM.GET(fld, p); SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, n)) + S.GET(q - SZA, tag); DEC(tag, 1); + S.GET(tag, offset); fld := q + offset; + S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) ELSE (* offset references a ptr field *) - fld := q + offset; (* Address the pointer *) - SYSTEM.GET(fld, n); (* Load the pointer *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) IF n # 0 THEN (* If pointer is not NIL *) - SYSTEM.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN - SYSTEM.PUT(n - SZA, tagbits + 1); - SYSTEM.PUT(q - SZA, tag + 1); - SYSTEM.PUT(fld, SYSTEM.VAL(SYSTEM.PTR, p)); + S.PUT(n - SZA, tagbits + 1); + S.PUT(q - SZA, tag + 1); + S.PUT(fld, S.VAL(S.PTR, p)); p := q; q := n; tag := tagbits END @@ -353,59 +351,59 @@ MODULE Heap; END END Mark; - PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) + PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(Address, p)) + Mark(S.VAL(S.ADDRESS, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: Address; + VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; WHILE chnk # 0 DO adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, end); + S.GET(chnk + endOff, end); WHILE adr < end DO - SYSTEM.GET(adr, tag); + S.GET(adr, tag); IF ODD(tag) THEN (*marked*) IF freesize > 0 THEN start := adr - freesize; - SYSTEM.PUT(start, start+SZA); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; DEC(tag, 1); - SYSTEM.PUT(adr, tag); - SYSTEM.GET(tag, size); + S.PUT(adr, tag); + S.GET(tag, size); INC(allocated, size); INC(adr, size) ELSE (*unmarked*) - SYSTEM.GET(tag, size); + S.GET(tag, size); INC(freesize, size); INC(adr, size) END END ; IF freesize > 0 THEN (*collect last block*) start := adr - freesize; - SYSTEM.PUT(start, start+SZA); - SYSTEM.PUT(start+sizeOff, freesize); - SYSTEM.PUT(start+sntlOff, NoPtrSntl); + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN SYSTEM.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE SYSTEM.PUT(start + nextOff, bigBlocks); bigBlocks := start + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start END END ; - SYSTEM.GET(chnk, chnk) + S.GET(chnk, chnk) END END Scan; - PROCEDURE Sift (l, r: Address; VAR a: ARRAY OF Address); - VAR i, j, x: Address; + PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR i, j, x: S.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -415,27 +413,27 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: Address; VAR a: ARRAY OF Address); - VAR l, r, x: Address; + PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR l, r, x: S.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: Address; VAR cand: ARRAY OF Address); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: Address; + PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO adr := chnk + blkOff; - SYSTEM.GET(chnk + endOff, lim1); + S.GET(chnk + endOff, lim1); IF lim < lim1 THEN lim1 := lim END ; WHILE adr < lim1 DO - SYSTEM.GET(adr, tag); + S.GET(adr, tag); IF ODD(tag) THEN (*already marked*) - SYSTEM.GET(tag-1, size); INC(adr, size) + S.GET(tag-1, size); INC(adr, size) ELSE - SYSTEM.GET(tag, size); + S.GET(tag, size); ptr := adr + SZA; WHILE cand[i] < ptr DO INC(i) END ; IF i = n THEN RETURN END ; @@ -444,16 +442,16 @@ MODULE Heap; adr := next END END ; - SYSTEM.GET(chnk, chnk) + S.GET(chnk, chnk) END END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: Address; + VAR n: FinNode; tag: S.ADDRESS; BEGIN n := fin; WHILE n # NIL DO - SYSTEM.GET(n.obj - SZA, tag); + S.GET(n.obj - SZA, tag); IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) ELSE n.marked := TRUE END ; @@ -467,7 +465,7 @@ MODULE Heap; WHILE n # NIL DO IF ~n.marked THEN IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)); + n.finalize(S.VAL(S.PTR, n.obj)); (* new nodes may have been pushed in n.finalize, therefore: *) IF prev = NIL THEN n := fin ELSE n := n.next END ELSE @@ -481,31 +479,31 @@ MODULE Heap; BEGIN WHILE fin # NIL DO n := fin; fin := fin.next; - n.finalize(SYSTEM.VAL(SYSTEM.PTR, n.obj)) + n.finalize(S.VAL(S.PTR, n.obj)) END END FINALL; PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): Address "Platform_MainStackFrame"; + PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: Address; VAR cand: ARRAY OF Address); + PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); VAR - frame: SYSTEM.PTR; - inc, nofcand: Address; - sp, p, stack0: Address; - align: RECORD ch: CHAR; p: SYSTEM.PTR END ; + frame: S.PTR; + inc, nofcand: S.ADDRESS; + sp, p, stack0: S.ADDRESS; + align: RECORD ch: CHAR; p: S.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) END ; IF n = 0 THEN - nofcand := 0; sp := SYSTEM.ADR(frame); + nofcand := 0; sp := S.ADR(frame); stack0 := PlatformMainStackFrame(); (* check for minimum alignment of pointers *) - inc := SYSTEM.ADR(align.p) - SYSTEM.ADR(align); + inc := S.ADR(align.p) - S.ADR(align); IF sp > stack0 THEN inc := -inc END ; WHILE sp # stack0 DO - SYSTEM.GET(sp, p); + S.GET(sp, p); IF (p > heap) & (p < heapend) THEN IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; cand[nofcand] := p; INC(nofcand) @@ -519,12 +517,12 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: Address; - cand: ARRAY 10000 OF Address; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; + cand: ARRAY 10000 OF S.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); - m := SYSTEM.VAL(Module, modules); + m := S.VAL(Module, modules); WHILE m # NIL DO IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; m := m^.next @@ -552,10 +550,10 @@ MODULE Heap; END END GC; - PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); + PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(Address, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; @@ -565,11 +563,11 @@ PROCEDURE -HeapModuleInit 'Heap__init()'; PROCEDURE InitHeap*; (* InitHeap is called by Platform.init before any module bodies have been - initialised, to enable NEW, SYSTEM.NEW *) + initialised, to enable NEW, S.NEW *) BEGIN heap := NewChunk(heapSize0); - SYSTEM.GET(heap + endOff, heapend); - SYSTEM.PUT(heap, AddressZero); + S.GET(heap + endOff, heapend); + S.PUT(heap, AddressZero); allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; interrupted := FALSE; From dc699db9f5006433913b762ddf6c09d6c1c4e0bd Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 15 Sep 2016 15:23:08 +0100 Subject: [PATCH 035/140] Support 64 bit integer literals on all builds, and fix 64 bit Console.hex display. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 5 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 19 +- bootstrap/unix-44/OPS.h | 4 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 5 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 19 +- bootstrap/unix-48/OPS.h | 4 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 7 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 9 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 5 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 19 +- bootstrap/windows-48/OPS.h | 4 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 7 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 9 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPS.Mod | 16 +- src/library/ulm/ulmIO.Mod | 429 +++++++++++++-------------- src/library/ulm/ulmSYSTEM.Mod | 14 +- src/system/Console.Mod | 6 +- 199 files changed, 478 insertions(+), 477 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 5a0b29a2..4007101f 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 58145066..17a56a1d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 521906c3..81a5660b 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 1bf0628e..a7b7d28a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7c0b2d21..574abdf6 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 503c4e06..9ae78a2d 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index b5b22e1b..af7ba940 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 5a0b29a2..4007101f 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 58145066..17a56a1d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 521906c3..81a5660b 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 1bf0628e..a7b7d28a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7c0b2d21..574abdf6 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 4d12f6cb..660559f5 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 2b694f6c..5ac796d7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index f3f2e52d..e936fb1b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 5039dae6..c25651d5 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -102,8 +102,9 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int64 i) { - int64 k, n; - k = -28; + int32 k; + int64 n; + k = -60; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 8336a3d0..288d9e0a 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1f4e38bf..79b77102 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b1a16504..048e6c0f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 26f7af6f..fa10e8c0 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 08afe43e..ecebdfeb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3a48e24a..66df0a5c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 3ebde4f3..86580ab4 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 883d2559..5a6a8dda 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 35fb2186..94ff6cbf 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ef8f41a1..a4e6388c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 646d0151..185ac689 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 96868200..6b30d07b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d4b77c79..9c71f996 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 7e958472..dce9eaec 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 208f4934..61d3ad08 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e, maxHdig; + int32 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -187,9 +187,8 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 16; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bb045fe9..eef23e1f 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index afc5a8b6..82c2df59 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 090d9111..7b529043 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 098463c4..023ee089 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index f428c2b1..8bbc2357 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d9212710..077cb445 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b3e89e04..b4890fa9 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 3892d49c..37f91340 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1eef261b..4f6767e1 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 8145aa00..235891d2 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index d8710e54..7a6726a6 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8389bc47..ea9dde4b 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 3972af10..fef94478 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8864c777..88cb5688 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index bb60848a..08e242e0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index c143a6b3..96358c5b 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 11a9c941..b9c5430c 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d8c934bf..06ec0ed7 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 359bad0a..931e8e9b 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -102,7 +102,8 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int32 i) { - int32 k, n; + int16 k; + int64 n; k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 0af02096..23ec5930 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 01218f26..50b625ff 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ffdc05f6..f680e056 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b3a5908c..c3422d37 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 29b4cb26..2a231c6e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a71d3e4d..74cb4e47 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6a744f9b..ba7f2930 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a905da35..5bc128d1 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index f9bf31fe..8579409b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1fecd152..c1a7d45a 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b8f44225..576bdf18 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 6af53f8c..ffc05a37 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 67edafa5..56b587e9 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d8dee08e..7c0b62db 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index cd51e788..5243ea65 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -132,7 +132,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e, maxHdig; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,13 +187,12 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 8; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -204,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(2147483647 - d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 658c87db..af53d634 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index ab44584b..a12c1a7f 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 978ae16b..dff6a509 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c20aef90..b34d16d0 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 8740b5b0..afc6f96c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index ce51df39..2d3185ce 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index a64c2d13..30d7462f 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index d7981245..034d0e43 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 67c0f055..a4ed943e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6f4f1073..226b6aeb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 4d12f6cb..660559f5 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 2b694f6c..5ac796d7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2efce68f..93bbfaf4 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 6f8e3d33..330d0f79 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index bbecb9f2..a0370292 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index b5422c40..7e16410c 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 85494a63..c1c3c8fa 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index f3f2e52d..e936fb1b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/14] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 2b7bdf82..9276e796 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index f1d67d28..ef385b37 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -102,8 +102,9 @@ void Console_Bool (BOOLEAN b) void Console_Hex (int64 i) { - int64 k, n; - k = -28; + int32 k; + int64 n; + k = -60; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 8336a3d0..288d9e0a 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 6c40d595..6b890417 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index d3432e7a..ab570a35 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 26f7af6f..fa10e8c0 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 08afe43e..ecebdfeb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3a48e24a..66df0a5c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 3ebde4f3..86580ab4 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 883d2559..5a6a8dda 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 35fb2186..94ff6cbf 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ef8f41a1..a4e6388c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 646d0151..185ac689 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 96868200..6b30d07b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d4b77c79..9c71f996 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 7e958472..dce9eaec 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9ddded2f..e578b0bd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 208f4934..61d3ad08 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e, maxHdig; + int32 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -187,9 +187,8 @@ static void OPS_Number (void) } else if (OPS_ch == 'H') { OPM_Get(&OPS_ch); OPS_numtyp = 2; - maxHdig = 16; - if (n <= maxHdig) { - if ((n == maxHdig && dig[0] > '7')) { + if (n <= 16) { + if ((n == 16 && dig[0] > '7')) { OPS_intval = -1; } while (i < n) { diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bb045fe9..eef23e1f 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index afc5a8b6..82c2df59 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 090d9111..7b529043 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 098463c4..023ee089 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ea1f9aaa..0716a62f 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 3bb993de..a8579af5 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c1175e02..a016f061 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b3e89e04..b4890fa9 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 3892d49c..37f91340 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1eef261b..4f6767e1 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 8145aa00..235891d2 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index d8710e54..7a6726a6 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8389bc47..ea9dde4b 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 3972af10..fef94478 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8864c777..88cb5688 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 58286fd8..f916c173 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index bb60848a..08e242e0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8a0d60be..04a7b8d6 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index c143a6b3..96358c5b 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 11a9c941..b9c5430c 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/14] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 33b325d8..909cdee2 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -1,6 +1,6 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) - IMPORT OPM; + IMPORT OPM, SYSTEM; CONST MaxStrLen* = 256; @@ -51,8 +51,8 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) (* name, str, numtyp, intval, realval, lrlval are implicit results of Get *) name*: Name; str*: String; - numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) - intval*: LONGINT; (* integer value or string length *) + numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) + intval*: SYSTEM.INT64; (* integer value or string length *) realval*: REAL; lrlval*: LONGREAL; @@ -89,7 +89,8 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) END Identifier; PROCEDURE Number; - VAR i, m, n, d, e, maxHdig: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; + CONST maxhexdigits = 16; + VAR i, m, n, d, e: INTEGER; dig: ARRAY 24 OF CHAR; f: LONGREAL; expCh: CHAR; neg: BOOLEAN; PROCEDURE Ten(e: INTEGER): LONGREAL; VAR x, p: LONGREAL; @@ -135,15 +136,14 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) ELSE err(203) END ELSIF ch = "H" THEN (* hexadecimal *) OPM.Get(ch); numtyp := integer; - IF MAX(LONGINT) > 2147483647 THEN maxHdig := 16 ELSE maxHdig := 8 END; - IF n <= maxHdig THEN - IF (n = maxHdig) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; + IF n <= maxhexdigits THEN + IF (n = maxhexdigits) & (dig[0] > "7") THEN (* prevent overflow *) intval := -1 END; WHILE i < n DO intval := intval*10H + Ord(dig[i], TRUE); INC(i) END ELSE err(203) END ELSE (* decimal *) numtyp := integer; WHILE i < n DO d := Ord(dig[i], FALSE); INC(i); - IF intval <= (MAX(LONGINT) - d) DIV 10 THEN intval := intval*10 + d + IF intval <= (MAX(SYSTEM.INT64) - d) DIV 10 THEN intval := intval*10 + d ELSE err(203) END END diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 2fa775e1..87ff46fa 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -1,244 +1,243 @@ MODULE ulmIO; - IMPORT SYS := ulmSYSTEM, SYSTEM; + IMPORT SYS := ulmSYSTEM, SYSTEM; - CONST nl = 0AX; + CONST nl = 0AX; - (* conversions *) + (* conversions *) - CONST - oct = 0; - dec = 1; - hex = 2; - TYPE - Basetype = SHORTINT; (* oct..hex *) + CONST + oct = 0; + dec = 1; + hex = 2; + TYPE + Basetype = SHORTINT; (* oct..hex *) - (* basic IO *) + (* basic IO *) - VAR - Done*: BOOLEAN; - oldch: CHAR; - readAgain: BOOLEAN; + VAR + Done*: BOOLEAN; + oldch: CHAR; + readAgain: BOOLEAN; - (* ==================== conversions ================================= *) + (* ==================== conversions ================================= *) - PROCEDURE ConvertNumber(num, len: LONGINT; btyp: Basetype; neg: BOOLEAN; - VAR str: ARRAY OF CHAR); + PROCEDURE ConvertNumber(num, len: LONGINT; btyp: Basetype; neg: BOOLEAN; + VAR str: ARRAY OF CHAR); - (* conversion of a number into a string of characters *) - (* num must get the absolute value of the number *) - (* len is the minimal length of the generated string *) - (* neg means: "the number is negative" for btyp = dec *) + (* conversion of a number into a string of characters *) + (* num must get the absolute value of the number *) + (* len is the minimal length of the generated string *) + (* neg means: "the number is negative" for btyp = dec *) - (*CONST - NumberLen = 11;*) - (* we need it as variable to change the value depending on architecture; -- noch *) - VAR - (*digits : ARRAY NumberLen+1 OF CHAR;*) - digits : POINTER TO ARRAY OF CHAR; - base : INTEGER; - cnt, ix : INTEGER; - maxlen : LONGINT; - dig : LONGINT; - NumberLen : SHORTINT; - BEGIN - - IF SIZE(LONGINT) = 4 THEN - NumberLen := 11 - ELSIF SIZE(LONGINT) = 8 THEN - NumberLen := 21 + (*CONST + NumberLen = 11;*) + (* we need it as variable to change the value depending on architecture; -- noch *) + VAR + (*digits : ARRAY NumberLen+1 OF CHAR;*) + digits : POINTER TO ARRAY OF CHAR; + base : INTEGER; + cnt, ix : INTEGER; + maxlen : LONGINT; + dig : LONGINT; + NumberLen : SHORTINT; + BEGIN + IF SIZE(LONGINT) = 4 THEN + NumberLen := 11 + ELSIF SIZE(LONGINT) = 8 THEN + NumberLen := 21 + ELSE + NumberLen := 11 (* default value, corresponds to 32 bit *) + END; + NEW(digits, NumberLen + 1 ); + ASSERT(num >= 0); + ix := 1; + WHILE ix <= NumberLen DO + digits[ix] := "0"; + INC(ix); + END; (* initialisation *) + IF btyp = oct THEN + base := 8; + ELSIF btyp = dec THEN + base := 10; + ELSIF btyp = hex THEN + base := 10H; + END; + cnt := 0; + REPEAT + INC(cnt); + dig := num MOD base; + num := num DIV base; + IF dig < 10 THEN + dig := dig + ORD("0"); ELSE - NumberLen := 11 (* default value, corresponds to 32 bit *) + dig := dig - 10 + ORD("A"); END; - NEW(digits, NumberLen + 1 ); - ASSERT(num >= 0); - ix := 1; - WHILE ix <= NumberLen DO - digits[ix] := "0"; - INC(ix); - END; (* initialisation *) - IF btyp = oct THEN - base := 8; - ELSIF btyp = dec THEN - base := 10; - ELSIF btyp = hex THEN - base := 10H; - END; - cnt := 0; - REPEAT - INC(cnt); - dig := num MOD base; - num := num DIV base; - IF dig < 10 THEN - dig := dig + ORD("0"); - ELSE - dig := dig - 10 + ORD("A"); - END; - digits[cnt] := CHR(dig); - UNTIL num = 0; - (* (* i don't like this *) - IF btyp = oct THEN - cnt := 11; - ELSIF btyp = hex THEN - cnt := 8; - ELSIF neg THEN - *) - IF neg THEN - INC(cnt); - digits[cnt] := "-"; - END; - maxlen := LEN(str); (* get maximal length *) - IF len > maxlen THEN - len := SHORT(maxlen); - END; - IF cnt > maxlen THEN - cnt := SHORT(maxlen); - END; - ix := 0; - WHILE len > cnt DO - str[ix] := " "; - INC(ix); - DEC(len); - END; - WHILE cnt > 0 DO - str[ix] := digits[cnt]; - INC(ix); - DEC(cnt); - END; - IF ix < maxlen THEN - str[ix] := 0X; - END; - END ConvertNumber; + digits[cnt] := CHR(dig); + UNTIL num = 0; + (* (* i don't like this *) + IF btyp = oct THEN + cnt := 11; + ELSIF btyp = hex THEN + cnt := 8; + ELSIF neg THEN + *) + IF neg THEN + INC(cnt); + digits[cnt] := "-"; + END; + maxlen := LEN(str); (* get maximal length *) + IF len > maxlen THEN + len := SHORT(maxlen); + END; + IF cnt > maxlen THEN + cnt := SHORT(maxlen); + END; + ix := 0; + WHILE len > cnt DO + str[ix] := " "; + INC(ix); + DEC(len); + END; + WHILE cnt > 0 DO + str[ix] := digits[cnt]; + INC(ix); + DEC(cnt); + END; + IF ix < maxlen THEN + str[ix] := 0X; + END; + END ConvertNumber; - PROCEDURE ConvertInteger(num: LONGINT; len: INTEGER; VAR str: ARRAY OF - CHAR); - (* conversion of an integer decimal number to a string *) - BEGIN - ConvertNumber(ABS(num),len,dec,num < 0,str); - END ConvertInteger; + PROCEDURE ConvertInteger(num: LONGINT; len: INTEGER; VAR str: ARRAY OF + CHAR); + (* conversion of an integer decimal number to a string *) + BEGIN + ConvertNumber(ABS(num),len,dec,num < 0,str); + END ConvertInteger; - (* ========================= terminal ============================ *) + (* ========================= terminal ============================ *) - PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; - CONST read = 3; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* in ulm system INTEGER and LONGINT have the same 4 byte size; -- noch *) - BEGIN - RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) - END ReadChar; + PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; + CONST read = 3; + (*VAR r0, r1: INTEGER;*) + VAR r0, r1: LONGINT; (* in ulm system INTEGER and LONGINT have the same 4 byte size; -- noch *) + BEGIN + RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) + END ReadChar; - PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; - CONST write = 4; - (*VAR r0, r1: INTEGER;*) - VAR r0, r1: LONGINT; (* same here *) - BEGIN - RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) - END WriteChar; + PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; + CONST write = 4; + (*VAR r0, r1: INTEGER;*) + VAR r0, r1: LONGINT; (* same here *) + BEGIN + RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) + END WriteChar; - PROCEDURE Read*(VAR ch: CHAR); - BEGIN - Done := TRUE; - IF readAgain THEN - ch := oldch; - readAgain := FALSE; - ELSIF ~ReadChar(ch) THEN - Done := FALSE; - ch := 0X; - ELSE - oldch := ch; - END; - END Read; - - PROCEDURE ReadAgain*; - BEGIN - IF readAgain THEN - Done := FALSE; - ELSE - Done := TRUE; - readAgain := TRUE; - END; - END ReadAgain; - - PROCEDURE Write*(ch: CHAR); - BEGIN - Done := WriteChar(ch); - END Write; - - PROCEDURE WriteLn*; - CONST nl = 0AX; - BEGIN - Write(nl); - END WriteLn; - - PROCEDURE WriteString*(s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN - i := 0; - WHILE (i < LEN(s)) & (s[i] # 0X) DO - Write(s[i]); - INC(i); - END; - END WriteString; - - PROCEDURE InitIO; - BEGIN + PROCEDURE Read*(VAR ch: CHAR); + BEGIN + Done := TRUE; + IF readAgain THEN + ch := oldch; readAgain := FALSE; + ELSIF ~ReadChar(ch) THEN + Done := FALSE; + ch := 0X; + ELSE + oldch := ch; + END; + END Read; + + PROCEDURE ReadAgain*; + BEGIN + IF readAgain THEN + Done := FALSE; + ELSE Done := TRUE; - END InitIO; + readAgain := TRUE; + END; + END ReadAgain; - PROCEDURE WriteInt*(arg: LONGINT); - VAR field: ARRAY 23 OF CHAR; - BEGIN (* the field size should be big enough to hold the long number. it was 12 to hold just 32 bit numbers, now it can hold 64 bit numbers; need to be more for 128bit numbers; -- noch *) - ConvertInteger(arg, 1, field); - WriteString(field); - END WriteInt; + PROCEDURE Write*(ch: CHAR); + BEGIN + Done := WriteChar(ch); + END Write; - PROCEDURE ReadInt*(VAR arg: LONGINT); - VAR ch: CHAR; - minus: BOOLEAN; - BEGIN - minus := FALSE; - REPEAT - Read(ch); - IF ~Done THEN RETURN END; - IF ch = "-" THEN - minus := TRUE; - ELSIF (ch # " ") & (ch # nl) & ((ch < "0") OR (ch > "9")) THEN - WriteString("--- Integer expected on input"); WriteLn; - END; - UNTIL (ch >= "0") & (ch <= "9"); - arg := ORD(ch) - ORD("0"); - REPEAT - Read(ch); - IF ~Done THEN RETURN END; - IF (ch >= "0") & (ch <= "9") THEN - arg := arg*10 + (ORD(ch) - ORD("0")); - END; - UNTIL (ch < "0") OR (ch > "9"); - ReadAgain; - IF minus THEN arg := -arg; END; - END ReadInt; + PROCEDURE WriteLn*; + CONST nl = 0AX; + BEGIN + Write(nl); + END WriteLn; - PROCEDURE ReadLine*(VAR string: ARRAY OF CHAR); - VAR - index: INTEGER; - ch: CHAR; - ok: BOOLEAN; - BEGIN - index := 0; ok := TRUE; - LOOP - IF ~ReadChar(ch) THEN ok := FALSE; EXIT END; - IF ch = nl THEN EXIT END; - IF index < LEN(string) THEN - string[index] := ch; INC(index); - END; + PROCEDURE WriteString*(s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN + i := 0; + WHILE (i < LEN(s)) & (s[i] # 0X) DO + Write(s[i]); + INC(i); + END; + END WriteString; + + PROCEDURE InitIO; + BEGIN + readAgain := FALSE; + Done := TRUE; + END InitIO; + + PROCEDURE WriteInt*(arg: LONGINT); + VAR field: ARRAY 23 OF CHAR; + BEGIN (* the field size should be big enough to hold the long number. it was 12 to hold just 32 bit numbers, now it can hold 64 bit numbers; need to be more for 128bit numbers; -- noch *) + ConvertInteger(arg, 1, field); + WriteString(field); + END WriteInt; + + PROCEDURE ReadInt*(VAR arg: LONGINT); + VAR ch: CHAR; + minus: BOOLEAN; + BEGIN + minus := FALSE; + REPEAT + Read(ch); + IF ~Done THEN RETURN END; + IF ch = "-" THEN + minus := TRUE; + ELSIF (ch # " ") & (ch # nl) & ((ch < "0") OR (ch > "9")) THEN + WriteString("--- Integer expected on input"); WriteLn; END; + UNTIL (ch >= "0") & (ch <= "9"); + arg := ORD(ch) - ORD("0"); + REPEAT + Read(ch); + IF ~Done THEN RETURN END; + IF (ch >= "0") & (ch <= "9") THEN + arg := arg*10 + (ORD(ch) - ORD("0")); + END; + UNTIL (ch < "0") OR (ch > "9"); + ReadAgain; + IF minus THEN arg := -arg; END; + END ReadInt; + + PROCEDURE ReadLine*(VAR string: ARRAY OF CHAR); + VAR + index: INTEGER; + ch: CHAR; + ok: BOOLEAN; + BEGIN + index := 0; ok := TRUE; + LOOP + IF ~ReadChar(ch) THEN ok := FALSE; EXIT END; + IF ch = nl THEN EXIT END; IF index < LEN(string) THEN - string[index] := 0X; + string[index] := ch; INC(index); END; - Done := ok OR (index > 0); - END ReadLine; + END; + IF index < LEN(string) THEN + string[index] := 0X; + END; + Done := ok OR (index > 0); + END ReadLine; BEGIN - InitIO; + InitIO; END ulmIO. diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index 838548f0..bbd054b8 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -50,23 +50,25 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END TAS; PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) - arg1, arg2, arg3: LONGINT) : BOOLEAN; + arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR n: LONGINT; ch: CHAR; pch: pchar; - pstr: pstring; + pstr: pstring; h: Platform.FileHandle; (* pst : pstatus; *) BEGIN - + IF syscall = Sys.read THEN - RETURN Platform.Read(arg1, arg2, arg3, n) = 0; + d0 := Platform.Read(arg1, arg2, arg3, n); + IF d0 >= 0 THEN d0 := n END; + RETURN d0 >= 0; (*NEW(pch); pch := SYSTEM.VAL(pchar, arg2); ch := pch^[0]; n := read(ch); - IF n # 1 THEN + IF n # 1 THEN ch := 0X; RETURN FALSE ELSE @@ -81,7 +83,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; n := Write(SYSTEM.VAL(LONGINT, pch), 1); IF n # 1 THEN RETURN FALSE ELSE RETURN TRUE END *) - ELSIF syscall = Sys.open THEN + ELSIF syscall = Sys.open THEN pstr := SYSTEM.VAL(pstring, arg1); IF SYSTEM.VAL(SET, arg3) * {0,1} # {} THEN RETURN Platform.OldRW(pstr^, d0) = 0 diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 8e2be161..430519df 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -10,7 +10,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) PROCEDURE Flush*; VAR error: Platform.ErrorCode; BEGIN - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(line), pos); + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(line), pos); pos := 0; END Flush; @@ -53,9 +53,9 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Bool; PROCEDURE Hex*(i: LONGINT); - VAR k, n: LONGINT; + VAR k: INTEGER; n: SYSTEM.INT64; BEGIN - k := -28; + k := 4 - 8 * SIZE(LONGINT); WHILE k <= 0 DO n := ASH(i, k) MOD 16; IF n <= 9 THEN Char(CHR(ORD("0") + n)) ELSE Char(CHR(ORD("A") - 10 + n)) END ; From 21964471d8058bb6759f31aa17c9e2cbfa7cd289 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 15 Sep 2016 17:39:30 +0100 Subject: [PATCH 036/140] Fix import of SYSTEM.INT64 type on 32 bit platforms. --- bootstrap/unix-44/OPS.c | 10 +++++----- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 9 ++++++--- bootstrap/unix-48/OPS.c | 10 +++++----- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 9 ++++++--- bootstrap/unix-88/OPT.c | 9 ++++++--- bootstrap/windows-48/OPS.c | 10 +++++----- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 9 ++++++--- bootstrap/windows-88/OPT.c | 9 ++++++--- src/compiler/OPS.Mod | 2 +- src/compiler/OPT.Mod | 6 ++++-- 13 files changed, 53 insertions(+), 36 deletions(-) diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int64 OPS_intval; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int64 OPS_intval; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size) OPT_Struct _o_result; int16 i; i = 1; - while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { + while (i < 19) { + if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { + _o_result = OPT_IntTypes[__X(i, 20)]; + return _o_result; + } i += 1; } - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; + __RETCHK; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int64 OPS_intval; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int64 OPS_intval; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size) OPT_Struct _o_result; int16 i; i = 1; - while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { + while (i < 19) { + if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { + _o_result = OPT_IntTypes[__X(i, 20)]; + return _o_result; + } i += 1; } - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; + __RETCHK; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 82c2df59..d9b211df 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int64 size) OPT_Struct _o_result; int32 i; i = 1; - while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { + while (i < 19) { + if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { + _o_result = OPT_IntTypes[__X(i, 20)]; + return _o_result; + } i += 1; } - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; + __RETCHK; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5243ea65..29ea2414 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int64 OPS_intval; +export int32 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index af53d634..57cf06d3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int64 OPS_intval; +import int32 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a12c1a7f..62ff8882 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size) OPT_Struct _o_result; int16 i; i = 1; - while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { + while (i < 19) { + if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { + _o_result = OPT_IntTypes[__X(i, 20)]; + return _o_result; + } i += 1; } - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; + __RETCHK; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 82c2df59..d9b211df 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int64 size) OPT_Struct _o_result; int32 i; i = 1; - while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) { + while (i < 19) { + if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { + _o_result = OPT_IntTypes[__X(i, 20)]; + return _o_result; + } i += 1; } - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; + __RETCHK; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index 909cdee2..e386e538 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -52,7 +52,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) name*: Name; str*: String; numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) - intval*: SYSTEM.INT64; (* integer value or string length *) + intval*: LONGINT (* todo SYSTEM.INT64 *); (* integer value or string length *) realval*: REAL; lrlval*: LONGREAL; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 8b21b9a5..cd1eae8b 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -217,8 +217,10 @@ PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) VAR i: INTEGER; BEGIN - i := 1; WHILE (IntTypes[i].size < size) & (IntTypes[i+1] # NIL) DO INC(i) END; - RETURN IntTypes[i]; + i := 1; WHILE i < LEN(IntTypes) - 1 DO (* First and last entries are always NIL *) + IF (IntTypes[i] # NIL) & (IntTypes[i].size >= size) THEN RETURN IntTypes[i] END; + INC(i) + END; END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; From 636c128d14a90538013127740e638cf225dced5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 10:55:14 +0100 Subject: [PATCH 037/140] Fix import of SYSTEM.INT64 on 32 bit builds. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 8 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 16 ++- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 8 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 16 ++- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 161 ++++++++++++++++----------- bootstrap/unix-88/OPT.h | 3 +- bootstrap/unix-88/OPV.c | 8 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 16 ++- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 161 ++++++++++++++++----------- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 8 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 16 ++- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 161 ++++++++++++++++----------- bootstrap/windows-88/OPT.h | 3 +- bootstrap/windows-88/OPV.c | 8 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 16 ++- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPT.Mod | 72 ++++++------ src/compiler/OPV.Mod | 7 +- src/compiler/Vishap.Mod | 17 ++- 198 files changed, 823 insertions(+), 573 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9ae78a2d..994ef48a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index af7ba940..033c5c1a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index c25651d5..f7769827 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 79b77102..4c6982cc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 048e6c0f..a5641b0c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int64 value); static void OPT_EnterProc (OPS_Name name, int32 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8bbc2357..874e4d6d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 077cb445..86dbc3cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 931e8e9b..f1978da4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 50b625ff..8c0d8fd5 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index f680e056..4a28825a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index afc6f96c..614e2cb6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 2d3185ce..cfea54a7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index ef385b37..32408370 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 6b890417..c2097ffb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index ab570a35..c98b006a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int64 value); static void OPT_EnterProc (OPS_Name name, int32 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a8579af5..5af3b5f2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a016f061..a94b93a8 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; + OPT_sinttyp = OPT_int8typ; + if (OPM_IntSize == 2) { + OPT_inttyp = OPT_int16typ; + OPT_linttyp = OPT_int32typ; + } else { + OPT_inttyp = OPT_int32typ; + OPT_linttyp = OPT_int64typ; + } + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cd1eae8b..3f8e884e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -160,18 +160,18 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + sintobj*, intobj*, lintobj*: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST - - (* Symbol file items *) Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; @@ -209,34 +209,36 @@ VAR -PROCEDURE err(n: INTEGER); -BEGIN OPM.err(n) -END err; +PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; + + PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) - VAR i: INTEGER; BEGIN - i := 1; WHILE i < LEN(IntTypes) - 1 DO (* First and last entries are always NIL *) - IF (IntTypes[i] # NIL) & (IntTypes[i].size >= size) THEN RETURN IntTypes[i] END; - INC(i) - END; + IF size <= int8typ.size THEN RETURN int8typ END; + IF size <= int16typ.size THEN RETURN int16typ END; + IF size <= int32typ.size THEN RETURN int32typ END; + RETURN int64typ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form = Int); - ASSERT((dir = 1) OR (dir = -1)); - (* Not sure if StPar0 (which calls this) always gets the baseiest type. This - ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); - (* - WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; - *) - i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; - ASSERT(i < LEN(IntTypes)-1); - RETURN IntTypes[i+dir] + ASSERT((dir = 1) OR (dir = -1)); + IF dir > 0 THEN + IF x.size < sinttyp.size THEN RETURN sinttyp END; + IF x.size < inttyp.size THEN RETURN inttyp END; + IF x.size < linttyp.size THEN RETURN linttyp END; + RETURN int64typ + ELSE + IF x.size > linttyp.size THEN RETURN linttyp END; + IF x.size > inttyp.size THEN RETURN inttyp END; + IF x.size > sinttyp.size THEN RETURN sinttyp END; + RETURN int8typ + END END ShorterOrLongerType; @@ -1175,12 +1177,21 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.mode := Typ; obj^.typ := NIL; obj^.vis := external; + res := obj + END EnterTypeAlias; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); obj^.mode := SProc; obj^.typ := notyp; obj^.adr := num END EnterProc; + + BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(undftyp, Undef); undftyp^.BaseTyp := undftyp; InitStruct(notyp, NoTyp); @@ -1195,6 +1206,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1207,17 +1219,20 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("VAL", valfn); EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); EnterTyp("CHAR", Char, OPM.CharSize, chartyp); EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); + + EnterTypeAlias("SHORTINT", sintobj); + EnterTypeAlias("INTEGER", intobj); + EnterTypeAlias("LONGINT", lintobj); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1248,7 +1263,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[Int] := inttyp; + impCtxt.ref[Int] := int32typ; impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1257,15 +1272,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - IntTypes[1] := sinttyp; - IntTypes[2] := inttyp; - IntTypes[3] := linttyp; - - IntTypes[5] := int8typ; - IntTypes[6] := int16typ; - IntTypes[7] := int32typ; - IntTypes[8] := int64typ - END OPT. Objects: diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index f4a82ca5..fa20523b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -181,6 +181,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE AdrAndSize* (topScope: OPT.Object); BEGIN + ASSERT(OPT.sinttyp # NIL); ASSERT(OPT.inttyp # NIL); ASSERT(OPT.linttyp # NIL); + OPM.errpos := topScope^.adr; (* text position of scope used if error *) topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) @@ -189,15 +191,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; + + (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. + OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 3323883d..33481260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -56,12 +56,21 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.chartyp.size := OPM.CharSize; OPT.settyp.size := OPM.SetSize; OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize + OPT.booltyp.size := OPM.BoolSize; + + OPT.sinttyp := OPT.int8typ; + IF OPM.IntSize = 2 THEN + OPT.inttyp := OPT.int16typ; + OPT.linttyp := OPT.int32typ + ELSE + OPT.inttyp := OPT.int32typ; + OPT.linttyp := OPT.int64typ + END; + OPT.sintobj.typ := OPT.sinttyp; + OPT.intobj.typ := OPT.inttyp; + OPT.lintobj.typ := OPT.linttyp END PropagateElementaryTypeSizes; From 210870f968fccfb8bfd5a9a4f059c2cf8b22f26a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 11:06:16 +0100 Subject: [PATCH 038/140] Use SYSTEM.INT64 for literal and related values. --- src/compiler/OPB.Mod | 45 +++++++++++----------- src/compiler/OPC.Mod | 8 ++-- src/compiler/OPM.cmdln.Mod | 46 ++++++++++++++--------- src/compiler/OPP.Mod | 16 ++++---- src/compiler/OPS.Mod | 2 +- src/compiler/OPT.Mod | 76 ++++++++++++++++++++------------------ src/compiler/OPV.Mod | 19 ++++++---- src/compiler/Vishap.Mod | 17 +++++++-- src/system/Console.Mod | 5 ++- src/system/Files.Mod | 18 +++++++++ 10 files changed, 150 insertions(+), 102 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index ee6dc10a..09805f14 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -10,8 +10,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR typSize*: PROCEDURE(typ: OPT.Struct); - exp: INTEGER; (*side effect of log*) - maxExp: LONGINT; (* max n in ASH(1, n) on this machine *) + exp: INTEGER; (* side effect of log*) + maxExp: SYSTEM.INT64; (* max n in ASH(1, n) on this machine *) PROCEDURE err(n: INTEGER); @@ -57,9 +57,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF b THEN RETURN 1 ELSE RETURN 0 END END BoolToInt; - PROCEDURE IntToBool(i: LONGINT): BOOLEAN; - BEGIN - IF i = 0 THEN RETURN FALSE ELSE RETURN TRUE END + PROCEDURE IntToBool(i: SYSTEM.INT64): BOOLEAN; + BEGIN RETURN i # 0 END IntToBool; PROCEDURE NewBoolConst*(boolval: BOOLEAN): OPT.Node; @@ -106,7 +105,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END EmptySet; PROCEDURE SetIntType(node: OPT.Node); - VAR b: INTEGER; n: LONGINT; + VAR b: INTEGER; n: SYSTEM.INT64; BEGIN (* Determine number of bytes required to represent constant value *) IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; @@ -114,7 +113,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) node.typ := OPT.IntType(b) END SetIntType; - PROCEDURE NewIntConst*(intval: LONGINT): OPT.Node; + PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); @@ -129,11 +128,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) RETURN x END NewRealConst; - PROCEDURE NewString*(VAR str: OPS.String; len: LONGINT): OPT.Node; + PROCEDURE NewString*(VAR str: OPS.String; len: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN x := OPT.NewNode(OPT.Nconst); x^.conval := OPT.NewConst(); x^.typ := OPT.stringtyp; - x^.conval^.intval := OPM.ConstNotAlloc; x^.conval^.intval2 := len; + x^.conval^.intval := OPM.ConstNotAlloc; x^.conval^.intval2 := OPM.Longint(len); x^.conval^.ext := OPT.NewExt(); x^.conval^.ext^ := str; RETURN x END NewString; @@ -238,7 +237,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END TypTest; PROCEDURE In*(VAR x: OPT.Node; y: OPT.Node); - VAR f: INTEGER; k: LONGINT; + VAR f: INTEGER; k: SYSTEM.INT64; BEGIN f := x^.typ^.form; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN @@ -255,7 +254,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.typ := OPT.booltyp END In; - PROCEDURE log(x: LONGINT): LONGINT; + PROCEDURE log(x: SYSTEM.INT64): SYSTEM.INT64; BEGIN exp := 0; IF x > 0 THEN WHILE ~ODD(x) DO x := x DIV 2; INC(exp) END @@ -302,7 +301,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN IF f = OPT.Int THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + IF z^.conval^.intval = MIN(SYSTEM.INT64) THEN err(203) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END ELSIF f IN OPT.realSet THEN z^.conval^.realval := -z^.conval^.realval @@ -316,7 +315,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN IF f = OPT.Int THEN - IF z^.conval^.intval = MIN(LONGINT) THEN err(203) + IF z^.conval^.intval = MIN(SYSTEM.INT64) THEN err(203) ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) END ELSE z^.conval^.realval := ABS(z^.conval^.realval) @@ -416,7 +415,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END CheckProc; PROCEDURE ConstOp(op: INTEGER; x, y: OPT.Node); - VAR f, g: INTEGER; xval, yval: OPT.Const; xv, yv: LONGINT; + VAR f, g: INTEGER; xval, yval: OPT.Const; xv, yv: SYSTEM.INT64; temp: BOOLEAN; (* temp avoids err 215 *) PROCEDURE ConstCmp(): INTEGER; @@ -597,7 +596,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ConstOp; PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) - VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; + VAR node: OPT.Node; f, g: INTEGER; k: SYSTEM.INT64; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN IF f = OPT.Int THEN @@ -628,7 +627,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Convert; PROCEDURE Op*(op: SHORTINT; VAR x: OPT.Node; y: OPT.Node); - VAR f, g: INTEGER; t, z: OPT.Node; typ: OPT.Struct; do: BOOLEAN; val: LONGINT; + VAR f, g: INTEGER; t, z: OPT.Node; typ: OPT.Struct; do: BOOLEAN; val: SYSTEM.INT64; PROCEDURE NewOp(op: SHORTINT; typ: OPT.Struct; VAR x: OPT.Node; y: OPT.Node); VAR node: OPT.Node; @@ -788,7 +787,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Op; PROCEDURE SetRange*(VAR x: OPT.Node; y: OPT.Node); - VAR k, l: LONGINT; + VAR k, l: SYSTEM.INT64; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN @@ -814,7 +813,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); - VAR k: LONGINT; + VAR k: SYSTEM.INT64; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF x^.typ^.form # OPT.Int THEN err(93) @@ -1034,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF x.typ.size # OPT.linttyp.size THEN Convert(x, OPT.linttyp) END + IF x.typ.size < OPT.linttyp.size THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END |OPT.adrfn: (*SYSTEM.ADR*) @@ -1124,7 +1123,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lenfn: (*LEN*) IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69) ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) - L := SHORT(x^.conval^.intval); typ := p^.typ; + L := OPM.Integer(x^.conval^.intval); typ := p^.typ; WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; IF (L # 0) OR ~(typ^.comp IN {OPT.DynArr, OPT.Array}) THEN err(132) ELSE x^.obj := NIL; @@ -1150,14 +1149,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 ELSIF x^.conval^.intval >= 0 THEN - IF ABS(p^.conval^.intval) <= MAX(LONGINT) DIV ASH(1, x^.conval^.intval) THEN + IF ABS(p^.conval^.intval) <= MAX(SYSTEM.INT64) DIV ASH(1, x^.conval^.intval) THEN p^.conval^.intval := p^.conval^.intval * ASH(1, x^.conval^.intval) ELSE err(208); p^.conval^.intval := 1 END ELSE p^.conval^.intval := ASH(p^.conval^.intval, x^.conval^.intval) END ; p^.obj := NIL - ELSE p := NewOp(OPT.Ndop, OPT.ash, p, x); p^.typ := OPT.linttyp + ELSE p := NewOp(OPT.Ndop, OPT.ash, p, x); p^.typ := p.left.typ (* LONGINT, or INT64 if larger *) END ELSE err(111) END @@ -1482,5 +1481,5 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END Inittd; BEGIN - maxExp := log(MAX(LONGINT) DIV 2 + 1); maxExp := exp + maxExp := log(MAX(SYSTEM.INT64) DIV 2 + 1); maxExp := exp END OPB. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index c5b16ad0..9febea62 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1218,7 +1218,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END; END Cmp; - PROCEDURE CharacterLiteral(c: LONGINT); + PROCEDURE CharacterLiteral(c: SYSTEM.INT64); BEGIN IF (c < 32) OR (c > 126) THEN OPM.WriteString("0x"); OPM.WriteHex(c) @@ -1258,7 +1258,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.Write(DoubleQuote) END StringLiteral; - PROCEDURE Case*(caseVal: LONGINT; form: INTEGER); + PROCEDURE Case*(caseVal: SYSTEM.INT64; form: INTEGER); VAR ch: CHAR; BEGIN @@ -1286,7 +1286,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1("__HALT(#)", n) END Halt; - PROCEDURE IntLiteral*(n, size: LONGINT); + PROCEDURE IntLiteral*(n: SYSTEM.INT64; size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); @@ -1296,7 +1296,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END END IntLiteral; - PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: LONGINT); + PROCEDURE Len* (obj: OPT.Object; array: OPT.Struct; dim: SYSTEM.INT64); BEGIN IF array^.comp = OPT.DynArr THEN CompleteIdent(obj); OPM.WriteString(LenExt); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index a7810f0c..b497829f 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -110,7 +110,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: LONGINT; + lasterrpos: SYSTEM.INT64; inR: Texts.Reader; Log: Texts.Text; W: Texts.Writer; @@ -129,12 +129,17 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- Log Output ------------------------- *) - PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; - PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; - PROCEDURE LogWNum*(i, len: LONGINT); BEGIN Console.Int(i, len) END LogWNum; - PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; + PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; + PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Console.Int(i, len) END LogWNum; + PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + + + PROCEDURE Longint* (n: SYSTEM.INT64): LONGINT; BEGIN RETURN SYSTEM.VAL(LONGINT, n) END Longint; + PROCEDURE Integer* (n: SYSTEM.INT64): INTEGER; BEGIN RETURN SYSTEM.VAL(INTEGER, n) END Integer; + (* ------------------------- parameter handling -------------------------*) PROCEDURE ScanOptions(VAR s: ARRAY OF CHAR; VAR opt: SET); @@ -354,7 +359,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END LogErrMsg; - PROCEDURE FindLine(f: Files.File; VAR r: Files.Rider; pos: LONGINT); + PROCEDURE FindLine(f: Files.File; VAR r: Files.Rider; pos: SYSTEM.INT64); (* Updates ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber to describe the line containing pos. Exits with the rider set to the start of the line conaining pos. *) @@ -386,7 +391,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FindLine; - PROCEDURE ShowLine(pos: LONGINT); + PROCEDURE ShowLine(pos: SYSTEM.INT64); VAR f: Files.File; r: Files.Rider; @@ -408,7 +413,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" "); IF pos >= ErrorLineLimitPos THEN pos := ErrorLineLimitPos-1 END; - i := SHORT(pos - ErrorLineStartPos); + i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; @@ -419,7 +424,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ShowLine; - PROCEDURE Mark*(n: INTEGER; pos: LONGINT); + PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); BEGIN IF pos = -1 THEN pos := 0 END; IF n >= 0 THEN @@ -450,7 +455,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END err; - PROCEDURE FPrint*(VAR fp: LONGINT; val: LONGINT); + PROCEDURE FPrint*(VAR fp: LONGINT; val: SYSTEM.INT64); BEGIN fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, val)), 1) END FPrint; @@ -612,6 +617,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; + PROCEDURE SymRInt64*(): SYSTEM.INT64; + VAR k: SYSTEM.INT64; + BEGIN Files.ReadNum64(oldSF, k); RETURN k + END SymRInt64; + PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) END SymRSet; @@ -653,8 +663,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.Write(newSF, ch) END SymWCh; - PROCEDURE SymWInt*(i: LONGINT); - BEGIN Files.WriteNum(newSF, i) + PROCEDURE SymWInt*(i: SYSTEM.INT64); + BEGIN Files.WriteNum64(newSF, i) END SymWInt; PROCEDURE SymWSet*(s: SET); @@ -709,9 +719,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Files.WriteBytes(R[currFile], s, i) END WriteStringVar; - PROCEDURE WriteHex* (i: LONGINT); + PROCEDURE WriteHex* (i: SYSTEM.INT64); VAR s: ARRAY 3 OF CHAR; - digit : INTEGER; + digit : SYSTEM.INT32; BEGIN digit := SHORT(i) DIV 16; IF digit < 10 THEN s[0] := CHR (ORD ("0") + digit); ELSE s[0] := CHR (ORD ("a") - 10 + digit ); END; @@ -721,10 +731,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) WriteString(s) END WriteHex; - PROCEDURE WriteInt* (i: LONGINT); - VAR s: ARRAY 20 OF CHAR; i1, k: LONGINT; + PROCEDURE WriteInt* (i: SYSTEM.INT64); + VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; BEGIN - IF (i = SignedMinimum(IntSize)) OR (i = SignedMinimum(LIntSize)) THEN + IF (i = SignedMinimum(IntSize)) + OR (i = SignedMinimum(LIntSize)) + OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 84966442..72b6701d 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -1,7 +1,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IMPORT - OPB, OPT, OPS, OPM; + OPB, OPT, OPS, OPM, SYSTEM; TYPE CaseTable = ARRAY OPM.MaxCases OF @@ -69,7 +69,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END CheckMark; PROCEDURE CheckSysFlag(VAR sysflag: INTEGER; default: INTEGER); - VAR x: OPT.Node; sf: LONGINT; + VAR x: OPT.Node; sf: SYSTEM.INT64; BEGIN IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; @@ -78,7 +78,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; - sysflag := SHORT(sf); CheckSym(OPS.rbrak) + sysflag := OPM.Integer(sf); CheckSym(OPS.rbrak) ELSE sysflag := default END END CheckSysFlag; @@ -141,7 +141,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END RecordType; PROCEDURE ArrayType(VAR typ, banned: OPT.Struct); - VAR x: OPT.Node; n: LONGINT; sysflag: INTEGER; + VAR x: OPT.Node; n: SYSTEM.INT64; sysflag: INTEGER; BEGIN CheckSysFlag(sysflag, 0); IF sym = OPS.of THEN (*dynamic array*) typ := OPT.NewStr(OPT.Comp, OPT.DynArr); typ^.mno := 0; typ^.sysflag := sysflag; @@ -156,7 +156,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; - typ^.n := n; + typ^.n := OPM.Longint(n); IF sym = OPS.of THEN OPS.Get(sym); Type(typ^.BaseTyp, banned); typ^.BaseTyp^.pvused := TRUE @@ -530,7 +530,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) forward: BOOLEAN; PROCEDURE GetCode; - VAR ext: OPT.ConstExt; n: INTEGER; c: LONGINT; + VAR ext: OPT.ConstExt; n: INTEGER; c: SYSTEM.INT64; BEGIN ext := OPT.NewExt(); proc^.conval^.ext := ext; n := 0; IF sym = OPS.string THEN @@ -669,7 +669,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval + IF f IN {OPT.Int, OPT.Char} THEN xval := OPM.Longint(x^.conval^.intval) ELSE err(61); xval := 1 END; IF f = OPT.Int THEN @@ -677,7 +677,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN - OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; + OPS.Get(sym); ConstExpression(y); yval := OPM.Longint(y^.conval^.intval); IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval diff --git a/src/compiler/OPS.Mod b/src/compiler/OPS.Mod index e386e538..909cdee2 100644 --- a/src/compiler/OPS.Mod +++ b/src/compiler/OPS.Mod @@ -52,7 +52,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *) name*: Name; str*: String; numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *) - intval*: LONGINT (* todo SYSTEM.INT64 *); (* integer value or string length *) + intval*: SYSTEM.INT64; (* integer value or string length *) realval*: REAL; lrlval*: LONGREAL; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cd1eae8b..a97b3876 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -4,7 +4,7 @@ MODULE OPT; (* NW, RC 6.3.89 / 23.1.92 *) (* object model 24.2.94 *) 2002-08-20 jt: NewStr: txtpos remains 0 for structs read from symbol file *) -IMPORT OPS, OPM; +IMPORT OPS, OPM, SYSTEM; (* Constants - value of literals *) @@ -12,11 +12,11 @@ TYPE Const* = POINTER TO ConstDesc; ConstExt* = POINTER TO OPS.String; ConstDesc* = RECORD - ext*: ConstExt; (* string or code for code proc *) - intval*: LONGINT; (* constant value or adr, proc par size, text position or least case label *) - intval2*: LONGINT; (* string length, proc var size or larger case label *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) - realval*: LONGREAL (* real or longreal constant value *) + ext*: ConstExt; (* string or code for code proc *) + intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) + intval2*: LONGINT; (* string length, proc var size or larger case label *) + setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + realval*: LONGREAL (* real or longreal constant value *) END; CONST @@ -160,18 +160,18 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + sintobj*, intobj*, lintobj*: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST - - (* Symbol file items *) Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; @@ -215,28 +215,30 @@ END err; PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) - VAR i: INTEGER; BEGIN - i := 1; WHILE i < LEN(IntTypes) - 1 DO (* First and last entries are always NIL *) - IF (IntTypes[i] # NIL) & (IntTypes[i].size >= size) THEN RETURN IntTypes[i] END; - INC(i) - END; + IF size <= int8typ.size THEN RETURN int8typ END; + IF size <= int16typ.size THEN RETURN int16typ END; + IF size <= int32typ.size THEN RETURN int32typ END; + RETURN int64typ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form = Int); - ASSERT((dir = 1) OR (dir = -1)); - (* Not sure if StPar0 (which calls this) always gets the baseiest type. This - ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); - (* - WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; - *) - i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; - ASSERT(i < LEN(IntTypes)-1); - RETURN IntTypes[i+dir] + ASSERT((dir = 1) OR (dir = -1)); + IF dir > 0 THEN + IF x.size < sinttyp.size THEN RETURN sinttyp END; + IF x.size < inttyp.size THEN RETURN inttyp END; + IF x.size < linttyp.size THEN RETURN linttyp END; + RETURN int64typ + ELSE + IF x.size > linttyp.size THEN RETURN linttyp END; + IF x.size > inttyp.size THEN RETURN inttyp END; + IF x.size > sinttyp.size THEN RETURN sinttyp END; + RETURN int8typ + END END ShorterOrLongerType; @@ -1175,6 +1177,13 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.mode := Typ; obj^.typ := NIL; obj^.vis := external; + res := obj + END EnterTypeAlias; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); @@ -1195,6 +1204,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1207,17 +1217,20 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("VAL", valfn); EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); EnterTyp("CHAR", Char, OPM.CharSize, chartyp); EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); + + EnterTypeAlias("SHORTINT", sintobj); + EnterTypeAlias("INTEGER", intobj); + EnterTypeAlias("LONGINT", lintobj); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1248,7 +1261,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[Int] := inttyp; + impCtxt.ref[Int] := int32typ; impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1257,15 +1270,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - IntTypes[1] := sinttyp; - IntTypes[2] := inttyp; - IntTypes[3] := linttyp; - - IntTypes[5] := int8typ; - IntTypes[6] := int16typ; - IntTypes[7] := int32typ; - IntTypes[8] := int64typ - END OPT. Objects: diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index f4a82ca5..d8486ca9 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -5,7 +5,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 various promotion rules changed (long) => (LONGINT), xxxL avoided *) - IMPORT OPT, OPC, OPM, OPS; + IMPORT OPT, OPC, OPM, OPS, SYSTEM; CONST UndefinedType = 0; (* named type not yet defined *) @@ -181,6 +181,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE AdrAndSize* (topScope: OPT.Object); BEGIN + ASSERT(OPT.sinttyp # NIL); ASSERT(OPT.inttyp # NIL); ASSERT(OPT.linttyp # NIL); + OPM.errpos := topScope^.adr; (* text position of scope used if error *) topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) @@ -189,15 +191,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; + + (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. + OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; @@ -256,7 +261,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE^ expr (n: OPT.Node; prec: INTEGER); PROCEDURE^ design(n: OPT.Node; prec: INTEGER); - PROCEDURE Len(n: OPT.Node; dim: LONGINT); + PROCEDURE Len(n: OPT.Node; dim: SYSTEM.INT64); BEGIN WHILE (n^.class = OPT.Nindex) & (n^.typ^.comp = OPT.DynArr(*26.7.2002*)) DO INC(dim); n := n^.left END ; IF (n^.class = OPT.Nderef) & (n^.typ^.comp = OPT.DynArr) THEN @@ -430,7 +435,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF prec > designPrec THEN OPM.Write(CloseParen) END END design; - PROCEDURE ParIntLiteral(n, size: LONGINT); + PROCEDURE ParIntLiteral(n: SYSTEM.INT64; size: LONGINT); BEGIN (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END @@ -723,7 +728,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE CaseStat(n: OPT.Node; outerProc: OPT.Object); VAR switchCase, label: OPT.Node; - low, high: LONGINT; form, i: INTEGER; + low, high: SYSTEM.INT64; form, i: INTEGER; BEGIN OPM.WriteString("switch "); expr(n^.left, MaxPrec); OPM.Write(Blank); OPC.BegBlk; @@ -812,7 +817,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR proc: OPT.Object; saved: ExitInfo; l, r: OPT.Node; BEGIN WHILE (n # NIL) & OPM.noerr DO - OPM.errpos := n^.conval^.intval; + OPM.errpos := OPM.Longint(n^.conval^.intval); IF n^.class # OPT.Ninittd THEN OPC.BegStat END; CASE n^.class OF | OPT.Nenter: IF n^.obj = NIL THEN (* enter module *) @@ -942,7 +947,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) - | OPT.Ntrap: OPC.Halt(n^.right^.conval^.intval) + | OPT.Ntrap: OPC.Halt(OPM.Longint(n^.right^.conval^.intval)) ELSE OPM.LogWStr("unhandled case in OPV.expr, n^.class = "); OPM.LogWNum(n^.class, 0); OPM.LogWLn; END; IF ~(n^.class IN {OPT.Nenter, OPT.Ninittd, OPT.Nifelse, OPT.Nwith, OPT.Ncase, OPT.Nwhile, OPT.Nloop}) THEN OPC.EndStat END ; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 3323883d..33481260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -56,12 +56,21 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.chartyp.size := OPM.CharSize; OPT.settyp.size := OPM.SetSize; OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize + OPT.booltyp.size := OPM.BoolSize; + + OPT.sinttyp := OPT.int8typ; + IF OPM.IntSize = 2 THEN + OPT.inttyp := OPT.int16typ; + OPT.linttyp := OPT.int32typ + ELSE + OPT.inttyp := OPT.int32typ; + OPT.linttyp := OPT.int64typ + END; + OPT.sintobj.typ := OPT.sinttyp; + OPT.intobj.typ := OPT.inttyp; + OPT.lintobj.typ := OPT.linttyp END PropagateElementaryTypeSizes; diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 430519df..6b35a090 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -27,7 +27,8 @@ MODULE Console; (* J. Templ, 29-June-96 *) WHILE s[i] # 0X DO Char(s[i]); INC(i) END END String; - PROCEDURE Int*(i, n: LONGINT); +(* todo. support int64 properly *) + PROCEDURE Int*(i, n: SYSTEM.INT64); VAR s: ARRAY 32 OF CHAR; i1, k: LONGINT; BEGIN IF i = SYSTEM.LSH(LONG(LONG(1)), SIZE(LONGINT)*8 - 1) THEN @@ -35,7 +36,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) ELSE s := "8463847412"; k := 10 END ELSE - i1 := ABS(i); + i1 := ABS(SYSTEM.VAL(LONGINT,i)); s[0] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; k := 1; WHILE i1 > 0 DO s[k] := CHR(i1 MOD 10 + ORD("0")); i1 := i1 DIV 10; INC(k) END END ; diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 7aeee5ac..fb9fc421 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -663,6 +663,18 @@ Especially Length would become fairly complex. x := n END ReadNum; + PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); + (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms + VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + *) + VAR n: LONGINT; + BEGIN ReadNum(R, n); x := n + END ReadNum64; + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) END WriteBool; @@ -710,6 +722,12 @@ Especially Length would become fairly complex. Write(R, CHR(x MOD 128)) END WriteNum; + PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum64; + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); From 9971e5645143771ca9cab388405ca4cf01323700 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 18 Sep 2016 15:52:11 +0100 Subject: [PATCH 039/140] INT64 support in the interface browser. --- bootstrap/unix-44/Console.c | 10 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 18 +++ bootstrap/unix-44/Files.h | 2 + bootstrap/unix-44/OPB.c | 80 +++++------ bootstrap/unix-44/OPB.h | 4 +- bootstrap/unix-44/OPC.c | 16 +-- bootstrap/unix-44/OPC.h | 6 +- bootstrap/unix-44/OPM.c | 95 ++++++++----- bootstrap/unix-44/OPM.h | 15 +- bootstrap/unix-44/OPP.c | 16 +-- bootstrap/unix-44/OPS.c | 10 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 5 +- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 14 +- bootstrap/unix-48/Console.c | 10 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 18 +++ bootstrap/unix-48/Files.h | 2 + bootstrap/unix-48/OPB.c | 80 +++++------ bootstrap/unix-48/OPB.h | 4 +- bootstrap/unix-48/OPC.c | 16 +-- bootstrap/unix-48/OPC.h | 6 +- bootstrap/unix-48/OPM.c | 95 ++++++++----- bootstrap/unix-48/OPM.h | 15 +- bootstrap/unix-48/OPP.c | 16 +-- bootstrap/unix-48/OPS.c | 10 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 5 +- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 14 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Files.c | 18 +++ bootstrap/unix-88/Files.h | 2 + bootstrap/unix-88/OPB.c | 18 +-- bootstrap/unix-88/OPM.c | 40 +++++- bootstrap/unix-88/OPM.h | 3 + bootstrap/unix-88/OPP.c | 8 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/windows-48/Console.c | 10 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 18 +++ bootstrap/windows-48/Files.h | 2 + bootstrap/windows-48/OPB.c | 80 +++++------ bootstrap/windows-48/OPB.h | 4 +- bootstrap/windows-48/OPC.c | 16 +-- bootstrap/windows-48/OPC.h | 6 +- bootstrap/windows-48/OPM.c | 95 ++++++++----- bootstrap/windows-48/OPM.h | 15 +- bootstrap/windows-48/OPP.c | 16 +-- bootstrap/windows-48/OPS.c | 10 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 5 +- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 14 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Files.c | 18 +++ bootstrap/windows-88/Files.h | 2 + bootstrap/windows-88/OPB.c | 18 +-- bootstrap/windows-88/OPM.c | 40 +++++- bootstrap/windows-88/OPM.h | 3 + bootstrap/windows-88/OPP.c | 8 +- bootstrap/windows-88/OPV.c | 4 +- src/library/s3/ethMD5.Mod | 2 +- src/library/v4/Texts.Mod | 16 +-- src/tools/browser/BrowserCmd.Mod | 226 +++++++++++++------------------ src/tools/make/vishap.make | 2 +- 68 files changed, 756 insertions(+), 574 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 168abb08..10d0a39b 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index a37ffdd3..6c934210 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c86d1186..0187d33f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 83a2652b..c7f21138 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 28), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 168abb08..10d0a39b 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index a37ffdd3..6c934210 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c86d1186..0187d33f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 83a2652b..fa5401ee 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index f7769827..845cce11 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -62,7 +62,7 @@ void Console_Int (int64 i, int64 n) __MOVE("8085774586302733229", s, 20); k = 19; } else { - i1 = __ABS(i); + i1 = __ABS((int64)i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4c6982cc..2b23754f 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int64 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index a5641b0c..51065265 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 2f005fc6..b271fa53 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -144,14 +144,8 @@ static int64 OPB_BoolToInt (BOOLEAN b) static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int32)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 23017356..47c8a9be 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -55,11 +55,13 @@ static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int32 OPM_Integer (int64 n); static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int64 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); @@ -73,6 +75,7 @@ export int64 OPM_SignedMaximum (int64 bytecount); export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); export int64 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); @@ -117,6 +120,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_Longint (int64 n) +{ + int64 _o_result; + _o_result = (int64)n; + return _o_result; +} + +int32 OPM_Integer (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; @@ -463,7 +480,7 @@ static void OPM_ShowLine (int64 pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)(pos - OPM_ErrorLineStartPos); + i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -700,6 +717,15 @@ int64 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); @@ -751,7 +777,7 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -840,9 +866,9 @@ void OPM_WriteHex (int64 i) void OPM_WriteInt (int64 i) { - CHAR s[20]; + CHAR s[24]; int64 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -852,17 +878,17 @@ void OPM_WriteInt (int64 i) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 7472bed7..9d977ff8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -28,10 +28,12 @@ import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int32 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import int64 OPM_Longint (int64 n); import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); @@ -42,6 +44,7 @@ import int64 OPM_SignedMaximum (int64 bytecount); import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); import int64 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 63191e02..5150cdbe 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) OPP_err(51); sf = 0; } - *sysflag = (int32)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 64)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 46abf128..04c24f09 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index f1978da4..ebbcbb49 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -16,7 +16,7 @@ export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); export void Console_Hex (int32 i); -export void Console_Int (int32 i, int32 n); +export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); export void Console_ReadLine (CHAR *line, LONGINT line__len); @@ -54,15 +54,15 @@ void Console_String (CHAR *s, LONGINT s__len) __DEL(s); } -void Console_Int (int32 i, int32 n) +void Console_Int (int64 i, int64 n) { CHAR s[32]; int32 i1, k; - if (i == __LSHL(1, 31, 32)) { + if (i == (int64)__LSHL(1, 31, 32)) { __MOVE("8463847412", s, 11); k = 10; } else { - i1 = __ABS(i); + i1 = __ABS(__VAL(int32, i)); s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; @@ -76,7 +76,7 @@ void Console_Int (int32 i, int32 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index cca2c91e..e5dc1566 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -12,7 +12,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); import void Console_Hex (int32 i); -import void Console_Int (int32 i, int32 n); +import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); import void Console_ReadLine (CHAR *line, LONGINT line__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8c0d8fd5..25e50dd9 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int32 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 4a28825a..b499ee0a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 90e93aed..47f2de21 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -12,7 +12,7 @@ export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; -static int32 OPB_maxExp; +static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); @@ -38,14 +38,14 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int32 i); +static BOOLEAN OPB_IntToBool (int64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); export void OPB_MOp (int8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int32 intval); +export OPT_Node OPB_NewIntConst (int64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int32 len); +export OPT_Node OPB_NewString (OPS_String str, int64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); @@ -63,7 +63,7 @@ export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); static void OPB_err (int16 n); -static int32 OPB_log (int32 x); +static int64 OPB_log (int64 x); static void OPB_err (int16 n) @@ -141,17 +141,11 @@ static int32 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int32 i) +static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -228,7 +222,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { int16 b; - int32 n; + int64 n; if (node->conval->intval >= 0) { n = node->conval->intval; } else { @@ -241,7 +235,7 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(b); } -OPT_Node OPB_NewIntConst (int32 intval) +OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; OPT_Node x = NIL; @@ -266,7 +260,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return _o_result; } -OPT_Node OPB_NewString (OPS_String str, int32 len) +OPT_Node OPB_NewString (OPS_String str, int64 len) { OPT_Node _o_result; OPT_Node x = NIL; @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int32 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -351,7 +345,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -466,14 +460,14 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { int16 f; - int32 k; + int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > OPM_MaxSet) { + if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); @@ -492,9 +486,9 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int32 OPB_log (int32 x) +static int64 OPB_log (int64 x) { - int32 _o_result; + int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -580,7 +574,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = -z->conval->intval; @@ -603,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { - if (z->conval->intval == (-2147483647-1)) { + if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { z->conval->intval = __ABS(z->conval->intval); @@ -845,7 +839,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { int16 f, g; OPT_Const xval = NIL, yval = NIL; - int32 xv, yv; + int64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1007,7 +1001,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) case 4: if (f == 4) { if (yval->intval != 0) { - xval->intval = (int)__MOD(xval->intval, yval->intval); + xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); } else { OPB_err(205); @@ -1122,7 +1116,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; int16 f, g; - int32 k; + int64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1229,7 +1223,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int32 val; + int64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1500,19 +1494,19 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int32 k, l; + int64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > OPM_MaxSet) { + if (0 > k || k > (int64)OPM_MaxSet) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > OPM_MaxSet) { + if (0 > l || l > (int64)OPM_MaxSet) { OPB_err(202); } } @@ -1535,14 +1529,14 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int32 k; + int64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= OPM_MaxSet)) { + if ((0 <= k && k <= (int64)OPM_MaxSet)) { (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2055,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } p = NewOp__53(19, fctno, p, x); @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int16)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; @@ -2120,8 +2114,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(2147483647, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); @@ -2143,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2281,7 +2275,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { OPB_err(63); } node = p->right; @@ -2622,7 +2616,7 @@ export void *OPB__init(void) __MODULE_IMPORT(OPT); __REGMOD("OPB", 0); /* BEGIN */ - OPB_maxExp = OPB_log(1073741824); + OPB_maxExp = OPB_log(4611686018427387904); OPB_maxExp = OPB_exp; __ENDMOD; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 183a5f32..08d025bf 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -25,10 +25,10 @@ import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); import void OPB_MOp (int8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int32 intval); +import OPT_Node OPB_NewIntConst (int64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int32 len); +import OPT_Node OPB_NewString (OPS_String str, int64 len); import OPT_Node OPB_Nil (void); import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 17690465..c21e44a4 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -26,8 +26,8 @@ export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int32 caseVal, int16 form); -static void OPC_CharacterLiteral (int32 c); +export void OPC_Case (int64 caseVal, int16 form); +static void OPC_CharacterLiteral (int64 c); export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); export void OPC_Constant (OPT_Const con, int16 form); @@ -67,8 +67,8 @@ static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int32 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +export void OPC_IntLiteral (int64 n, int32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); export int32 OPC_NofPtrs (OPT_Struct typ); @@ -1851,7 +1851,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int32 c) +static void OPC_CharacterLiteral (int64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1894,7 +1894,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int32 caseVal, int16 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1937,7 +1937,7 @@ void OPC_Halt (int32 n) OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int32 n, int32 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1950,7 +1950,7 @@ void OPC_IntLiteral (int32 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 34d9ebc2..9e1ec652 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -15,7 +15,7 @@ import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int32 caseVal, int16 form); +import void OPC_Case (int64 caseVal, int16 form); import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); import void OPC_Constant (OPT_Const con, int16 form); @@ -37,8 +37,8 @@ import void OPC_Increment (BOOLEAN decrement); import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int32 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int32 dim); +import void OPC_IntLiteral (int64 n, int32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import int32 OPC_SizeAlignment (int32 size); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 18478d1e..ba86c00a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -28,7 +28,8 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -45,46 +46,49 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int32 val); +export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int16 OPM_Integer (int64 n); static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int32 i, int32 len); +export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); -static void OPM_ShowLine (int32 pos); +static void OPM_ShowLine (int64 pos); export int32 OPM_SignedMaximum (int32 bytecount); export int32 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int32 i); +export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); export void OPM_SymWSet (SET s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int32 i); -export void OPM_WriteInt (int32 i); +export void OPM_WriteHex (int64 i); +export void OPM_WriteInt (int64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); @@ -107,7 +111,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int32 i, int32 len) +void OPM_LogWNum (int64 i, int64 len) { Console_Int(i, len); } @@ -117,6 +121,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int32 OPM_Longint (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; @@ -404,21 +422,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -436,7 +454,7 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int32 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int32 pos) +static void OPM_ShowLine (int64 pos) { Files_File f = NIL; Files_Rider r; @@ -460,10 +478,10 @@ static void OPM_ShowLine (int32 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -478,7 +496,7 @@ static void OPM_ShowLine (int32 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -535,9 +553,9 @@ void OPM_err (int16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int32 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ (SET)val), 1, 32); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } void OPM_FPrintSet (int32 *fp, SET set) @@ -702,6 +720,15 @@ int32 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); @@ -751,9 +778,9 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int32 i) +void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -820,17 +847,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int32 i) +void OPM_WriteHex (int64 i) { CHAR s[3]; - int16 digit; - digit = __ASHR((int16)i, 4); + int32 digit; + digit = __ASHR((int32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int16)i, -16); + digit = __MASK((int32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -840,31 +867,31 @@ void OPM_WriteHex (int32 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int32 i) +void OPM_WriteInt (int64 i) { - CHAR s[20]; - int32 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + CHAR s[24]; + int64 i1, k; + if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); } else { i1 = __ABS(i); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); + s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a36522a1..504519da 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -21,18 +21,20 @@ import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_no import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int32 val); +import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int32 i, int32 len); +import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import void OPM_Mark (int16 n, int32 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -42,17 +44,18 @@ import int32 OPM_SignedMaximum (int32 bytecount); import int32 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int32 i); +import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); import void OPM_SymWSet (SET s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int32 i); -import void OPM_WriteInt (int32 i); +import void OPM_WriteHex (int64 i); +import void OPM_WriteInt (int64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 8db5ef60..44ce8ff1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -134,7 +134,7 @@ static void OPP_CheckMark (int8 *vis) static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; - int32 sf; + int64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) OPP_err(51); sf = 0; } - *sysflag = (int16)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -254,7 +254,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int32 n; + int64 n; int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > OPM_MaxIndex) { + if (n <= 0 || n > (int64)OPM_MaxIndex) { OPP_err(63); n = 1; } @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -932,7 +932,7 @@ static void GetCode__19 (void) { OPT_ConstExt ext = NIL; int16 n; - int32 c; + int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 32)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index fb0f2237..f80ca2b1 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -17,7 +17,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; export int16 OPS_numtyp; -export int32 OPS_intval; +export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; @@ -178,7 +178,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -192,7 +192,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); i += 1; } } else { @@ -203,8 +203,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + d; + if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { + OPS_intval = OPS_intval * 10 + (int64)d; } else { OPS_err(203); } diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d2b5dfb4..d33103c1 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -15,7 +15,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; import int16 OPS_numtyp; -import int32 OPS_intval; +import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 83a2652b..fa5401ee 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -17,7 +17,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -1838,7 +1839,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 24), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d4b49da8..b6566702 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int32 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a32351aa..cddb737c 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -36,10 +36,10 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n); static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int32 dim); +static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int32 n, int32 size); +static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); static void OPV_SizeCast (int32 from, int32 to); @@ -414,7 +414,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int32 dim) +static void OPV_Len (OPT_Node n, int64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -725,7 +725,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int32 n, int32 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { if (OPV_ansi) { OPM_WriteInt(n); @@ -1210,7 +1210,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int32 low, high; + int64 low, high; int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 32408370..1f28b96d 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -62,7 +62,7 @@ void Console_Int (int64 i, int64 n) __MOVE("8085774586302733229", s, 20); k = 19; } else { - i1 = __ABS(i); + i1 = __ABS((int64)i); s[0] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c2097ffb..d94e42ad 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -90,6 +90,7 @@ export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -105,6 +106,7 @@ export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -936,6 +938,13 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } +void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +{ + int64 n; + Files_ReadNum(&*R, R__typ, &n); + *x = n; +} + void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -1004,6 +1013,15 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } +void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +{ + while (x < -64 || x > 63) { + Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); + x = __ASHR(x, 7); + } + Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); +} + void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) { __COPY(f->workName, name, name__len); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index c98b006a..9ea6ac78 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -47,6 +47,7 @@ import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); @@ -61,6 +62,7 @@ import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 2f005fc6..b271fa53 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -144,14 +144,8 @@ static int64 OPB_BoolToInt (BOOLEAN b) static BOOLEAN OPB_IntToBool (int64 i) { BOOLEAN _o_result; - if (i == 0) { - _o_result = 0; - return _o_result; - } else { - _o_result = 1; - return _o_result; - } - __RETCHK; + _o_result = i != 0; + return _o_result; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) @@ -274,7 +268,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval = OPT_NewConst(); x->typ = OPT_stringtyp; x->conval->intval = -1; - x->conval->intval2 = len; + x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); _o_result = x; @@ -1917,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if (x->typ->size != OPT_linttyp->size) { + if (x->typ->size < OPT_linttyp->size) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -2068,7 +2062,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (!(f == 4) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = (int32)x->conval->intval; + L = OPM_Integer(x->conval->intval); typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { typ = typ->BaseTyp; @@ -2132,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->obj = NIL; } else { p = NewOp__53(12, 17, p, x); - p->typ = OPT_linttyp; + p->typ = p->left->typ; } } else { OPB_err(111); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 23017356..47c8a9be 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -55,11 +55,13 @@ static void OPM_GetProperties (void); static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); +export int32 OPM_Integer (int64 n); static void OPM_LogErrMsg (int32 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); +export int64 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); export void OPM_Mark (int32 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); @@ -73,6 +75,7 @@ export int64 OPM_SignedMaximum (int64 bytecount); export int64 OPM_SignedMinimum (int64 bytecount); export void OPM_SymRCh (CHAR *ch); export int64 OPM_SymRInt (void); +export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (SET *s); @@ -117,6 +120,20 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_Longint (int64 n) +{ + int64 _o_result; + _o_result = (int64)n; + return _o_result; +} + +int32 OPM_Integer (int64 n) +{ + int32 _o_result; + _o_result = __VAL(int32, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; @@ -463,7 +480,7 @@ static void OPM_ShowLine (int64 pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)(pos - OPM_ErrorLineStartPos); + i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -700,6 +717,15 @@ int64 OPM_SymRInt (void) return _o_result; } +int64 OPM_SymRInt64 (void) +{ + int64 _o_result; + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); + _o_result = k; + return _o_result; +} + void OPM_SymRSet (SET *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); @@ -751,7 +777,7 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); } void OPM_SymWSet (SET s) @@ -840,9 +866,9 @@ void OPM_WriteHex (int64 i) void OPM_WriteInt (int64 i) { - CHAR s[20]; + CHAR s[24]; int64 i1, k; - if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -852,17 +878,17 @@ void OPM_WriteInt (int64 i) i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 24)] = (CHAR)(__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } if (i < 0) { - s[__X(k, 20)] = '-'; + s[__X(k, 24)] = '-'; k += 1; } while (k > 0) { k -= 1; - OPM_Write(s[__X(k, 20)]); + OPM_Write(s[__X(k, 24)]); } } } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 7472bed7..9d977ff8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -28,10 +28,12 @@ import void OPM_FPrintSet (int64 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); +import int32 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); +import int64 OPM_Longint (int64 n); import void OPM_Mark (int32 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); @@ -42,6 +44,7 @@ import int64 OPM_SignedMaximum (int64 bytecount); import int64 OPM_SignedMinimum (int64 bytecount); import void OPM_SymRCh (CHAR *ch); import int64 OPM_SymRInt (void); +import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (SET *s); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 63191e02..5150cdbe 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -151,7 +151,7 @@ static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) OPP_err(51); sf = 0; } - *sysflag = (int32)sf; + *sysflag = OPM_Integer(sf); OPP_CheckSym(23); } else { *sysflag = default_; @@ -283,7 +283,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_err(51); n = 1; } - (*typ)->n = n; + (*typ)->n = OPM_Longint(n); if (OPP_sym == 25) { OPS_Get(&OPP_sym); OPP_Type(&(*typ)->BaseTyp, &*banned); @@ -1179,7 +1179,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP OPP_ConstExpression(&x); f = x->typ->form; if (__IN(f, 0x18, 64)) { - xval = x->conval->intval; + xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); xval = 1; @@ -1194,7 +1194,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); - yval = y->conval->intval; + yval = OPM_Longint(y->conval->intval); if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 46abf128..04c24f09 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1351,7 +1351,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_ExitInfo saved; OPT_Node l = NIL, r = NIL; while ((n != NIL && OPM_noerr)) { - OPM_errpos = n->conval->intval; + OPM_errpos = OPM_Longint(n->conval->intval); if (n->class != 14) { OPC_BegStat(); } @@ -1625,7 +1625,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPV_IfStat(n, n->subcl == 0, outerProc); break; case 28: - OPC_Halt(n->right->conval->intval); + OPC_Halt(OPM_Longint(n->right->conval->intval)); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.expr, n^.class = ", 40); diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 57975454..32c31bd8 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -231,7 +231,7 @@ under a public-key cryptosystem such as RSA. *) SYSTEM.MOVE(SYSTEM.ADR(buf[beg]), SYSTEM.ADR(context.in[0]), 64); ByteReverse(context.in, in, 16); Transform(context.buf, in); - INC(beg, 64); DEC(len, 64) + INC(beg, 64); DEC(len, 64) END; IF len > 0 THEN SYSTEM.MOVE(SYSTEM.ADR(buf[beg]), SYSTEM.ADR(context.in[0]), len) diff --git a/src/library/v4/Texts.Mod b/src/library/v4/Texts.Mod index 26b13c81..ecca315d 100644 --- a/src/library/v4/Texts.Mod +++ b/src/library/v4/Texts.Mod @@ -1,6 +1,6 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) IMPORT - Files, Modules, Reals; + Files, Modules, Reals, SYSTEM; (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) @@ -545,19 +545,13 @@ MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91** WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END END WriteString; - PROCEDURE WriteInt* (VAR W: Writer; x, n: LONGINT); + PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); VAR - i: INTEGER; x0: LONGINT; - a: ARRAY 22 OF CHAR; + i: INTEGER; x0: SYSTEM.INT64; + a: ARRAY 24 OF CHAR; BEGIN i := 0; IF x < 0 THEN - IF x = MIN(LONGINT) THEN - IF SIZE(LONGINT) = 4 THEN - WriteString(W, " -2147483648") - ELSE - WriteString(W, " -9223372036854775808") - END; - RETURN + IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN ELSE DEC(n); x0 := -x END ELSE x0 := x diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 55b6c192..564b29b3 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,39 +1,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Console, Platform; + OPM, OPS, OPT, OPV, Texts, Console, Platform, SYSTEM; CONST OptionChar = "-"; - (* object modes *) - Var = 1; VarPar = 2; Con = 3; Fld = 4; Typ = 5; LProc = 6; XProc = 7; - SProc = 8; CProc = 9; IProc = 10; Mod = 11; Head = 12; TProc = 13; - - (* structure forms *) - Undef = 0; Byte = 1; Bool = 2; Char = 3; SInt = 4; Int = 5; LInt = 6; - Real = 7; LReal = 8; Set = 9; String = 10; NilTyp = 11; NoTyp = 12; - Pointer = 13; ProcTyp = 14; Comp = 15; - - (* composite structure forms *) - Basic = 1; Array = 2; DynArr = 3; Record = 4; - - (* module visibility of objects *) - internal = 0; external = 1; externalR = 2; - - (* symbol file items *) - Smname = 16; Send = 18; Stype = 19; Salias = 20; Svar = 21; Srvar = 22; - Svalpar = 23; Svarpar = 24; Sfld = 25; Srfld = 26; Shdptr = 27; Shdpro = 28; Stpro = 29; Shdtpro = 30; - Sxpro = 31; Sipro = 32; Scpro = 33; Sstruct = 34; Ssys = 35; Sptr = 36; Sarr = 37; Sdarr = 38; Srec = 39; Spro = 40; VAR W: Texts.Writer; option: CHAR; PROCEDURE Ws(s: ARRAY OF CHAR); BEGIN Texts.WriteString(W, s) END Ws; - PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; - PROCEDURE Wi(i: LONGINT); BEGIN Texts.WriteInt(W, i, 0) END Wi; - PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; + PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; + PROCEDURE Wi(i: SYSTEM.INT64); BEGIN Texts.WriteInt(W, i, 0) END Wi; + PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; PROCEDURE Indent(i: INTEGER); BEGIN WHILE i > 0 DO Wch(" "); Wch(" "); DEC(i) END @@ -51,7 +32,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver WHILE par # NIL DO IF ~first THEN Ws("; ") ELSE first := FALSE END ; IF option = "x" THEN Wi(par^.adr); Wch(" ") END ; - IF par^.mode = VarPar THEN Ws("VAR ") END ; + IF par^.mode = OPT.VarPar THEN Ws("VAR ") END ; Ws(par^.name); Ws(": "); Wtype(par^.typ); par := par^.link END ; @@ -60,75 +41,65 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END Wsign; PROCEDURE Objects(obj: OPT.Object; mode: SET); - VAR i: LONGINT; m: INTEGER; s: SET; ext: OPT.ConstExt; + VAR i: SYSTEM.INT64; m: INTEGER; s: SET; ext: OPT.ConstExt; BEGIN IF obj # NIL THEN Objects(obj^.left, mode); IF obj^.mode IN mode THEN CASE obj^.mode OF - | Con: - Indent(2); Ws(obj^.name); Ws(" = "); - CASE obj^.typ^.form OF - | Bool: - IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END - | Char: - IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN - Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) - ELSE - i := obj^.conval^.intval DIV 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - i := obj^.conval^.intval MOD 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - Wch("X") - END - | SInt, Int, LInt: - Wi(obj^.conval^.intval) - | Set: - Wch("{"); i := 0; s := obj^.conval^.setval; - WHILE i <= MAX(SET) DO - IF i IN s THEN Wi(i); EXCL(s, i); - IF s # {} THEN Ws(", ") END - END ; - INC(i) - END ; - Wch("}") - | Real: - Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) - | LReal: - Texts.WriteLongReal(W, obj^.conval^.realval, 23) - | String: - Ws(obj^.conval^.ext^) - | NilTyp: - Ws("NIL") - ELSE (* Ignore other forms *) - END ; - Wch(";"); Wln - | Typ: - IF obj^.name # "" THEN Indent(2); - IF obj^.typ^.strobj = obj THEN (* canonical name *) - Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) - ELSE (* alias *) - Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) - END ; - Wch(";"); Wln - END - | Var: - Indent(2); Ws(obj^.name); - IF obj^.vis = externalR THEN Ws("-: ") ELSE Ws(": ") END ; - Wtype(obj^.typ); Wch(";"); Wln - | XProc, CProc, IProc: - Indent(1); Ws("PROCEDURE "); - IF obj^.mode = IProc THEN Wch("+") - ELSIF obj^.mode = CProc THEN Wch("-") - END ; - Ws(obj^.name); - Wsign(obj^.typ, obj^.link); - IF obj^.mode = CProc THEN - ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); - WHILE i <= m DO Wch(ext^[i]); INC(i) END ; - Wch('"'); - END ; - Wch(";"); Wln + |OPT.Con: Indent(2); Ws(obj^.name); Ws(" = "); + CASE obj^.typ^.form OF + |OPT.Bool: IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END + |OPT.Char: IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN + Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) + ELSE + i := obj^.conval^.intval DIV 16; + IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + i := obj^.conval^.intval MOD 16; + IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + Wch("X") + END + |OPT.Int: Wi(obj^.conval^.intval) + |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; + WHILE i <= MAX(SET) DO + IF i IN s THEN Wi(i); EXCL(s, i); + IF s # {} THEN Ws(", ") END + END ; + INC(i) + END ; + Wch("}") + |OPT.Real: Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) + |OPT.LReal: Texts.WriteLongReal(W, obj^.conval^.realval, 23) + |OPT.String: Ws(obj^.conval^.ext^) + |OPT.NilTyp: Ws("NIL") + ELSE (* Ignore other forms *) + END ; + Wch(";"); Wln + |OPT.Typ: IF obj^.name # "" THEN Indent(2); + IF obj^.typ^.strobj = obj THEN (* canonical name *) + Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) + ELSE (* alias *) + Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) + END ; + Wch(";"); Wln + END + |OPT.Var: Indent(2); Ws(obj^.name); + IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END ; + Wtype(obj^.typ); Wch(";"); Wln + |OPT.XProc, + OPT.CProc, + OPT.IProc: Indent(1); Ws("PROCEDURE "); + IF obj^.mode = OPT.IProc THEN Wch("+") + ELSIF obj^.mode = OPT.CProc THEN Wch("-") + END ; + Ws(obj^.name); + Wsign(obj^.typ, obj^.link); + IF obj^.mode = OPT.CProc THEN + ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); + WHILE i <= m DO Wch(ext^[i]); INC(i) END ; + Wch('"'); + END ; + Wch(";"); Wln ELSE (* Ignore other modes *) END END ; @@ -141,10 +112,10 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN IF obj # NIL THEN Wmthd(obj^.left); - IF (obj^.mode = TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN + IF (obj^.mode = OPT.TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN Indent(3); Ws("PROCEDURE ("); IF obj^.name # OPM.HdTProcName THEN - IF obj^.link^.mode = VarPar THEN Ws("VAR ") END ; + IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END ; Ws(obj^.link^.name); Ws(": "); Wtype(obj^.link^.typ) END ; Ws(") "); Ws(obj^.name); @@ -171,40 +142,33 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN CASE typ^.form OF - | Undef: - Ws("Undef") - | Pointer: - Ws("POINTER "); SysFlag; Ws("TO "); Wtype(typ^.BaseTyp) - | ProcTyp: - Ws("PROCEDURE "); SysFlag; Wsign(typ^.BaseTyp, typ^.link) - | Comp: - CASE typ^.comp OF - | Array: - Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) - | DynArr: - Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) - | Record: - Ws("RECORD ");SysFlag; - IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; - Wln; fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = Fld) DO - IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); - IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; - Ws(fld^.name); - IF fld^.vis = externalR THEN Wch("-") END ; - Ws(": "); Wtype(fld^.typ); Wch(";"); - Wln - END ; - fld := fld^.link - END ; - Wmthd(typ^.link); - Indent(2); Ws("END "); - IF option = "x" THEN Indent(1); - Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); - Ws(" nofm: "); Wi(typ^.n); Ws(" *)") - END - ELSE (* Ignore other comps *) - END + |OPT.Undef: Ws("Undef") + |OPT.Pointer: Ws("POINTER "); SysFlag; Ws("TO "); Wtype(typ^.BaseTyp) + |OPT.ProcTyp: Ws("PROCEDURE "); SysFlag; Wsign(typ^.BaseTyp, typ^.link) + |OPT.Comp: CASE typ^.comp OF + |OPT.Array: Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) + |OPT.DynArr: Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) + |OPT.Record: Ws("RECORD ");SysFlag; + IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; + Wln; fld := typ^.link; + WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO + IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); + IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; + Ws(fld^.name); + IF fld^.vis = OPT.externalR THEN Wch("-") END ; + Ws(": "); Wtype(fld^.typ); Wch(";"); + Wln + END ; + fld := fld^.link + END ; + Wmthd(typ^.link); + Indent(2); Ws("END "); + IF option = "x" THEN Indent(1); + Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); + Ws(" nofm: "); Wi(typ^.n); Ws(" *)") + END + ELSE (* Ignore other comps *) + END ELSE (* Ignore other froms *) END END Wstruct; @@ -216,7 +180,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF obj^.name # "" THEN IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wch(".") ELSIF (typ = OPT.bytetyp) OR (typ = OPT.sysptrtyp) THEN Ws("SYSTEM.") - ELSIF obj^.vis = internal THEN Wch("#") + ELSIF obj^.vis = OPT.internal THEN Wch("#") END ; Ws(obj^.name) ELSE @@ -242,7 +206,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver ELSE Wln END END CheckHeader; - + BEGIN OPT.Import("@notself", name, done); IF done THEN @@ -255,10 +219,10 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END ; IF ~first THEN Wch(";"); Wln END ; CheckHeader; - Header("CONST"); Objects(OPT.GlbMod[0].right, {Con}); CheckHeader; - Header("TYPE"); Objects(OPT.GlbMod[0].right, {Typ}); CheckHeader; - Header("VAR"); Objects(OPT.GlbMod[0].right, {Var}); CheckHeader; - Objects(OPT.GlbMod[0].right, {XProc, IProc, CProc}); + Header("CONST"); Objects(OPT.GlbMod[0].right, {OPT.Con}); CheckHeader; + Header("TYPE"); Objects(OPT.GlbMod[0].right, {OPT.Typ}); CheckHeader; + Header("VAR"); Objects(OPT.GlbMod[0].right, {OPT.Var}); CheckHeader; + Objects(OPT.GlbMod[0].right, {OPT.XProc, OPT.IProc, OPT.CProc}); Wln; Ws("END "); Ws(name); Wch("."); Wln; Texts.Append(T, W.buf) ELSE @@ -266,7 +230,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Texts.WriteLn(W); Texts.Append(T, W.buf) END END WModule; - + PROCEDURE Ident(VAR name, first: ARRAY OF CHAR); VAR i, j: INTEGER; ch: CHAR; BEGIN i := 0; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index faacf33f..008180cb 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -335,7 +335,7 @@ misc: s3: @printf "\nMaking s3 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod From 1a83167d5a5b87cdbc64cc586aad0dcb5af40cd0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Sep 2016 16:43:34 +0100 Subject: [PATCH 040/140] Fix ethMD5 build. May need more work to be correct on 64 bit builds. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 15 +-- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 18 ++- bootstrap/unix-44/OPT.h | 3 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 20 ++-- bootstrap/unix-44/Texts.h | 4 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 15 +-- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 18 ++- bootstrap/unix-48/OPT.h | 3 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 20 ++-- bootstrap/unix-48/Texts.h | 4 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 15 +-- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 18 ++- bootstrap/unix-88/OPT.h | 3 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 8 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 15 +-- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 18 ++- bootstrap/windows-48/OPT.h | 3 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 20 ++-- bootstrap/windows-48/Texts.h | 4 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 15 +-- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 18 ++- bootstrap/windows-88/OPT.h | 3 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 8 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 7 +- src/compiler/OPT.Mod | 8 ++ src/library/s3/ethMD5.Mod | 138 +++++++++++----------- src/test/confidence/planned-binary-change | 2 +- src/tools/make/vishap.make | 2 +- 200 files changed, 407 insertions(+), 372 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 10d0a39b..a3acbd98 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6c934210..32971286 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0187d33f..2dfc3018 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c7f21138..a18e6768 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index cdb47dd1..10d2ba41 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6e372559..57c87f55 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 994ef48a..0339cbdb 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 033c5c1a..6d3f7c1e 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -158,7 +158,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 10d0a39b..a3acbd98 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6c934210..32971286 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0187d33f..2dfc3018 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index fa5401ee..c1bc93b1 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index cdb47dd1..10d2ba41 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6e372559..57c87f55 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e14d923b..f277a856 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 45ca0bb5..b2a965f8 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -159,7 +159,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ec75a6df..a5c4087d 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 845cce11..dea88004 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 23f894db..a1322efe 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2b23754f..7ace9c7c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 51065265..2040560d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c99a229c..02dc0bbd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index f9b4a041..aa22df29 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 662b84f9..60382d3c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9f3d713d..4ef50204 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index b271fa53..d94f4b29 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int32 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 185aa968..1330baf1 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 689dfff4..b33dc59f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bf22de26..e749f6b6 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 47c8a9be..39c62389 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9d977ff8..908a80ad 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5150cdbe..8573d6b1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 7caa7493..a92e1feb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6d67036e..d7c08330 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b588c3f1..6928030e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -138,6 +138,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int32 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -163,6 +164,21 @@ static void OPT_err (int32 n) OPM_err(n); } +int32 OPT_IntSize (int64 n) +{ + int32 _o_result; + int32 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 504e70b7..abb49dda 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,6 +93,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int32 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 04c24f09..48080e50 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 874e4d6d..55230bcc 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 86dbc3cb..d5e89ca2 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 08445989..e81db820 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 44e13bae..dec142cf 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ad3ef185..6aa3846a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 23e3adb8..d1c9f056 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 5a607fdd..37fac00b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int32 i; int64 x0; - CHAR a[22]; + CHAR a[24]; i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f18817ff..0f195ce8 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 1bc7e5ed..00f0ac1a 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8d3792df..8396896b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d7c28163..a4fbedda 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a575d688..04503b55 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f0786605..c27f0ae1 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 1a0e2ffe..4ea29c15 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index ebbcbb49..6409cfb5 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index e5dc1566..8f5a2a2a 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 25e50dd9..d55dffcd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b499ee0a..8b2d7bab 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b80b6666..08a21c58 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 50308888..65b6b0b1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 142b60f4..f61acc40 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2dc36a9b..6841c244 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 47f2de21..13c64396 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int16 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 08d025bf..a57ace75 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c21e44a4..9923ccbc 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 9e1ec652..83153512 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ba86c00a..558dde61 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 504519da..c5298326 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 44ce8ff1..5351781f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f80ca2b1..67bca013 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d33103c1..3f106d0c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index fa5401ee..c1bc93b1 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -139,6 +139,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int16 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -164,6 +165,21 @@ static void OPT_err (int16 n) OPM_err(n); } +int16 OPT_IntSize (int64 n) +{ + int16 _o_result; + int16 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b6566702..fd0a538e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -94,6 +94,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int16 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cddb737c..ffe3eb71 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 614e2cb6..35849e85 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index cfea54a7..84dc9bd1 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8b263757..6982b582 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6ff22ad6..e79f35d7 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 8758a988..b2d5f19a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 36e01e6c..ea987a3e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e14d923b..f277a856 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -221,7 +221,7 @@ export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); @@ -1050,15 +1050,15 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) +void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int16 i; - int32 x0; - CHAR a[22]; + int64 x0; + CHAR a[24]; i = 0; if (x < 0) { - if (x == (-2147483647-1)) { - Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13); + if (x == (-9223372036854775807-1)) { + Texts_WriteString(&*W, W__typ, (CHAR*)" -9223372036854775808", 22); return; } else { n -= 1; @@ -1068,11 +1068,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > i) { + while (n > (int64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 45ca0bb5..b2a965f8 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h @@ -159,7 +159,7 @@ import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int32 x, int32 n); +import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 1f322c5e..2d0b9dee 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 689e3cdd..2bdf2af6 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index c2339121..5245f35d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 341502ec..4d312413 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index f7615911..1ecf99b1 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ec75a6df..a5c4087d 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index e5d79317..6b8f5d99 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 1f28b96d..a18275f8 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 23f894db..a1322efe 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index d94e42ad..ead58244 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9ea6ac78..94cf47a0 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c99a229c..02dc0bbd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index f9b4a041..aa22df29 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 662b84f9..60382d3c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9f3d713d..4ef50204 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index b271fa53..d94f4b29 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -221,18 +221,7 @@ OPT_Node OPB_EmptySet (void) static void OPB_SetIntType (OPT_Node node) { - int32 b; - int64 n; - if (node->conval->intval >= 0) { - n = node->conval->intval; - } else { - n = -(node->conval->intval + 1); - } - b = 1; - while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { - b += 1; - } - node->typ = OPT_IntType(b); + node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } OPT_Node OPB_NewIntConst (int64 intval) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 185aa968..1330baf1 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 689dfff4..b33dc59f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bf22de26..e749f6b6 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 47c8a9be..39c62389 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9d977ff8..908a80ad 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5150cdbe..8573d6b1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 22557b29..7cbdb873 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 7caa7493..a92e1feb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6d67036e..d7c08330 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b588c3f1..6928030e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -138,6 +138,7 @@ export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +export int32 OPT_IntSize (int64 n); export OPT_Struct OPT_IntType (int64 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); @@ -163,6 +164,21 @@ static void OPT_err (int32 n) OPM_err(n); } +int32 OPT_IntSize (int64 n) +{ + int32 _o_result; + int32 bytes; + if (n < 0) { + n = -(n + 1); + } + bytes = 1; + while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { + bytes += 1; + } + _o_result = bytes; + return _o_result; +} + OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 504e70b7..abb49dda 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -93,6 +93,7 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); +import int32 OPT_IntSize (int64 n); import OPT_Struct OPT_IntType (int64 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 04c24f09..48080e50 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 937f0ba6..33c1eeeb 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5af3b5f2..a576c90e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a94b93a8..7832ec0f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 08445989..e81db820 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 44e13bae..dec142cf 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ad3ef185..6aa3846a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 23e3adb8..d1c9f056 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 5a607fdd..37fac00b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1054,7 +1054,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) { int32 i; int64 x0; - CHAR a[22]; + CHAR a[24]; i = 0; if (x < 0) { if (x == (-9223372036854775807-1)) { @@ -1068,7 +1068,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) x0 = x; } do { - a[__X(i, 22)] = (CHAR)(__MOD(x0, 10) + 48); + a[__X(i, 24)] = (CHAR)(__MOD(x0, 10) + 48); x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); @@ -1081,7 +1081,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } do { i -= 1; - Texts_Write(&*W, W__typ, a[__X(i, 22)]); + Texts_Write(&*W, W__typ, a[__X(i, 24)]); } while (!(i == 0)); } diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f18817ff..0f195ce8 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 1bc7e5ed..00f0ac1a 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8d3792df..8396896b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f5c1a708..b3535e92 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d7c28163..a4fbedda 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 6815aacb..414a05f0 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a575d688..04503b55 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f0786605..c27f0ae1 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 09805f14..79c81b1c 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -105,12 +105,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END EmptySet; PROCEDURE SetIntType(node: OPT.Node); - VAR b: INTEGER; n: SYSTEM.INT64; - BEGIN - (* Determine number of bytes required to represent constant value *) - IF node.conval.intval >= 0 THEN n := node.conval.intval ELSE n := -(node.conval.intval+1) END; - b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; - node.typ := OPT.IntType(b) + BEGIN node.typ := OPT.IntType(OPT.IntSize(node.conval.intval)) END SetIntType; PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index c4b30065..7d67c2b5 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -212,6 +212,14 @@ VAR PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; +PROCEDURE IntSize*(n: SYSTEM.INT64):INTEGER; +(* Determines number of bytes required to store signed value n. *) + VAR bytes: INTEGER; +BEGIN + IF n < 0 THEN n := -(n+1) END; + bytes := 1; WHILE (bytes < 8) & (ASH(n, -(8*bytes-1)) # 0) DO INC(bytes) END; + RETURN bytes +END IntSize; PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 32c31bd8..07a605cb 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -4,6 +4,8 @@ Refer to the "General ETH Oberon System Source License" contract available at: h MODULE ethMD5; (** portable *) (* ejz *) IMPORT SYSTEM; +(* todo. Use fixed size integers and sets. *) + (** The MD5 Message-Digest Algorithm (RFC1321) The algorithm takes as input a message of arbitrary length and produces @@ -29,10 +31,10 @@ under a public-key cryptosystem such as RSA. *) VAR cont: Context; BEGIN NEW(cont); - cont.buf[0] := 067452301H; - cont.buf[1] := 0EFCDAB89H; - cont.buf[2] := 098BADCFEH; - cont.buf[3] := 010325476H; + cont.buf[0] := 00000000067452301H; + cont.buf[1] := 0FFFFFFFFEFCDAB89H; + cont.buf[2] := 0FFFFFFFF98BADCFEH; + cont.buf[3] := 00000000010325476H; cont.bits := 0; RETURN cont END New; @@ -107,73 +109,73 @@ under a public-key cryptosystem such as RSA. *) BEGIN a := buf[0]; b := buf[1]; c := buf[2]; d := buf[3]; - STEP1(a, b, c, d, in[0]+0D76AA478H, 7); - STEP1(d, a, b, c, in[1]+0E8C7B756H, 12); - STEP1(c, d, a, b, in[2]+0242070DBH, 17); - STEP1(b, c, d, a, in[3]+0C1BDCEEEH, 22); - STEP1(a, b, c, d, in[4]+0F57C0FAFH, 7); - STEP1(d, a, b, c, in[5]+04787C62AH, 12); - STEP1(c, d, a, b, in[6]+0A8304613H, 17); - STEP1(b, c, d, a, in[7]+0FD469501H, 22); - STEP1(a, b, c, d, in[8]+0698098D8H, 7); - STEP1(d, a, b, c, in[9]+08B44F7AFH, 12); - STEP1(c, d, a, b, in[10]+0FFFF5BB1H, 17); - STEP1(b, c, d, a, in[11]+0895CD7BEH, 22); - STEP1(a, b, c, d, in[12]+06B901122H, 7); - STEP1(d, a, b, c, in[13]+0FD987193H, 12); - STEP1(c, d, a, b, in[14]+0A679438EH, 17); - STEP1(b, c, d, a, in[15]+049B40821H, 22); + STEP1(a, b, c, d, in[0] + 0FFFFFFFFD76AA478H, 7); + STEP1(d, a, b, c, in[1] + 0FFFFFFFFE8C7B756H, 12); + STEP1(c, d, a, b, in[2] + 000000000242070DBH, 17); + STEP1(b, c, d, a, in[3] + 0FFFFFFFFC1BDCEEEH, 22); + STEP1(a, b, c, d, in[4] + 0FFFFFFFFF57C0FAFH, 7); + STEP1(d, a, b, c, in[5] + 0000000004787C62AH, 12); + STEP1(c, d, a, b, in[6] + 0FFFFFFFFA8304613H, 17); + STEP1(b, c, d, a, in[7] + 0FFFFFFFFFD469501H, 22); + STEP1(a, b, c, d, in[8] + 000000000698098D8H, 7); + STEP1(d, a, b, c, in[9] + 0FFFFFFFF8B44F7AFH, 12); + STEP1(c, d, a, b, in[10] + 0FFFFFFFFFFFF5BB1H, 17); + STEP1(b, c, d, a, in[11] + 0FFFFFFFF895CD7BEH, 22); + STEP1(a, b, c, d, in[12] + 0000000006B901122H, 7); + STEP1(d, a, b, c, in[13] + 0FFFFFFFFFD987193H, 12); + STEP1(c, d, a, b, in[14] + 0FFFFFFFFA679438EH, 17); + STEP1(b, c, d, a, in[15] + 00000000049B40821H, 22); - STEP2(a, b, c, d, in[1]+0F61E2562H, 5); - STEP2(d, a, b, c, in[6]+0C040B340H, 9); - STEP2(c, d, a, b, in[11]+0265E5A51H, 14); - STEP2(b, c, d, a, in[0]+0E9B6C7AAH, 20); - STEP2(a, b, c, d, in[5]+0D62F105DH, 5); - STEP2(d, a, b, c, in[10]+02441453H, 9); - STEP2(c, d, a, b, in[15]+0D8A1E681H, 14); - STEP2(b, c, d, a, in[4]+0E7D3FBC8H, 20); - STEP2(a, b, c, d, in[9]+021E1CDE6H, 5); - STEP2(d, a, b, c, in[14]+0C33707D6H, 9); - STEP2(c, d, a, b, in[3]+0F4D50D87H, 14); - STEP2(b, c, d, a, in[8]+0455A14EDH, 20); - STEP2(a, b, c, d, in[13]+0A9E3E905H, 5); - STEP2(d, a, b, c, in[2]+0FCEFA3F8H, 9); - STEP2(c, d, a, b, in[7]+0676F02D9H, 14); - STEP2(b, c, d, a, in[12]+08D2A4C8AH, 20); + STEP2(a, b, c, d, in[1] + 0FFFFFFFFF61E2562H, 5); + STEP2(d, a, b, c, in[6] + 0FFFFFFFFC040B340H, 9); + STEP2(c, d, a, b, in[11] + 000000000265E5A51H, 14); + STEP2(b, c, d, a, in[0] + 0FFFFFFFFE9B6C7AAH, 20); + STEP2(a, b, c, d, in[5] + 0FFFFFFFFD62F105DH, 5); + STEP2(d, a, b, c, in[10] + 00000000002441453H, 9); + STEP2(c, d, a, b, in[15] + 0FFFFFFFFD8A1E681H, 14); + STEP2(b, c, d, a, in[4] + 0FFFFFFFFE7D3FBC8H, 20); + STEP2(a, b, c, d, in[9] + 00000000021E1CDE6H, 5); + STEP2(d, a, b, c, in[14] + 0FFFFFFFFC33707D6H, 9); + STEP2(c, d, a, b, in[3] + 0FFFFFFFFF4D50D87H, 14); + STEP2(b, c, d, a, in[8] + 000000000455A14EDH, 20); + STEP2(a, b, c, d, in[13] + 0FFFFFFFFA9E3E905H, 5); + STEP2(d, a, b, c, in[2] + 0FFFFFFFFFCEFA3F8H, 9); + STEP2(c, d, a, b, in[7] + 000000000676F02D9H, 14); + STEP2(b, c, d, a, in[12] + 0FFFFFFFF8D2A4C8AH, 20); - STEP3(a, b, c, d, in[5]+0FFFA3942H, 4); - STEP3(d, a, b, c, in[8]+08771F681H, 11); - STEP3(c, d, a, b, in[11]+06D9D6122H, 16); - STEP3(b, c, d, a, in[14]+0FDE5380CH, 23); - STEP3(a, b, c, d, in[1]+0A4BEEA44H, 4); - STEP3(d, a, b, c, in[4]+04BDECFA9H, 11); - STEP3(c, d, a, b, in[7]+0F6BB4B60H, 16); - STEP3(b, c, d, a, in[10]+0BEBFBC70H, 23); - STEP3(a, b, c, d, in[13]+0289B7EC6H, 4); - STEP3(d, a, b, c, in[0]+0EAA127FAH, 11); - STEP3(c, d, a, b, in[3]+0D4EF3085H, 16); - STEP3(b, c, d, a, in[6]+04881D05H, 23); - STEP3(a, b, c, d, in[9]+0D9D4D039H, 4); - STEP3(d, a, b, c, in[12]+0E6DB99E5H, 11); - STEP3(c, d, a, b, in[15]+01FA27CF8H, 16); - STEP3(b, c, d, a, in[2]+0C4AC5665H, 23); + STEP3(a, b, c, d, in[5] + 0FFFFFFFFFFFA3942H, 4); + STEP3(d, a, b, c, in[8] + 0FFFFFFFF8771F681H, 11); + STEP3(c, d, a, b, in[11] + 0000000006D9D6122H, 16); + STEP3(b, c, d, a, in[14] + 0FFFFFFFFFDE5380CH, 23); + STEP3(a, b, c, d, in[1] + 0FFFFFFFFA4BEEA44H, 4); + STEP3(d, a, b, c, in[4] + 0000000004BDECFA9H, 11); + STEP3(c, d, a, b, in[7] + 0FFFFFFFFF6BB4B60H, 16); + STEP3(b, c, d, a, in[10] + 0FFFFFFFFBEBFBC70H, 23); + STEP3(a, b, c, d, in[13] + 000000000289B7EC6H, 4); + STEP3(d, a, b, c, in[0] + 0FFFFFFFFEAA127FAH, 11); + STEP3(c, d, a, b, in[3] + 0FFFFFFFFD4EF3085H, 16); + STEP3(b, c, d, a, in[6] + 00000000004881D05H, 23); + STEP3(a, b, c, d, in[9] + 0FFFFFFFFD9D4D039H, 4); + STEP3(d, a, b, c, in[12] + 0FFFFFFFFE6DB99E5H, 11); + STEP3(c, d, a, b, in[15] + 0000000001FA27CF8H, 16); + STEP3(b, c, d, a, in[2] + 0FFFFFFFFC4AC5665H, 23); - STEP4(a, b, c, d, in[0]+0F4292244H, 6); - STEP4(d, a, b, c, in[7]+0432AFF97H, 10); - STEP4(c, d, a, b, in[14]+0AB9423A7H, 15); - STEP4(b, c, d, a, in[5]+0FC93A039H, 21); - STEP4(a, b, c, d, in[12]+0655B59C3H, 6); - STEP4(d, a, b, c, in[3]+08F0CCC92H, 10); - STEP4(c, d, a, b, in[10]+0FFEFF47DH, 15); - STEP4(b, c, d, a, in[1]+085845DD1H, 21); - STEP4(a, b, c, d, in[8]+06FA87E4FH, 6); - STEP4(d, a, b, c, in[15]+0FE2CE6E0H, 10); - STEP4(c, d, a, b, in[6]+0A3014314H, 15); - STEP4(b, c, d, a, in[13]+04E0811A1H, 21); - STEP4(a, b, c, d, in[4]+0F7537E82H, 6); - STEP4(d, a, b, c, in[11]+ 0BD3AF235H, 10); - STEP4(c, d, a, b, in[2]+02AD7D2BBH, 15); - STEP4(b, c, d, a, in[9]+0EB86D391H, 21); + STEP4(a, b, c, d, in[0] + 0FFFFFFFFF4292244H, 6); + STEP4(d, a, b, c, in[7] + 000000000432AFF97H, 10); + STEP4(c, d, a, b, in[14] + 0FFFFFFFFAB9423A7H, 15); + STEP4(b, c, d, a, in[5] + 0FFFFFFFFFC93A039H, 21); + STEP4(a, b, c, d, in[12] + 000000000655B59C3H, 6); + STEP4(d, a, b, c, in[3] + 0FFFFFFFF8F0CCC92H, 10); + STEP4(c, d, a, b, in[10] + 0FFFFFFFFFFEFF47DH, 15); + STEP4(b, c, d, a, in[1] + 0FFFFFFFF85845DD1H, 21); + STEP4(a, b, c, d, in[8] + 0000000006FA87E4FH, 6); + STEP4(d, a, b, c, in[15] + 0FFFFFFFFFE2CE6E0H, 10); + STEP4(c, d, a, b, in[6] + 0FFFFFFFFA3014314H, 15); + STEP4(b, c, d, a, in[13] + 0000000004E0811A1H, 21); + STEP4(a, b, c, d, in[4] + 0FFFFFFFFF7537E82H, 6); + STEP4(d, a, b, c, in[11] + 0FFFFFFFFBD3AF235H, 10); + STEP4(c, d, a, b, in[2] + 0000000002AD7D2BBH, 15); + STEP4(b, c, d, a, in[9] + 0FFFFFFFFEB86D391H, 21); INC(buf[0], a); INC(buf[1], b); INC(buf[2], c); INC(buf[3], d) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 9613b179..5a45ccfe 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -14 Sep 2016 13:59:08 +20 Sep 2016 16:42:29 diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 008180cb..faacf33f 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -335,7 +335,7 @@ misc: s3: @printf "\nMaking s3 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod From 0ea077814f5e67422d2ee106e2aa0f25d75b978e Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 20 Sep 2016 17:51:14 +0100 Subject: [PATCH 041/140] More LONGINT changes to INT64. Hopefully fixes android and pi builds. --- bootstrap/unix-44/OPB.c | 20 ++++++++++---------- bootstrap/unix-44/OPM.c | 20 ++++++++++---------- bootstrap/unix-44/OPM.h | 6 +++--- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-48/OPB.c | 20 ++++++++++---------- bootstrap/unix-48/OPM.c | 20 ++++++++++---------- bootstrap/unix-48/OPM.h | 6 +++--- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-88/OPB.c | 6 +++--- bootstrap/windows-48/OPB.c | 20 ++++++++++---------- bootstrap/windows-48/OPM.c | 20 ++++++++++---------- bootstrap/windows-48/OPM.h | 6 +++--- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-88/OPB.c | 6 +++--- makefile | 19 +++++++++++++++++++ src/compiler/OPB.Mod | 22 +++++++++++----------- src/compiler/OPM.cmdln.Mod | 8 ++++---- src/tools/make/vishap.make | 2 +- 18 files changed, 113 insertions(+), 94 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d94f4b29..bd641a09 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int64 OPB_BoolToInt (BOOLEAN b); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int64 OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - int64 _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 13c64396..3ec5dfc2 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -931,7 +931,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) if (f == 4) { xv = xval->intval; yv = yval->intval; - if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { + if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { xval->intval = xv * yv; OPB_SetIntType(x); } else { @@ -1008,8 +1008,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 6: if (f == 4) { - temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); - if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { + temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); + if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; OPB_SetIntType(x); } else { @@ -1031,7 +1031,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) break; case 7: if (f == 4) { - if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { + if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); } else { @@ -1133,7 +1133,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; - if (r < -2.14748364800000e+009 || r > 2.14748364700000e+009) { + if (r < -9.22337203685478e+018 || r > 9.22337203685478e+018) { OPB_err(203); r = (LONGREAL)1; } @@ -2126,7 +2126,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if (p->typ->comp == 3) { if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } } else { @@ -2264,7 +2264,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) } else if (p->typ->comp != 3) { OPB_err(64); } else if (f == 4) { - if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > (int64)OPM_MaxIndex))) { + if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } node = p->right; diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 558dde61..775776f4 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -20,7 +20,7 @@ typedef static CHAR OPM_SourceFileName[256]; export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -export int32 OPM_MaxIndex; +export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; export int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -72,8 +72,8 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int32 OPM_SignedMaximum (int32 bytecount); -export int32 OPM_SignedMinimum (int32 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); @@ -665,19 +665,19 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int32 OPM_SignedMaximum (int32 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { - int32 _o_result; - int32 result; + int64 _o_result; + int64 result; result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 32); + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); _o_result = result - 1; return _o_result; } -int32 OPM_SignedMinimum (int32 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { - int32 _o_result; + int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; return _o_result; } @@ -871,7 +871,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == (int64)OPM_SignedMinimum(OPM_IntSize) || i == (int64)OPM_SignedMinimum(OPM_LIntSize)) || i == (int64)OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index c5298326..9d7661c6 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -7,7 +7,7 @@ import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; -import int32 OPM_MaxIndex; +import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; import int32 OPM_curpos, OPM_errpos, OPM_breakpc; @@ -40,8 +40,8 @@ import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int32 OPM_SignedMaximum (int32 bytecount); -import int32 OPM_SignedMinimum (int32 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5351781f..86101b2b 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -275,7 +275,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) OPP_ConstExpression(&x); if (x->typ->form == 4) { n = x->conval->intval; - if (n <= 0 || n > (int64)OPM_MaxIndex) { + if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); n = 1; } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d94f4b29..bd641a09 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -17,7 +17,7 @@ static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int64 OPB_BoolToInt (BOOLEAN b); +static int32 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int64 OPB_BoolToInt (BOOLEAN b) +static int32 OPB_BoolToInt (BOOLEAN b) { - int64 _o_result; + int32 _o_result; if (b) { _o_result = 1; return _o_result; diff --git a/makefile b/makefile index ade812e7..7f335f34 100644 --- a/makefile +++ b/makefile @@ -157,6 +157,25 @@ full: configuration @make -f src/tools/make/vishap.make -s showpath +# short - like make full, but omitting most libraries +# Convenient for testing changes to the compilersource but not a shippable result +short: configuration + @make -f src/tools/make/vishap.make -s installable + @-make -f src/tools/make/vishap.make -s uninstall + @make -f src/tools/make/vishap.make -s clean +# Make bootstrap compiler from source suitable for current data model + @printf "\n\n--- Compiler build started ---\n\n" + @make -f src/tools/make/vishap.make -s compilerfromsavedsource +# Use bootstrap compiler to make compiler binary from latest compiler sources + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble +# Use latest compiler to make compiler binary from latest compiler sources + @make -f src/tools/make/vishap.make -s translate + @make -f src/tools/make/vishap.make -s assemble + @printf "\n\n--- Compiler build successfull ---\n\n" + @make -f src/tools/make/vishap.make -s v4 + @make -f src/tools/make/vishap.make -s misc + assemble: @make -f src/tools/make/vishap.make -s assemble diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 79c81b1c..0d840821 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -52,7 +52,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) last := y END Link; - PROCEDURE BoolToInt(b: BOOLEAN): LONGINT; + PROCEDURE BoolToInt(b: BOOLEAN): INTEGER; BEGIN IF b THEN RETURN 1 ELSE RETURN 0 END END BoolToInt; @@ -484,10 +484,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE op OF |OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval; IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) - (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR - (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR - (xv < 0) & (yv > 0) & (xv >= MIN(LONGINT) DIV yv) OR - (xv < 0) & (yv < 0) & (xv # MIN(LONGINT)) & (yv # MIN(LONGINT)) & (-xv <= MAX(LONGINT) DIV (-yv)) THEN + (xv > 0) & (yv > 0) & (yv <= MAX(SYSTEM.INT64) DIV xv) OR + (xv > 0) & (yv < 0) & (yv >= MIN(SYSTEM.INT64) DIV xv) OR + (xv < 0) & (yv > 0) & (xv >= MIN(SYSTEM.INT64) DIV yv) OR + (xv < 0) & (yv < 0) & (xv # MIN(SYSTEM.INT64)) & (yv # MIN(SYSTEM.INT64)) & (-xv <= MAX(SYSTEM.INT64) DIV (-yv)) THEN xval^.intval := xv * yv; SetIntType(x) ELSE err(204) END @@ -536,8 +536,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(94) END |OPS.plus: IF f = OPT.Int THEN - temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); - IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN + temp := (yval^.intval >= 0) & (xval^.intval <= MAX(SYSTEM.INT64) - yval^.intval); + IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(SYSTEM.INT64) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(206) END @@ -552,8 +552,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF f # OPT.Undef THEN err(105) END |OPS.minus: IF f = OPT.Int THEN - IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR - (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN + IF (yval^.intval >= 0) & (xval^.intval >= MIN(SYSTEM.INT64) + yval^.intval) OR + (yval^.intval < 0) & (xval^.intval <= MAX(SYSTEM.INT64) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) ELSE err(207) END @@ -605,9 +605,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF f IN OPT.realSet THEN IF g IN OPT.realSet THEN CheckRealType(g, 203, x^.conval) - ELSE (*g = OPT.LInt*) + ELSE (* g = OPT.Int *) r := x^.conval^.realval; - IF (r < MIN(LONGINT)) OR (r > MAX(LONGINT)) THEN err(203); r := 1 END ; + IF (r < MIN(SYSTEM.INT64)) OR (r > MAX(SYSTEM.INT64)) THEN err(203); r := 1 END ; x^.conval^.intval := ENTIER(r); SetIntType(x) END ELSE (* (f IN {OPT.Char, OPT.Byte}) & (g IN {OPT.Byte} + OPT.intSet) OR (f = OPT.Undef) *) diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b497829f..b70b8474 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -94,7 +94,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, MaxSet*: INTEGER; - MaxIndex*: LONGINT; + MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -557,15 +557,15 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Integer size support *) - PROCEDURE SignedMaximum*(bytecount: LONGINT): LONGINT; - VAR result: LONGINT; + PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; + VAR result: SYSTEM.INT64; BEGIN result := 1; result := SYSTEM.LSH(result, bytecount*8-1); RETURN result - 1; END SignedMaximum; - PROCEDURE SignedMinimum*(bytecount: LONGINT): LONGINT; + PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; BEGIN RETURN -SignedMaximum(bytecount) - 1 END SignedMinimum; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index faacf33f..5b854fa2 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -225,7 +225,7 @@ TODO: Comment disabled lines contain use of VAL that reads beyond source variabl ooc: @printf "\nMaking ooc library\n" cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod # cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod From 20a97bb570e84520e33c84bcadddbcb8a6df6c63 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Sep 2016 11:56:21 +0100 Subject: [PATCH 042/140] Add check that double and long long (both 64 bit) have same alignment. --- src/library/ooc/oocLowLReal.Mod | 164 ++++++++++++++++---------------- src/tools/make/configure.c | 1 + 2 files changed, 84 insertions(+), 81 deletions(-) diff --git a/src/library/ooc/oocLowLReal.Mod b/src/library/ooc/oocLowLReal.Mod index 0a15f6dd..e28e13cf 100644 --- a/src/library/ooc/oocLowLReal.Mod +++ b/src/library/ooc/oocLowLReal.Mod @@ -1,21 +1,23 @@ (* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) MODULE oocLowLReal; +(* ToDo. support 64 bit builds *) + (* - LowLReal - Gives access to the underlying properties of the type LONGREAL - for IEEE double-precision numbers. + LowLReal - Gives access to the underlying properties of the type LONGREAL + for IEEE double-precision numbers. Copyright (C) 1996 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -26,7 +28,7 @@ MODULE oocLowLReal; IMPORT Low := oocLowReal, S := SYSTEM; (* - + Real number properties are defined as follows: radix--The whole number value of the radix used to represent the @@ -44,50 +46,50 @@ IMPORT Low := oocLowReal, S := SYSTEM; small--The smallest positive value of the corresponding real number type, represented to maximal precision. - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 + IEC559--A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 (IEEE 754:1987) in all regards. NOTES 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 + 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 + 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 is used for the type REAL. - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and + LIA1--A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967-1:199x + (LIA-1) in all regards: parameters, arithmetic, exceptions, and notification. - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number + rounds--A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number type nearest to the mathematical result. - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. + gUnderflow--A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. - exception--A Boolean value that is TRUE if and only if every operation that + exception--A Boolean value that is TRUE if and only if every operation that attempts to produce a real value out of range raises an exception. - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than + extend--A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than the stored values. - nModes--The whole number value giving the number of bit positions needed for + nModes--The whole number value giving the number of bit positions needed for the status flags for mode control. - + *) CONST radix*= 2; - places*= 53; - expoMax*= 1023; + places*= 53; + expoMax*= 1023; expoMin*= 1-expoMax; large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) (*small*= 2.2250738585072014D-308;*) small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); - IEC559*= TRUE; + IEC559*= TRUE; LIA1*= FALSE; rounds*= FALSE; gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) @@ -97,23 +99,23 @@ CONST ONE=1.0D0; (* some commonly-used constants *) ZERO=0.0D0; TEN=1.0D1; - + DEBUG = TRUE; - expOffset=expoMax; - hiBit=19; + expOffset=expoMax; + hiBit=19; expBit=hiBit+1; nMask={0..hiBit,31}; (* number mask *) expMask={expBit..30}; (* exponent mask *) - + TYPE Modes*= SET; LongInt=ARRAY 2 OF LONGINT; - LongSet=ARRAY 2 OF SET; - + LongSet=ARRAY 2 OF SET; + VAR (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - isBigEndian-: BOOLEAN; (* set when target is big endian *) + isBigEndian-: BOOLEAN; (* set when target is big endian *) (* PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) VAR k : INTEGER; @@ -139,7 +141,7 @@ END err; PROCEDURE ClearError*; BEGIN Low.ClearError -END ClearError; +END ClearError; PROCEDURE ErrorHandler*(err: INTEGER); BEGIN @@ -185,26 +187,26 @@ BEGIN RETURN x END ToReal; (*<* POP *> *) - + PROCEDURE exponent*(x: LONGREAL): INTEGER; -(* +(* The value of the call exponent(x) shall be the exponent value of `x' that lies between `expoMin' and `expoMax'. An exception shall occur and may be raised if `x' is equal to 0.0. - *) + *) VAR ra: LongInt; BEGIN (* NOTE: x=0.0 should raise exception *) IF x=ZERO THEN RETURN 0 - ELSE Move(x, ra); - RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset + ELSE Move(x, ra); + RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset END END exponent; PROCEDURE exponent10*(x: LONGREAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is +(* + The value of the call exponent10(x) shall be the base 10 exponent + value of `x'. An exception shall occur and may be raised if `x' is equal to 0.0. *) VAR exp: INTEGER; @@ -215,19 +217,19 @@ BEGIN WHILE x<1 DO x:=x*TEN; DEC(exp) END; RETURN exp END exponent10; - + PROCEDURE fraction*(x: LONGREAL): LONGREAL; (* The value of the call fraction(x) shall be the significand (or significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). + hold: x = scale(fraction(x), exponent(x)). *) CONST eZero={(hiBit+2)..29}; VAR ra: LongInt; BEGIN - IF x=ZERO THEN RETURN ZERO + IF x=ZERO THEN RETURN ZERO ELSE Move(x, ra); - ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); + ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); RETURN Real(ra)*2.0D0 END END fraction; @@ -246,13 +248,13 @@ PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; BEGIN MoveSet(real, ra); RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) -END IsNaN; +END IsNaN; PROCEDURE sign*(x: LONGREAL): LONGREAL; (* The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. + -1.0 if `x' is equal to 0.0. *) BEGIN IF x Date: Wed, 21 Sep 2016 14:28:53 +0100 Subject: [PATCH 043/140] Simplify parameterisable memory model variables. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 6 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 85 ++++++++++----------------- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 28 ++++----- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 17 +++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 22 ++----- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 6 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 85 ++++++++++----------------- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 28 ++++----- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 17 +++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 22 ++----- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 6 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 85 ++++++++++----------------- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 28 ++++----- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 17 +++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 22 ++----- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 6 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 85 ++++++++++----------------- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 28 ++++----- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 17 +++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 22 ++----- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 6 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 85 ++++++++++----------------- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 28 ++++----- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 17 +++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 22 ++----- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPC.Mod | 4 +- src/compiler/OPM.cmdln.Mod | 86 +++++++++++++++------------- src/compiler/OPT.Mod | 53 ++++++++--------- src/compiler/OPV.Mod | 22 +++---- src/compiler/Vishap.Mod | 21 ++----- 201 files changed, 607 insertions(+), 763 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a18e6768..693eb714 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 0339cbdb..faa47731 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 6d3f7c1e..e0fc1bc4 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index a3acbd98..dea5d7a8 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 32971286..3a826a34 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 2dfc3018..17077aa8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 10d2ba41..a42034f5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 57c87f55..99b78a56 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index dea88004..7e051e81 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 7ace9c7c..efed2605 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 2040560d..64f39a5b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 55230bcc..e2180e5d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d5e89ca2..6a8cce4b 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 4ea29c15..6db18d8a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 6409cfb5..94c1e086 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 8f5a2a2a..b18bf88a 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d55dffcd..0c320187 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8b2d7bab..febb2814 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 08a21c58..63b8e488 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 65b6b0b1..d150f1cf 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index f61acc40..a74b13a3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6841c244..d570a488 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3ec5dfc2..a4070347 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a57ace75..a39fd352 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9923ccbc..f3b40759 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 83153512..1ac87c2d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 775776f4..e5b7fc83 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int16 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1073,15 +1054,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 9d7661c6..1835a2b8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 86101b2b..f62551cc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 67bca013..f04f47ad 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3f106d0c..3ff9b0b3 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c1bc93b1..acdca9f2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1916,9 +1917,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1938,11 +1939,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index fd0a538e..9ee5643f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ffe3eb71..2146d7c2 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - __ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 35849e85..89bc758a 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 84dc9bd1..9a1147dc 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 6982b582..c032a4a5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e79f35d7..b4469c3a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b2d5f19a..db9dbf02 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ea987a3e..9d2d3b44 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f277a856..5ae009bd 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b2a965f8..299cfde9 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 2d0b9dee..c3405c16 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2bdf2af6..2e61c724 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5245f35d..8838dd7b 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 4d312413..5d050112 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1ecf99b1..11aabb2a 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a5c4087d..9db9e691 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6b8f5d99..831281d6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index a18275f8..b0a79723 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index a1322efe..be8ab870 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ead58244..de0e2164 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 94cf47a0..f0ec05c1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 02dc0bbd..68a02b24 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index aa22df29..04b1a4f9 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 60382d3c..0e60d59f 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4ef50204..5fec9a72 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bd641a09..fedc1751 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); x->typ = OPT_linttyp; } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 1330baf1..72ea3c62 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index b33dc59f..2c8127e1 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); OPC_EndStat(); } @@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) if (OPC_ansi) { OPM_WriteInt(array->n); } else { - OPC_IntLiteral(array->n, OPM_PointerSize); + OPC_IntLiteral(array->n, OPM_AddressSize); } } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e749f6b6..30f3fd48 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 39c62389..391613fb 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; OPM_Alignment = s[__X(i, s__len)] - 48; } - __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); - __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); + __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); + __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); + if (OPM_IntegerSize == 2) { + OPM_LongintSize = 4; + OPM_SetSize = 4; + } else { + OPM_LongintSize = 8; + OPM_SetSize = 8; + } Files_SetSearchPath((CHAR*)"", 1); break; case 'F': @@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j) static void OPM_VerboseListSizes (void) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size Alignement", 29); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"CHAR ", 14); - OPM_LogWNum(OPM_CharSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"BOOLEAN ", 14); - OPM_LogWNum(OPM_BoolSize, 4); + OPM_LogWStr((CHAR*)"Type Size", 17); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_SIntSize, 4); + OPM_LogWNum(OPM_ShortintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntSize, 4); + OPM_LogWNum(OPM_IntegerSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LIntSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWNum(OPM_SetSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"REAL ", 14); - OPM_LogWNum(OPM_RealSize, 4); + OPM_LogWStr((CHAR*)"ADDRESS ", 14); + OPM_LogWNum(OPM_AddressSize, 4); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGREAL ", 14); - OPM_LogWNum(OPM_LRealSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PTR ", 14); - OPM_LogWNum(OPM_PointerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROC ", 14); - OPM_LogWNum(OPM_ProcSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"RECORD ", 14); - OPM_LogWNum(OPM_RecSize, 4); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); OPM_LogWLn(); } @@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount) static void OPM_GetProperties (void) { - OPM_ProcSize = OPM_PointerSize; - OPM_LIntSize = __ASHL(OPM_IntSize, 1); - OPM_SetSize = OPM_LIntSize; - if (OPM_RealSize == 4) { - OPM_MaxReal = 3.40282346000000e+038; - } else if (OPM_RealSize == 8) { - OPM_MaxReal = 1.79769296342094e+308; - } - if (OPM_LRealSize == 4) { - OPM_MaxLReal = 3.40282346000000e+038; - } else if (OPM_LRealSize == 8) { - OPM_MaxLReal = 1.79769296342094e+308; - } + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); if (OPM_Verbose) { OPM_VerboseListSizes(); } @@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i) { CHAR s[24]; int64 i1, k; - if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { + if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); OPM_WriteString((CHAR*)"-1)", 4); @@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) CHAR s[32]; CHAR ch; int32 i; - if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { @@ -1070,15 +1051,11 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_CharSize = 1; - OPM_BoolSize = 1; - OPM_SIntSize = 1; - OPM_RecSize = 1; - OPM_ByteSize = 1; - OPM_RealSize = 4; - OPM_LRealSize = 8; - OPM_PointerSize = 8; + OPM_AddressSize = 8; OPM_Alignment = 8; - OPM_IntSize = 4; + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 908a80ad..4a9253cf 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; +import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8573d6b1..ff86118c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7cbdb873..9ae7712a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a92e1feb..c811b3cc 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d7c08330..1c9ae6a4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6928030e..5fbe3b87 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -88,7 +88,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; @@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ) switch (tag) { case 36: (*typ)->form = 11; - (*typ)->size = OPM_PointerSize; + (*typ)->size = OPM_AddressSize; (*typ)->n = 0; OPT_InStruct(&(*typ)->BaseTyp); break; @@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ) break; case 40: (*typ)->form = 12; - (*typ)->size = OPM_ProcSize; + (*typ)->size = OPM_AddressSize; OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); break; default: @@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; - (*typ)->size = OPM_ByteSize; + (*typ)->size = 1; (*typ)->allocated = 1; (*typ)->strobj = OPT_NewObj(); (*typ)->pbfp = form; @@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); + P(OPT_hinttyp); P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); @@ -1915,9 +1916,9 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_niltyp, 9); - OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); - OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); + OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp); + OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); @@ -1937,11 +1938,12 @@ export void *OPT__init(void) OPT_syslink = OPT_topScope->right; OPT_universe = OPT_topScope; OPT_topScope->right = NIL; - OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); - OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); - OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); + OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); + OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); + OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); + OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); + OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index abb49dda..66686a2c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 48080e50..965f7b61 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ) btyp = typ->BaseTyp; if (btyp == NIL) { offset = 0; - base = OPC_SizeAlignment(OPM_RecSize); + base = 1; } else { OPV_TypSize(btyp); offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); @@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ) OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; } else if (f == 11) { - typ->size = OPM_PointerSize; + typ->size = OPM_AddressSize; if (typ->BaseTyp == OPT_undftyp) { OPM_Mark(128, typ->n); } else { OPV_TypSize(typ->BaseTyp); } } else if (f == 12) { - typ->size = OPM_ProcSize; + typ->size = OPM_AddressSize; } else if (c == 3) { btyp = typ->BaseTyp; OPV_TypSize(btyp); @@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; @@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } else if (comp == 3) { if (n->class == 7) { OPM_WriteString((CHAR*)", ", 3); - OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); + OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize); } else { aptyp = n->typ; dim = 0; @@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) dim += 1; aptyp = aptyp->BaseTyp; } - OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); + OPV_ParIntLiteral(aptyp->size, OPM_AddressSize); } } } @@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); if (typ->comp == 3) { if (x->class == 7) { - OPC_IntLiteral(x->conval->intval, OPM_PointerSize); + OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); @@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) } x = x->link; } else { - OPC_IntLiteral(typ->n, OPM_PointerSize); + OPC_IntLiteral(typ->n, OPM_AddressSize); } typ = typ->BaseTyp; } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 33c1eeeb..f78267d0 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a576c90e..0093f826 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7832ec0f..7faaa2a6 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e81db820..e9e84723 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index dec142cf..116d9c93 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 6aa3846a..8dc35935 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index d1c9f056..0487b70c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 37fac00b..54254c51 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 0f195ce8..40d02918 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 00f0ac1a..7cd188f2 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done) static void Vishap_PropagateElementaryTypeSizes (void) { - OPT_bytetyp->size = OPM_ByteSize; - OPT_sysptrtyp->size = OPM_PointerSize; - OPT_chartyp->size = OPM_CharSize; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; OPT_settyp->size = OPM_SetSize; - OPT_realtyp->size = OPM_RealSize; - OPT_adrtyp->size = OPM_PointerSize; - OPT_lrltyp->size = OPM_LRealSize; - OPT_booltyp->size = OPM_BoolSize; - OPT_sinttyp = OPT_int8typ; - if (OPM_IntSize == 2) { - OPT_inttyp = OPT_int16typ; - OPT_linttyp = OPT_int32typ; - } else { - OPT_inttyp = OPT_int32typ; - OPT_linttyp = OPT_int64typ; - } + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 8396896b..04b9504d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index b3535e92..99f4c6b0 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a4fbedda..2eef1f18 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 414a05f0..d4f0c474 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 04503b55..3b56b4b1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c27f0ae1..b574976e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 0d840821..6fc81fe1 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1053,7 +1053,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1230,7 +1230,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 9febea62..bc84b8ad 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -552,7 +552,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN OPM.WriteStringVar(typ^.strobj^.name) END ; OPM.Write(DoubleQuote); Str1(', #), {', typ^.size); - nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.PointerSize); + nofptrs := 0; PutPtrOffsets(typ, 0, nofptrs); Str1("#}}", -(nofptrs + 1) * OPM.AddressSize); EndStat END TDescDecl; @@ -1303,7 +1303,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; - IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.PointerSize) END + IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.AddressSize) END END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b70b8474..952ea9e5 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -88,10 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - Alignment*: INTEGER; + (* Parameter selectable sizes *) + Alignment*, + AddressSize*, SetSize*, + ShortintSize*, IntegerSize*, LongintSize*: INTEGER; - ByteSize*, CharSize*, BoolSize*, SIntSize*, IntSize*, - LIntSize*, SetSize*, RealSize*, LRealSize*, PointerSize*, ProcSize*, RecSize*, MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -161,13 +162,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "t": opt := opt / {typchk} | "x": opt := opt / {inxchk} - | "B": IF s[i+1] # 0X THEN INC(i); IntSize := ORD(s[i]) - ORD('0') END; - IF s[i+1] # 0X THEN INC(i); PointerSize := ORD(s[i]) - ORD('0') END; + | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; + IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; - ASSERT((IntSize = 2) OR (IntSize = 4)); - ASSERT((PointerSize = 4) OR (PointerSize = 8)); + ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); + ASSERT((AddressSize = 4) OR (AddressSize = 8)); ASSERT((Alignment = 4) OR (Alignment = 8)); + IF IntegerSize = 2 THEN + LongintSize := 4; + SetSize := 4; + ELSE + LongintSize := 8; + SetSize := 8; + END; Files.SetSearchPath("") + | "F": opt := opt / {forcenewsym} | "M": opt := opt / {mainlinkstat} | "S": opt := opt / {dontasm} @@ -529,20 +538,24 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE VerboseListSizes; BEGIN LogWLn; - LogWStr("Type Size Alignement"); LogWLn; + (*LogWStr("Type Size Alignement"); LogWLn;*) + LogWStr("Type Size"); LogWLn; + (* LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; - LogWStr("SHORTINT "); LogWNum(SIntSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LIntSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; - LogWStr("PTR "); LogWNum(PointerSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; - (*LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn;*) + LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; + LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn; + *) + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; (* LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; @@ -582,25 +595,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) the module startup code, and maybe overridden by the -Bnnn bootstrap parameter *) - (* Derived sizes *) - ProcSize := PointerSize; - LIntSize := IntSize * 2; - SetSize := LIntSize; - - IF RealSize = 4 THEN MaxReal := 3.40282346D38 - ELSIF RealSize = 8 THEN MaxReal := 1.7976931348623157D307 * 9.999999 + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) (*should be 1.7976931348623157D308 *) - END ; - - IF LRealSize = 4 THEN MaxLReal := 3.40282346D38 - ELSIF LRealSize = 8 THEN MaxLReal := 1.7976931348623157D307 * 9.999999 - (*should be 1.7976931348623157D308 *) - END ; MinReal := -MaxReal; MinLReal := -MaxLReal; MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(PointerSize); + MaxIndex := SignedMaximum(AddressSize); IF Verbose THEN VerboseListSizes END; END GetProperties; @@ -734,9 +736,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE WriteInt* (i: SYSTEM.INT64); VAR s: ARRAY 24 OF CHAR; i1, k: SYSTEM.INT64; BEGIN - IF (i = SignedMinimum(IntSize)) - OR (i = SignedMinimum(LIntSize)) - OR (i = SignedMinimum(8)) THEN + IF (i = SignedMinimum(2)) OR (i = SignedMinimum(4)) OR (i = SignedMinimum(8)) THEN (* abs(minint) is one more than maxint, causing problems representing the value as a minus sign followed by absoute value. Therefore represent as -maxint - 1. For INTEGER this avoids a compiler warning 'this decimal constant is unsigned only in ISO C90', for LONGINT it is the @@ -754,7 +754,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR W: Texts.Writer; T: Texts.Text; R: Texts.Reader; s: ARRAY 32 OF CHAR; ch: CHAR; i: INTEGER; BEGIN (*should be improved *) - IF (r < SignedMaximum(LIntSize)) & (r > SignedMinimum(LIntSize)) & (r = ENTIER(r)) THEN + IF (r < SignedMaximum(LongintSize)) & (r > SignedMinimum(LongintSize)) & (r = ENTIER(r)) THEN IF suffx = "f" THEN WriteString("(REAL)") ELSE WriteString("(LONGREAL)") END ; WriteInt(ENTIER(r)) ELSE @@ -839,13 +839,19 @@ BEGIN Files.SetSearchPath(OBERON); - (* Fixed type sizes *) - CharSize := 1; BoolSize := 1; SIntSize := 1; RecSize := 1; ByteSize := 1; - RealSize := 4; LRealSize := 8; - (* type sizes with configuration based defaults *) - PointerSize := Configuration.addressSize; - Alignment := Configuration.alignment; - IntSize := Configuration.intsize; + AddressSize := Configuration.addressSize; + Alignment := Configuration.alignment; + ShortintSize := 1; + + IF Configuration.intsize = 2 THEN + IntegerSize := 2; + LongintSize := 4; + SetSize := 4; + ELSE + IntegerSize := 4; + LongintSize := 8; + SetSize := 8; + END; END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 7d67c2b5..6793a233 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -154,7 +154,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, - sinttyp*, inttyp*, linttyp*, + sinttyp*, inttyp*, linttyp*, hinttyp*, adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, @@ -762,7 +762,7 @@ BEGIN tag := OPM.SymRInt(); IF tag = Ssys THEN typ^.sysflag := SHORT(OPM.SymRInt()); tag := OPM.SymRInt() END; CASE tag OF - | Sptr: typ^.form := Pointer; typ^.size := OPM.PointerSize; + | Sptr: typ^.form := Pointer; typ^.size := OPM.AddressSize; typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: typ^.form := Comp; typ^.comp := Array; InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); @@ -796,7 +796,7 @@ BEGIN InsertImport(fld, typ^.link, dummy); impCtxt.nextTag := OPM.SymRInt() END - | Spro: typ^.form := ProcTyp; typ^.size := OPM.ProcSize; + | Spro: typ^.form := ProcTyp; typ^.size := OPM.AddressSize; InSign(mno, typ^.BaseTyp, typ^.link) ELSE OPM.LogWStr("unhandled case at InStruct, tag = "); OPM.LogWNum(tag, 0); OPM.LogWLn; END; @@ -1163,7 +1163,7 @@ END Import; PROCEDURE InitStruct(VAR typ: Struct; form: SHORTINT); BEGIN - typ := NewStr(form, Basic); typ^.ref := form; typ^.size := OPM.ByteSize; typ^.allocated := TRUE; + typ := NewStr(form, Basic); typ^.ref := form; typ^.size := 1; typ^.allocated := TRUE; typ^.strobj := NewObj(); typ^.pbfp := form; typ^.pvfp := form; typ^.fpdone := TRUE; typ^.idfp := form; typ^.idfpdone := TRUE END InitStruct; @@ -1207,36 +1207,37 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); - EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("BYTE", Byte, 1, bytetyp); + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); - EnterProc("ADR", adrfn); - EnterProc("CC", ccfn); - EnterProc("LSH", lshfn); - EnterProc("ROT", rotfn); - EnterProc("GET", getfn); - EnterProc("PUT", putfn); + EnterProc("ADR", adrfn); + EnterProc("CC", ccfn); + EnterProc("LSH", lshfn); + EnterProc("ROT", rotfn); + EnterProc("GET", getfn); + EnterProc("PUT", putfn); EnterProc("GETREG", getrfn); EnterProc("PUTREG", putrfn); - EnterProc("BIT", bitfn); - EnterProc("VAL", valfn); - EnterProc("NEW", sysnewfn); - EnterProc("MOVE", movefn); + EnterProc("BIT", bitfn); + EnterProc("VAL", valfn); + EnterProc("NEW", sysnewfn); + EnterProc("MOVE", movefn); syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); - EnterTyp("CHAR", Char, OPM.CharSize, chartyp); - EnterTyp("SET", Set, OPM.SetSize, settyp); - EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); + EnterTyp("BOOLEAN", Bool, 1, booltyp); + EnterTyp("CHAR", Char, 1, chartyp); + EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("REAL", Real, 4, realtyp); + EnterTyp("LONGREAL", LReal, 8, lrltyp); + EnterTyp("HUGEINT", Int, 8, hinttyp); EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index d8486ca9..7c7e7464 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -62,7 +62,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSIF typ^.size = -1 THEN f := typ^.form; c := typ^.comp; IF c = OPT.Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := (*OPM.RecAlign*)OPC.SizeAlignment(OPM.RecSize); + IF btyp = NIL THEN offset := 0; base := 1; ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; END; fld := typ^.link; @@ -86,12 +86,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 TypSize(typ^.BaseTyp); typ^.size := typ^.n * typ^.BaseTyp^.size; ELSIF f = OPT.Pointer THEN - typ^.size := OPM.PointerSize; + typ^.size := OPM.AddressSize; IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) ELSE TypSize(typ^.BaseTyp) END ELSIF f = OPT.ProcTyp THEN - typ^.size := OPM.ProcSize; + typ^.size := OPM.AddressSize; ELSIF c = OPT.DynArr THEN btyp := typ^.BaseTyp; TypSize(btyp); IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) @@ -187,21 +187,17 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) Traverse(topScope^.right, topScope, FALSE); (* second pass *) + (* mark basic types as predefined, OPC.Ident can avoid qualification*) OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; - - (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. - OPT.sinttyp^.strobj^.linkadr := PredefinedType; - OPT.inttyp^.strobj^.linkadr := PredefinedType; - OPT.linttyp^.strobj^.linkadr := PredefinedType; - *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; + OPT.hinttyp.strobj.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; @@ -482,7 +478,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); TypeOf(n) ELSIF comp = OPT.DynArr THEN IF n^.class = OPT.Nconst THEN (* ap is string constant *) - OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.PointerSize) + OPM.WriteString(Comma); ParIntLiteral(n.conval.intval2, OPM.AddressSize) ELSE aptyp := n^.typ; dim := 0; WHILE (typ^.comp = OPT.DynArr) & (typ^.BaseTyp^.form # OPT.Byte) DO @@ -495,7 +491,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 Len(n, dim); OPM.WriteString(" * "); INC(dim); aptyp := aptyp^.BaseTyp END ; (*OPM.WriteString("((LONGINT)("); OPM.WriteInt(aptyp^.size); OPM.WriteString("))");*) - ParIntLiteral(aptyp.size, OPM.PointerSize) + ParIntLiteral(aptyp.size, OPM.AddressSize) END END END ; @@ -791,12 +787,12 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString(", "); IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN - OPC.IntLiteral(x.conval.intval, OPM.PointerSize) + OPC.IntLiteral(x.conval.intval, OPM.AddressSize) ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE - OPC.IntLiteral(typ.n, OPM.PointerSize) + OPC.IntLiteral(typ.n, OPM.AddressSize) END ; typ := typ^.BaseTyp END ; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 33481260..c4b06e9c 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -51,23 +51,14 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE PropagateElementaryTypeSizes; BEGIN - OPT.bytetyp.size := OPM.ByteSize; - OPT.sysptrtyp.size := OPM.PointerSize; - OPT.chartyp.size := OPM.CharSize; + OPT.sysptrtyp.size := OPM.AddressSize; + OPT.adrtyp.size := OPM.AddressSize; OPT.settyp.size := OPM.SetSize; - OPT.realtyp.size := OPM.RealSize; - OPT.adrtyp.size := OPM.PointerSize; - OPT.lrltyp.size := OPM.LRealSize; - OPT.booltyp.size := OPM.BoolSize; - OPT.sinttyp := OPT.int8typ; - IF OPM.IntSize = 2 THEN - OPT.inttyp := OPT.int16typ; - OPT.linttyp := OPT.int32typ - ELSE - OPT.inttyp := OPT.int32typ; - OPT.linttyp := OPT.int64typ - END; + OPT.sinttyp := OPT.IntType(OPM.ShortintSize); + OPT.inttyp := OPT.IntType(OPM.IntegerSize); + OPT.linttyp := OPT.IntType(OPM.LongintSize); + OPT.sintobj.typ := OPT.sinttyp; OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp From 76b6a8fc2328d000fe32f99dea380287ec956250 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 21 Sep 2016 18:28:17 +0100 Subject: [PATCH 044/140] Clean option handling and add size model and target machine options. --- bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 6 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 113 ++++----------- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-44/OPM.h | 3 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 7 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 34 ++--- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 20 +-- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 6 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 113 ++++----------- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-48/OPM.h | 3 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 7 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 34 ++--- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 20 +-- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 6 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 113 ++++----------- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 197 ++++++++++++++++++--------- bootstrap/unix-88/OPM.h | 3 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 7 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 34 ++--- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 20 +-- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 6 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 113 ++++----------- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 197 ++++++++++++++++++--------- bootstrap/windows-48/OPM.h | 3 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 7 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 34 ++--- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 20 +-- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 6 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 113 ++++----------- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 197 ++++++++++++++++++--------- bootstrap/windows-88/OPM.h | 3 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 7 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 34 ++--- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 20 +-- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPC.Mod | 76 +++-------- src/compiler/OPM.cmdln.Mod | 125 +++++++++++------ src/compiler/OPT.Mod | 6 +- src/compiler/OPV.Mod | 28 ++-- src/compiler/Vishap.Mod | 18 +-- src/compiler/extTools.Mod | 4 +- 202 files changed, 1178 insertions(+), 1313 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index dea5d7a8..eaa862b2 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3a826a34..6e15e6b7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 17077aa8..960fca06 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 693eb714..147fdc5c 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a42034f5..2f652641 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 99b78a56..adbbe116 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index faa47731..df1eacae 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e0fc1bc4..1702769b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index dea5d7a8..eaa862b2 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3a826a34..6e15e6b7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 17077aa8..960fca06 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index acdca9f2..148fbecb 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a42034f5..2f652641 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 99b78a56..adbbe116 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 5ae009bd..c02becc4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 299cfde9..fbb113f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 9db9e691..122d2b82 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 7e051e81..d489489e 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index be8ab870..255cb17c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index efed2605..1e1dea21 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64f39a5b..08a62623 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 68a02b24..85664851 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 04b1a4f9..b11a81ee 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0e60d59f..24319ad6 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 5fec9a72..4c14134c 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fedc1751..fab97f6a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int32 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 72ea3c62..deb651aa 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 2c8127e1..dd9e2a18 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -11,7 +11,6 @@ static int32 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 64); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 64); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int32 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 64)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 64) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 30f3fd48..ae8e7035 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 391613fb..1b8dca0d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -36,7 +36,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int32 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -137,42 +136,94 @@ int32 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = s[__X(i + 1, s__len)] - 48; + OPM_Alignment = s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -198,18 +249,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -220,6 +259,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -246,33 +286,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -287,9 +356,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -307,20 +376,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 64); - OPM_dontLink = __IN(14, OPM_opt, 64); - OPM_mainProg = __IN(10, OPM_opt, 64); - OPM_mainLinkStat = __IN(15, OPM_opt, 64); - OPM_notColorOutput = __IN(16, OPM_opt, 64); - OPM_forceNewSym = __IN(17, OPM_opt, 64); - OPM_Verbose = __IN(18, OPM_opt, 64); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 64)) { OPM_glbopt |= __SETOF(10,64); + OPM_opt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -406,20 +469,20 @@ static void OPM_LogErrMsg (int32 n) int32 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -492,11 +555,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -679,7 +742,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4a9253cf..e2737249 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ff86118c..e9fcba89 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index c811b3cc..d79e207f 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1c9ae6a4..40853589 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5fbe3b87..63b773cd 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1732,10 +1732,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 66686a2c..0cc86a01 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 965f7b61..8026831f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 64); - OPV_inxchk = __IN(0, OPM_opt, 64); - OPV_mainprog = __IN(10, OPM_opt, 64); - OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int32 prec) static void OPV_ParIntLiteral (int64 n, int64 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 64)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index e2180e5d..99577840 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 6a8cce4b..06414b7c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e9e84723..f2623b03 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 116d9c93..05b31bee 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 8dc35935..4226bdb9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 0487b70c..b13ba079 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 54254c51..4cdaa6b9 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 40d02918..10d0a9bb 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 7cd188f2..e1d112ec 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 64)) { + if (__IN(14, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); } } } diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 04b9504d..ca898552 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 2eef1f18..db3aec30 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 3b56b4b1..ac832261 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b574976e..054f6ddd 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 6db18d8a..c780cc96 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 94c1e086..9c3127a1 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index b18bf88a..c8de3606 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0c320187..80926272 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index febb2814..ade97ac7 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 63b8e488..50823221 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d150f1cf..57904466 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a74b13a3..1c66c8e5 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d570a488..13b6dbed 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index a4070347..c9ebd8f5 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index a39fd352..cdd33f1b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index f3b40759..6b7d1b01 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -11,7 +11,6 @@ static int16 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 32); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 32); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int16 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 32)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1ac87c2d..b398282e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index e5b7fc83..0086ff0f 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -37,7 +37,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -138,42 +137,94 @@ int16 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int16 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -199,18 +250,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -221,6 +260,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -247,33 +287,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -288,9 +357,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -308,20 +377,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 32); - OPM_dontLink = __IN(14, OPM_opt, 32); - OPM_mainProg = __IN(10, OPM_opt, 32); - OPM_mainLinkStat = __IN(15, OPM_opt, 32); - OPM_notColorOutput = __IN(16, OPM_opt, 32); - OPM_forceNewSym = __IN(17, OPM_opt, 32); - OPM_Verbose = __IN(18, OPM_opt, 32); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 32)) { OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -407,20 +470,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -493,11 +556,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -682,7 +745,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 1835a2b8..b32da345 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f62551cc..af0d37db 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f04f47ad..f37bbc27 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 3ff9b0b3..1b60944c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index acdca9f2..148fbecb 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1733,10 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9ee5643f..d999d4ec 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2146d7c2..edb84f81 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int16 OPV_stamp; static int32 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 32); - OPV_inxchk = __IN(0, OPM_opt, 32); - OPV_mainprog = __IN(10, OPM_opt, 32); - OPV_ansi = __IN(6, OPM_opt, 32); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int16 prec) static void OPV_ParIntLiteral (int64 n, int32 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 32) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 89bc758a..12ced558 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 9a1147dc..75f53fa0 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c032a4a5..dec0e0b4 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b4469c3a..0b779857 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index db9dbf02..69612295 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9d2d3b44..b4d5f201 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 5ae009bd..c02becc4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 299cfde9..fbb113f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index c3405c16..17b498b8 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2e61c724..95868540 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8838dd7b..9047ebcc 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 5d050112..a14f3ee0 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 11aabb2a..1402af8c 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 9db9e691..122d2b82 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 831281d6..7fdf5f78 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index b0a79723..6a1cec2c 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index be8ab870..255cb17c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index de0e2164..546f8b08 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f0ec05c1..0aae236a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 68a02b24..85664851 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 04b1a4f9..b11a81ee 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0e60d59f..24319ad6 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 5fec9a72..4c14134c 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fedc1751..fab97f6a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1542,7 +1542,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int32 f, g; OPT_Struct p = NIL, q = NIL; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 72ea3c62..deb651aa 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 2c8127e1..dd9e2a18 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -11,7 +11,6 @@ static int32 OPC_indentLevel; -static BOOLEAN OPC_ptrinit, OPC_mainprog, OPC_ansi; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; @@ -93,14 +92,7 @@ static BOOLEAN OPC_Undefined (OPT_Object obj); void OPC_Init (void) { OPC_indentLevel = 0; - OPC_ptrinit = __IN(5, OPM_opt, 64); - OPC_mainprog = OPM_mainProg || OPM_mainLinkStat; - OPC_ansi = __IN(6, OPM_opt, 64); - if (OPC_ansi) { - __MOVE("__init(void)", OPC_BodyNameExt, 13); - } else { - __MOVE("__init()", OPC_BodyNameExt, 9); - } + __MOVE("__init(void)", OPC_BodyNameExt, 13); } void OPC_Indent (int32 count) @@ -299,12 +291,8 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) openClause = 0; } if (form == 12) { - if (OPC_ansi) { - OPM_Write(')'); - OPC_AnsiParamList(typ->link, 0); - } else { - OPM_WriteString((CHAR*)")()", 4); - } + OPM_Write(')'); + OPC_AnsiParamList(typ->link, 0); break; } else if (comp == 2) { OPM_Write('['); @@ -579,12 +567,10 @@ static void OPC_DefineTProcTypes (OPT_Object obj) if (obj->typ != OPT_notyp) { OPC_DefineType(obj->typ); } - if (OPC_ansi) { - par = obj->link; - while (par != NIL) { - OPC_DefineType(par->typ); - par = par->link; - } + par = obj->link; + while (par != NIL) { + OPC_DefineType(par->typ); + par = par->link; } } @@ -662,11 +648,7 @@ static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) OPC_Ident(obj->typ->strobj); } OPM_WriteString((CHAR*)"(*)", 4); - if (OPC_ansi) { - OPC_AnsiParamList(obj->link, 0); - } else { - OPM_WriteString((CHAR*)"()", 3); - } + OPC_AnsiParamList(obj->link, 0); OPM_WriteString((CHAR*)", ", 3); OPC_DeclareParams(obj->link, 1); OPM_Write(')'); @@ -1063,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((OPC_ptrinit && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1122,22 +1104,11 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_Write(' '); OPC_Ident(proc); OPM_Write(' '); - if (OPC_ansi) { - OPC_AnsiParamList(proc->link, 1); - if (!define) { - OPM_Write(';'); - } - OPM_WriteLn(); - } else if (define) { - OPC_DeclareParams(proc->link, 0); - OPM_WriteLn(); - OPC_Indent(1); - OPC_IdentList(proc->link, 2); - OPC_Indent(-1); - } else { - OPM_WriteString((CHAR*)"();", 4); - OPM_WriteLn(); + OPC_AnsiParamList(proc->link, 1); + if (!define) { + OPM_Write(';'); } + OPM_WriteLn(); } static void OPC_ProcPredefs (OPT_Object obj, int8 vis) @@ -1255,9 +1226,6 @@ static void OPC_GenHeaderMsg (void) case 5: OPM_Write('p'); break; - case 6: - OPM_Write('k'); - break; case 7: OPM_Write('a'); break; @@ -1391,15 +1359,7 @@ void OPC_GenEnumPtrs (OPT_Object var) if (OPC_NofPtrs(typ) > 0) { if (!OPC_GlbPtrs) { OPC_GlbPtrs = 1; - OPM_WriteString((CHAR*)"static ", 8); - if (OPC_ansi) { - OPM_WriteString((CHAR*)"void EnumPtrs(void (*P)(void*))", 32); - } else { - OPM_WriteString((CHAR*)"void EnumPtrs(P)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"void (*P)();", 13); - } + OPM_WriteString((CHAR*)"static void EnumPtrs(void (*P)(void*))", 39); OPM_WriteLn(); OPC_BegBlk(); } @@ -1451,17 +1411,9 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (OPC_mainprog) { - if (OPC_ansi) { - OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); - OPM_WriteLn(); - } else { - OPM_WriteString((CHAR*)"main(argc, argv)", 17); - OPM_WriteLn(); - OPM_Write(0x09); - OPM_WriteString((CHAR*)"int argc; char **argv;", 23); - OPM_WriteLn(); - } + if (__IN(10, OPM_opt, 64)) { + OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); + OPM_WriteLn(); } else { OPM_WriteString((CHAR*)"void *", 7); OPM_WriteString(OPM_modName, 32); @@ -1470,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((OPC_mainprog && 0)) { + if ((__IN(10, OPM_opt, 64) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1503,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (OPC_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1583,21 +1535,6 @@ void OPC_EnterProc (OPT_Object proc) } var = var->link; } - if (!OPC_ansi) { - var = proc->link; - while (var != NIL) { - if ((var->typ->form == 5 && var->mode == 1)) { - OPC_BegStat(); - OPC_Ident(var->typ->strobj); - OPM_Write(' '); - OPC_Ident(var); - OPM_WriteString((CHAR*)" = _", 5); - OPC_Ident(var); - OPC_EndStat(); - } - var = var->link; - } - } var = proc->link; while (var != NIL) { if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { @@ -1963,11 +1900,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) array = array->BaseTyp; dim -= 1; } - if (OPC_ansi) { - OPM_WriteInt(array->n); - } else { - OPC_IntLiteral(array->n, OPM_AddressSize); - } + OPM_WriteInt(array->n); } } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 30f3fd48..ae8e7035 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 391613fb..1b8dca0d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -36,7 +36,6 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int32 OPM_S; -export BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -137,42 +136,94 @@ int32 OPM_Integer (int64 n) static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { int32 i; + __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { - case 'a': - *opt = *opt ^ 0x80; - break; - case 'c': - *opt = *opt ^ 0x4000; - break; - case 'e': - *opt = *opt ^ 0x0200; - break; - case 'f': - *opt = *opt ^ 0x010000; - break; - case 'k': - *opt = *opt ^ 0x40; - break; - case 'm': - *opt = *opt ^ 0x0400; - break; case 'p': *opt = *opt ^ 0x20; break; + case 'a': + *opt = *opt ^ 0x80; + break; case 'r': *opt = *opt ^ 0x04; break; - case 's': - *opt = *opt ^ 0x10; - break; case 't': *opt = *opt ^ 0x08; break; case 'x': *opt = *opt ^ 0x01; break; + case 'e': + *opt = *opt ^ 0x0200; + break; + case 's': + *opt = *opt ^ 0x10; + break; + case 'F': + *opt = *opt ^ 0x020000; + break; + case 'm': + *opt = *opt ^ 0x0400; + break; + case 'M': + *opt = *opt ^ 0x8000; + break; + case 'S': + *opt = *opt ^ 0x2000; + break; + case 'c': + *opt = *opt ^ 0x4000; + break; + case 'f': + *opt = *opt ^ 0x010000; + break; + case 'V': + *opt = *opt ^ 0x040000; + break; + case 'O': + if (i + 1 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); + OPM_LogWLn(); + } else { + switch (s[__X(i + 1, s__len)]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); + break; + } + i += 1; + } + break; + case 'A': + if (i + 2 >= Strings_Length(s, s__len)) { + OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); + OPM_LogWLn(); + } else { + OPM_AddressSize = s[__X(i + 1, s__len)] - 48; + OPM_Alignment = s[__X(i + 2, s__len)] - 48; + i += 2; + } + break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; @@ -198,18 +249,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } Files_SetSearchPath((CHAR*)"", 1); break; - case 'F': - *opt = *opt ^ 0x020000; - break; - case 'M': - *opt = *opt ^ 0x8000; - break; - case 'S': - *opt = *opt ^ 0x2000; - break; - case 'V': - *opt = *opt ^ 0x040000; - break; default: OPM_LogWStr((CHAR*)" warning: option ", 19); OPM_LogW('-'); @@ -220,6 +259,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) } i += 1; } + __DEL(s); } BOOLEAN OPM_OpenPar (void) @@ -246,33 +286,62 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" m - generate code for main module", 36); + OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" s - generate new symbol file", 31); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43); + OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" r - check value ranges", 25); + OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" x - turn off array indices check", 35); + OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48); + OPM_LogWStr((CHAR*)" Symbol file management", 25); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101); + OPM_LogWStr((CHAR*)" -e Allow extension of old symbol file.", 45); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67); + OPM_LogWStr((CHAR*)" -s Allow generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" c - don't call linker", 24); + OPM_LogWStr((CHAR*)" -F Force generation of new symbol file.", 46); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" f - don't use color output", 29); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57); + OPM_LogWStr((CHAR*)" C compiler and linker control", 32); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" V - verbose output", 21); + OPM_LogWStr((CHAR*)" -m This module is main. Link dynamically.", 48); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -M This module is main. Link statically.", 47); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -S Don't call C compiler", 31); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -c Don't link.", 21); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Miscellaneous", 16); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); @@ -287,9 +356,9 @@ BOOLEAN OPM_OpenPar (void) OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xe9; + OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256, &OPM_glbopt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); @@ -307,20 +376,14 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions((void*)s, 256, &OPM_opt); + OPM_ScanOptions(s, 256, &OPM_opt); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - OPM_dontAsm = __IN(13, OPM_opt, 64); - OPM_dontLink = __IN(14, OPM_opt, 64); - OPM_mainProg = __IN(10, OPM_opt, 64); - OPM_mainLinkStat = __IN(15, OPM_opt, 64); - OPM_notColorOutput = __IN(16, OPM_opt, 64); - OPM_forceNewSym = __IN(17, OPM_opt, 64); - OPM_Verbose = __IN(18, OPM_opt, 64); - if (OPM_mainLinkStat) { + if (__IN(15, OPM_opt, 64)) { OPM_glbopt |= __SETOF(10,64); + OPM_opt |= __SETOF(10,64); } OPM_GetProperties(); } @@ -406,20 +469,20 @@ static void OPM_LogErrMsg (int32 n) int32 i; CHAR buf[1024]; if (n >= 0) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -492,11 +555,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -679,7 +742,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { OPM_VerboseListSizes(); } } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4a9253cf..e2737249 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -15,7 +15,6 @@ import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; -import BOOLEAN OPM_dontAsm, OPM_dontLink, OPM_mainProg, OPM_mainLinkStat, OPM_notColorOutput, OPM_forceNewSym, OPM_Verbose; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ff86118c..e9fcba89 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9ae7712a..6dd03161 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index c811b3cc..d79e207f 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1c9ae6a4..40853589 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5fbe3b87..63b773cd 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1732,10 +1732,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = !OPT_sfpresent || OPT_symNew; - if (OPM_forceNewSym) { - *new = 1; - } + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 66686a2c..0cc86a01 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 965f7b61..8026831f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -16,7 +16,6 @@ typedef } OPV_ExitInfo; -static BOOLEAN OPV_assert, OPV_inxchk, OPV_mainprog, OPV_ansi; static int32 OPV_stamp; static int64 OPV_recno; static OPV_ExitInfo OPV_exit; @@ -130,10 +129,6 @@ void OPV_Init (void) OPV_stamp = 0; OPV_recno = 0; OPV_nofExitLabels = 0; - OPV_assert = __IN(7, OPM_opt, 64); - OPV_inxchk = __IN(0, OPM_opt, 64); - OPV_mainprog = __IN(10, OPM_opt, 64); - OPV_ansi = __IN(6, OPM_opt, 64); } static void OPV_GetTProcNum (OPT_Object obj) @@ -532,7 +527,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) { - if (!OPV_inxchk || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -728,11 +723,7 @@ static void OPV_design (OPT_Node n, int32 prec) static void OPV_ParIntLiteral (int64 n, int64 size) { - if (OPV_ansi) { - OPM_WriteInt(n); - } else { - OPC_IntLiteral(n, size); - } + OPM_WriteInt(n); } static void OPV_ActualPar (OPT_Node n, OPT_Object fp) @@ -754,26 +745,19 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if (!__IN(n->typ->comp, 0x0c, 64)) { if (mode == 2) { - if ((OPV_ansi && typ != n->typ)) { + if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); } OPM_Write('&'); prec = 9; - } else if (OPV_ansi) { + } else { if ((__IN(comp, 0x0c, 64) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); } - } else { - if ((__IN(form, 0x60, 64) && n->typ->form == 4)) { - OPM_WriteString((CHAR*)"(double)", 9); - prec = 9; - } else if (form == 4) { - OPV_SizeCast(n->typ->size, typ->size); - } } - } else if (OPV_ansi) { + } else { if ((((mode == 2 && typ != n->typ)) && prec == -1)) { OPM_WriteString((CHAR*)"(void*)", 8); } @@ -1532,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (OPV_assert) { + } else if (__IN(7, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1598,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (OPV_mainprog) { + if (__IN(10, OPM_opt, 64)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1643,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!OPV_mainprog) { + if (!__IN(10, OPM_opt, 64)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f78267d0..a89aa61a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0093f826..0a24d4e9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7faaa2a6..0c4c2127 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e9e84723..f2623b03 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 116d9c93..05b31bee 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 8dc35935..4226bdb9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 0487b70c..b13ba079 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 54254c51..4cdaa6b9 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 40d02918..10d0a9bb 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 7cd188f2..e1d112ec 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!OPM_notColorOutput) { + if (!__IN(16, OPM_opt, 64)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!OPM_dontAsm) { - if (OPM_dontLink) { + if (!__IN(13, OPM_opt, 64)) { + if (__IN(14, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); } else { - if (!(OPM_mainProg || OPM_mainLinkStat)) { + if (!__IN(10, OPM_opt, 64)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); } } } diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 04b9504d..ca898552 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 99f4c6b0..d574008d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 2eef1f18..db3aec30 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -25,7 +25,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int32 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (OPM_Verbose) { + if (__IN(18, OPM_opt, 64)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d4f0c474..847e440e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 3b56b4b1..ac832261 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b574976e..054f6ddd 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 6fc81fe1..32520266 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -830,11 +830,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g: INTEGER; (* expression (source) form *) p, q: OPT.Struct; BEGIN - IF OPM.Verbose THEN + IF OPM.verbose IN OPM.opt THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; END; y := ynode^.typ; f := x^.form; g := y^.form; - IF OPM.Verbose THEN + IF OPM.verbose IN OPM.opt THEN OPM.LogWStr("y.form = "); OPM.LogWNum(y.form, 0); OPM.LogWLn; OPM.LogWStr("f = "); OPM.LogWNum(f, 0); OPM.LogWLn; OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index bc84b8ad..29b8c302 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -38,7 +38,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; - ptrinit, mainprog, ansi: BOOLEAN; hashtab: ARRAY 105 OF SHORTINT; keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; @@ -48,11 +47,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE Init*; BEGIN indentLevel := 0; - ptrinit := OPM.ptrinit IN OPM.opt; - (*mainprog := OPM.mainprog IN OPM.opt;*) - mainprog := OPM.mainProg OR OPM.mainLinkStat; - ansi := OPM.ansi IN OPM.opt; - IF ansi THEN BodyNameExt := "__init(void)" ELSE BodyNameExt := "__init()" END + BodyNameExt := "__init(void)" END Init; PROCEDURE Indent* (count: INTEGER); @@ -189,9 +184,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (form = OPT.ProcTyp) OR (comp IN {OPT.Array, OPT.DynArr}) THEN IF openClause THEN OPM.Write(')'); openClause := FALSE END ; IF form = OPT.ProcTyp THEN - IF ansi THEN OPM.Write(")"); AnsiParamList(typ^.link, FALSE) - ELSE OPM.WriteString(")()") - END ; + OPM.Write(")"); AnsiParamList(typ^.link, FALSE); EXIT ELSIF comp = OPT.Array THEN OPM.Write('['); OPM.WriteInt(typ^.n); OPM.Write(']') @@ -373,9 +366,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR par: OPT.Object; BEGIN IF obj^.typ # OPT.notyp THEN DefineType(obj^.typ) END ; - IF ansi THEN par := obj^.link; - WHILE par # NIL DO DefineType(par^.typ); par := par^.link END - END + par := obj^.link; WHILE par # NIL DO DefineType(par^.typ); par := par^.link END END DefineTProcTypes; PROCEDURE DeclareTProcs(obj: OPT.Object; VAR empty: BOOLEAN); @@ -428,11 +419,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Str1(", #, ", obj^.adr DIV 10000H); IF obj^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(obj^.typ^.strobj) END ; OPM.WriteString("(*)"); - IF ansi THEN - AnsiParamList(obj^.link, FALSE); - ELSE - OPM.WriteString("()"); - END ; + AnsiParamList(obj^.link, FALSE); OPM.WriteString(", "); DeclareParams(obj^.link, TRUE); OPM.Write(")"); OPM.WriteLn @@ -713,7 +700,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) EndStat; BegStat; OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); base := NIL - ELSIF ptrinit & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") END END ; @@ -754,16 +741,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN IF proc^.typ = OPT.notyp THEN OPM.WriteString('void') ELSE Ident(proc^.typ^.strobj) END ; OPM.Write(' '); Ident(proc); OPM.Write(' '); - IF ansi THEN - AnsiParamList(proc^.link, TRUE); - IF ~define THEN OPM.Write(";") END ; - OPM.WriteLn; - ELSIF define THEN - DeclareParams(proc^.link, FALSE); - OPM.WriteLn; - Indent(1); IdentList(proc^.link, 2(* map REAL to double *)); Indent(-1) - ELSE OPM.WriteString("();"); OPM.WriteLn - END + AnsiParamList(proc^.link, TRUE); + IF ~define THEN OPM.Write(";") END ; + OPM.WriteLn END ProcHeader; PROCEDURE ProcPredefs (obj: OPT.Object; vis: SHORTINT); (* forward declaration of procedures *) @@ -846,7 +826,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPM.typchk: OPM.Write("t") | OPM.newsf: OPM.Write("s") | OPM.ptrinit: OPM.Write("p") - | OPM.ansi: OPM.Write("k") | OPM.assert: OPM.Write("a") | OPM.extsf: OPM.Write("e") | OPM.mainprog: OPM.Write("m") @@ -932,14 +911,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) typ := var^.typ; IF NofPtrs(typ) > 0 THEN IF ~GlbPtrs THEN GlbPtrs := TRUE; - OPM.WriteString('static '); - IF ansi THEN - OPM.WriteString("void EnumPtrs(void (*P)(void*))") - ELSE - OPM.WriteString("void EnumPtrs(P)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("void (*P)();"); - END ; - OPM.WriteLn; + OPM.WriteString("static void EnumPtrs(void (*P)(void*))"); OPM.WriteLn; BegBlk END ; BegStat; @@ -970,27 +942,22 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE EnterBody*; BEGIN OPM.WriteLn; OPM.WriteString(Export); - IF mainprog THEN - IF ansi THEN - OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; - ELSE - OPM.WriteString("main(argc, argv)"); OPM.WriteLn; - OPM.Write(Tab); OPM.WriteString("int argc; char **argv;"); OPM.WriteLn - END + IF OPM.mainprog IN OPM.opt THEN + OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("void *"); OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; END ; BegBlk; BegStat; - IF mainprog THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; - IF mainprog & demoVersion THEN BegStat; + IF (OPM.mainprog IN OPM.opt) & demoVersion THEN BegStat; OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); BegStat; - IF mainprog THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; OPM.WriteString(OPM.modName); IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; EndStat; @@ -1000,7 +967,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE ExitBody*; BEGIN BegStat; - IF mainprog THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; OPM.WriteLn; EndBlk END ExitBody; @@ -1052,17 +1019,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END ; var := var^.link END ; - IF ~ansi THEN - var := proc^.link; - WHILE var # NIL DO (* "unpromote" value real parameters *) - IF (var^.typ^.form = OPT.Real) & (var^.mode = OPT.Var) THEN - BegStat; - Ident(var^.typ^.strobj); OPM.Write(' '); Ident(var); OPM.WriteString(" = _"); Ident(var); - EndStat - END ; - var := var^.link - END - END ; var := proc^.link; WHILE var # NIL DO (* copy value array parameters *) IF (var^.typ^.comp IN {OPT.Array, OPT.DynArr}) & (var^.mode = OPT.Var) & (var^.typ^.sysflag = 0) THEN @@ -1303,7 +1259,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF dim # 0 THEN OPM.WriteInt(dim) END ELSE (* array *) WHILE dim > 0 DO array := array^.BaseTyp; DEC(dim) END; - IF ansi THEN OPM.WriteInt(array.n) ELSE IntLiteral(array.n, OPM.AddressSize) END + OPM.WriteInt(array.n) END END Len; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 952ea9e5..33965ece 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -15,7 +15,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) typchk* = 3; (* type check on *) newsf* = 4; (* generation of new symbol file allowed *) ptrinit* = 5; (* pointer initialization *) - ansi* = 6; (* ANSI or K&R style prototypes *) assert* = 7; (* assert evaluation *) extsf* = 9; (* extension of old symbol file allowed *) mainprog* = 10; (* translate module body into C main function *) @@ -25,7 +24,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notcoloroutput* = 16; (* turn off color output *) forcenewsym* = 17; (* force new symbol file *) verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, ansi, assert}; (* default options *) + defopt* = {inxchk, typchk, ptrinit, assert}; (* default options *) nilval* = 0; @@ -122,8 +121,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; - dontAsm-, dontLink-, mainProg-, mainLinkStat-, notColorOutput-, forceNewSym-, Verbose-: BOOLEAN; - OBERON: ARRAY 1024 OF CHAR; MODULES: ARRAY 1024 OF CHAR; @@ -143,25 +140,53 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- parameter handling -------------------------*) - PROCEDURE ScanOptions(VAR s: ARRAY OF CHAR; VAR opt: SET); + PROCEDURE ScanOptions(s: ARRAY OF CHAR; VAR opt: SET); VAR i: INTEGER; BEGIN i := 1; (* skip - *) WHILE s[i] # 0X DO CASE s[i] OF - | "a": opt := opt / {assert} - | "c": opt := opt / {dontlink} - | "e": opt := opt / {extsf} - | "f": opt := opt / {notcoloroutput} - | "k": opt := opt / {ansi} (* undocumented *) - | "m": opt := opt / {mainprog} - | "p": opt := opt / {ptrinit} - | "r": opt := opt / {ranchk} - | "s": opt := opt / {newsf} - | "t": opt := opt / {typchk} - | "x": opt := opt / {inxchk} + (* Run time safety *) + | "p": opt := opt / {ptrinit} (* Initialise pointers to NIL. *) + | "a": opt := opt / {assert} (* Halt on assertion failures. *) + | "r": opt := opt / {ranchk} (* Halt on range check failures. *) + | "t": opt := opt / {typchk} (* Halt on type guad failure. *) + | "x": opt := opt / {inxchk} (* Halt on index out of range. *) + (* Symbol file management *) + | "e": opt := opt / {extsf} (* Allow extension of old symbol file. *) + | "s": opt := opt / {newsf} (* Allow generation of new symbol file. *) + | "F": opt := opt / {forcenewsym} (* Force generation of new symbol file. *) + + (* C compiler and linker control *) + | "m": opt := opt / {mainprog} (* This module is main. Link dynamically. *) + | "M": opt := opt / {mainlinkstat} (* This module is main. Link statically. *) + | "S": opt := opt / {dontasm} (* Don't call C compiler *) + | "c": opt := opt / {dontlink} (* Don't link. *) + + (* Miscellaneous *) + | "f": opt := opt / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "V": opt := opt / {verbose} + + (* Elementary type size model *) + | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE + CASE s[i+1] OF + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 (* Original Oberon / Oberon 2 *) + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Vishap 64 bit *) + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Component Pascal *) + ELSE LogWStr("Unrecognised size model character following -O."); LogWLn + END; + INC(i) + END + + (* Target machine address size and alignment *) + | "A": IF i+2 >= Strings.Length(s) THEN LogWStr("-M option requires two following digits."); LogWLn ELSE + AddressSize := ORD(s[i+1]) - ORD('0'); Alignment := ORD(s[i+2]) - ORD('0'); + INC(i, 2) + END + + (* Temporary build control option - remove when makefile updated to new options. *) | "B": IF s[i+1] # 0X THEN INC(i); IntegerSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); AddressSize := ORD(s[i]) - ORD('0') END; IF s[i+1] # 0X THEN INC(i); Alignment := ORD(s[i]) - ORD('0') END; @@ -176,11 +201,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) SetSize := 8; END; Files.SetSearchPath("") - - | "F": opt := opt / {forcenewsym} - | "M": opt := opt / {mainlinkstat} - | "S": opt := opt / {dontasm} - | "V": opt := opt / {verbose} ELSE LogWStr(" warning: option "); LogW(OptionChar); @@ -223,20 +243,37 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(' '); LogWStr(Configuration.name); LogWStr(' options {files {options}}.'); LogWLn; LogWLn; LogWStr('Where options = ["-" {option} ].'); LogWLn; LogWLn; - LogWStr(" m - generate code for main module"); LogWLn; - LogWStr(" M - generate code for main module and link object statically"); LogWLn; - LogWStr(" s - generate new symbol file"); LogWLn; - LogWStr(" e - allow extending the module interface"); LogWLn; - LogWStr(" r - check value ranges"); LogWLn; - LogWStr(" x - turn off array indices check"); LogWLn; - LogWStr(" a - don't check ASSERTs at runtime, use this option in tested production code"); LogWLn; - LogWStr(" p - turn off automatic pointer initialization"); LogWLn; - LogWStr(" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)"); LogWLn; - LogWStr(" S - don't call external assembler/compiler, only generate C code"); LogWLn; - LogWStr(" c - don't call linker"); LogWLn; - LogWStr(" f - don't use color output"); LogWLn; - LogWStr(" F - force writing new symbol file in current directory"); LogWLn; - LogWStr(" V - verbose output"); LogWLn; + LogWStr(" Run time safety"); LogWLn; + LogWStr(" -p Initialise pointers to NIL."); LogWLn; + LogWStr(" -a Halt on assertion failures."); LogWLn; + LogWStr(" -r Halt on range check failures."); LogWLn; + LogWStr(" -t Halt on type guad failure."); LogWLn; + LogWStr(" -x Halt on index out of range."); LogWLn; + LogWLn; + LogWStr(" Symbol file management"); LogWLn; + LogWStr(" -e Allow extension of old symbol file."); LogWLn; + LogWStr(" -s Allow generation of new symbol file."); LogWLn; + LogWStr(" -F Force generation of new symbol file."); LogWLn; + LogWLn; + LogWStr(" C compiler and linker control"); LogWLn; + LogWStr(" -m This module is main. Link dynamically."); LogWLn; + LogWStr(" -M This module is main. Link statically."); LogWLn; + LogWStr(" -S Don't call C compiler"); LogWLn; + LogWStr(" -c Don't link."); LogWLn; + LogWLn; + LogWStr(" Miscellaneous"); LogWLn; + LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; + LogWStr(" -V Display compiler debugging messages."); LogWLn; + LogWLn; + LogWStr(" Size model for elementary types"); LogWLn; + LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWLn; + LogWStr(" Target machine address size and alignment"); LogWLn; + LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; + LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; + LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; LogWStr('Initial options specify defaults for all files.'); LogWLn; LogWStr('Options following a filename are specific to that file.'); LogWLn; @@ -267,6 +304,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) INC(S); s:=""; Platform.GetArg(S, s) END; + (* dontAsm := dontasm IN opt; dontLink := dontlink IN opt; mainProg := mainprog IN opt; @@ -274,8 +312,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notColorOutput := notcoloroutput IN opt; forceNewSym := forcenewsym IN opt; Verbose := verbose IN opt; + *) - IF mainLinkStat THEN INCL(glbopt, mainprog) END; (* sic *) + IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); INCL(opt, mainprog) END; GetProperties; END InitOptions; @@ -346,13 +385,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~notColorOutput THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF ~notColorOutput THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -425,9 +464,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Green) END; LogW("^"); - IF ~notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; Files.Close(f); END ShowLine; @@ -604,7 +643,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxSet := SetSize * 8 - 1; MaxIndex := SignedMaximum(AddressSize); - IF Verbose THEN VerboseListSizes END; + IF verbose IN opt THEN VerboseListSizes END; END GetProperties; (* ------------------------- Read Symbol File ------------------------- *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 6793a233..7648fcec 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1143,10 +1143,8 @@ END Import; expCtxt.nofm := 1; expCtxt.locmno[0] := 0; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); - ext := sfpresent & symExtended; new := ~sfpresent OR symNew; - IF OPM.forceNewSym THEN - new := TRUE - END; (* for bootstrapping -- noch *) + ext := sfpresent & symExtended; + new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.opt); IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 7c7e7464..04da5f09 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -46,7 +46,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR - assert, inxchk, mainprog, ansi: BOOLEAN; stamp: INTEGER; (* unique number for nested objects *) recno: LONGINT; (* number of anonymous record types *) @@ -104,10 +103,6 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Init*; BEGIN stamp := 0; recno := 0; nofExitLabels := 0; - assert := OPM.assert IN OPM.opt; - inxchk := OPM.inxchk IN OPM.opt; - mainprog := OPM.mainprog IN OPM.opt; - ansi := OPM.ansi IN OPM.opt END Init; PROCEDURE ^Traverse (obj, outerScope: OPT.Object; exported: BOOLEAN); @@ -333,7 +328,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN - IF ~inxchk + IF ~(OPM.inxchk IN OPM.opt) OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE @@ -434,7 +429,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE ParIntLiteral(n: SYSTEM.INT64; size: LONGINT); BEGIN (* Literal parameters (other than varargs) do not need an explicit size cast on ansi C compilers. *) - IF ansi THEN OPM.WriteInt(n) ELSE OPC.IntLiteral(n, size) END + OPM.WriteInt(n) END ParIntLiteral; PROCEDURE ActualPar(n: OPT.Node; fp: OPT.Object); @@ -448,22 +443,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; IF ~(n^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN IF mode = OPT.VarPar THEN - IF ansi & (typ # n^.typ) THEN OPM.WriteString("(void*)") END ; + IF typ # n^.typ THEN OPM.WriteString("(void*)") END; OPM.Write("&"); prec := 9 - ELSIF ansi THEN + ELSE IF (comp IN {OPT.Array, OPT.DynArr}) & (n^.class = OPT.Nconst) THEN OPM.WriteString("(CHAR*)") (* force to unsigned char *) ELSIF (form = OPT.Pointer) & (typ # n^.typ) & (n^.typ # OPT.niltyp) THEN OPM.WriteString("(void*)") (* type extension *) END - ELSE - IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *) - OPM.WriteString("(double)"); prec := 9 - ELSIF form = OPT.Int THEN - SizeCast(n.typ.size, typ.size) - END END - ELSIF ansi THEN + ELSE (* casting of params should be simplified eventually *) IF (mode = OPT.VarPar) & (typ # n^.typ) & (prec = MinPrec) THEN OPM.WriteString("(void*)") END END; @@ -903,7 +892,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; ActualPar(n^.right, n^.obj) | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF assert THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); + ELSIF OPM.assert IN OPM.opt THEN + OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat END | OPT.Ncase: INC(exit.level); CaseStat(n, outerProc); DEC(exit.level) @@ -925,7 +915,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) END | OPT.Nreturn: IF OPM.level = 0 THEN - IF mainprog THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE IF n^.left # NIL THEN (* Make local copy of result before ExitProc deletes dynamic vars *) @@ -953,7 +943,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Module*(prog: OPT.Node); BEGIN - IF ~mainprog THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; + IF ~(OPM.mainprog IN OPM.opt) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index c4b06e9c..b6ca8bf2 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -22,16 +22,16 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - IF (OPM.mainProg OR OPM.mainLinkStat) & (OPM.modName # "SYSTEM") THEN + IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" Main program."); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE IF new THEN - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~OPM.notColorOutput THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); @@ -90,12 +90,12 @@ MODULE Vishap; (* J. Templ 3.2.95 *) END; (* 'assemble' (i.e. c compile) .c to object or executable. *) - IF ~OPM.dontAsm THEN - IF OPM.dontLink THEN + IF ~(OPM.dontasm IN OPM.opt) THEN + IF OPM.dontlink IN OPM.opt THEN (* If not linking, just assemble each module. *) extTools.Assemble(OPM.modName) ELSE - IF ~(OPM.mainProg OR OPM.mainLinkStat) THEN + IF ~(OPM.mainprog IN OPM.opt) THEN (* Assemble non main rogram and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); @@ -103,7 +103,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain (OPM.modName, OPM.mainLinkStat, modulesobj) + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.opt, modulesobj) END END END diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 515c13e4..22752d9b 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -8,7 +8,9 @@ VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN - IF OPM.Verbose THEN Console.String(title); Console.String(cmd); Console.Ln END; + IF OPM.verbose IN OPM.opt THEN + Console.String(title); Console.String(cmd); Console.Ln + END; r := Platform.System(cmd); status := r MOD 128; exitcode := r DIV 256; From 246a961055ecf3cb3f38858210c0204dd700c13d Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 15:03:08 +0100 Subject: [PATCH 045/140] Tidy OPM, update usage display. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 28 +++++----- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 28 +++++----- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 28 +++++----- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 28 +++++----- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 28 +++++----- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPM.cmdln.Mod | 79 ++++++++++++---------------- 196 files changed, 310 insertions(+), 299 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index eaa862b2..f330b900 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6e15e6b7..22fabbc7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 960fca06..4fd2efd8 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index b398282e..09952648 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 147fdc5c..bd7bde13 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2f652641..2bb80b77 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index adbbe116..2b954508 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index df1eacae..b29595be 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1702769b..59498ab9 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index eaa862b2..f330b900 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6e15e6b7..22fabbc7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 960fca06..4fd2efd8 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index b398282e..09952648 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 148fbecb..abd3934b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2f652641..2bb80b77 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index adbbe116..2b954508 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index c02becc4..f69de03d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index fbb113f7..e3ed3241 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 122d2b82..8945bf88 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index d489489e..260915fb 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 255cb17c..02fad3c1 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 1e1dea21..4ce28c47 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 08a62623..c2270808 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 85664851..8d65bb87 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b11a81ee..516a3aca 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 24319ad6..3d3d4700 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4c14134c..46624045 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index fab97f6a..c8d64313 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index deb651aa..66bdcc6c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index dd9e2a18..a01fcde9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index ae8e7035..4a7c8523 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 1b8dca0d..22131ab9 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -268,11 +268,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -288,15 +290,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -326,16 +328,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -344,6 +346,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e2737249..b1fab659 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e9fcba89..8c85929d 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d79e207f..869dfa4b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 40853589..7de91cb4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 63b773cd..2dd48c74 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 0cc86a01..a1956589 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8026831f..22d0def4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 99577840..c318921f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 06414b7c..e4145b85 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f2623b03..039a3b6d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 05b31bee..e27d5dca 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4226bdb9..2f1a7062 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b13ba079..90baacae 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 4cdaa6b9..ee371c4e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 10d0a9bb..32047663 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index e1d112ec..87812cc2 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index ca898552..897999f4 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index db3aec30..1647c4fe 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index ac832261..8b57066f 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 054f6ddd..e8809371 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c780cc96..b17dc344 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 9c3127a1..8a36bd2f 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index c8de3606..6837ab77 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 80926272..3c273102 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ade97ac7..1e8c0d89 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 50823221..17784d67 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 57904466..b1c745df 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 1c66c8e5..1564f5e0 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 13b6dbed..dbc243c8 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c9ebd8f5..99ca6ea0 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index cdd33f1b..434172a2 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 6b7d1b01..11f64b59 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index b398282e..09952648 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0086ff0f..2122bed9 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -269,11 +269,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -289,15 +291,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -327,16 +329,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -345,6 +347,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b32da345..8ca21351 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index af0d37db..d2b3e83f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f37bbc27..99aba006 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1b60944c..f7dd1d10 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 148fbecb..abd3934b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d999d4ec..5de02c8b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index edb84f81..efddd202 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 12ced558..f8d3f76c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 75f53fa0..c93c79ce 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index dec0e0b4..c1ffff0a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0b779857..0ccc7989 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 69612295..0f221fe7 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index b4d5f201..9fdb55fb 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index c02becc4..f69de03d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index fbb113f7..e3ed3241 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 17b498b8..7b2dcd23 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 95868540..3a4b1ce7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 9047ebcc..2167c7f8 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a14f3ee0..c337a9e2 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 1402af8c..2428fce4 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 122d2b82..8945bf88 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 7fdf5f78..dca477a6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 6a1cec2c..23f25bda 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 255cb17c..02fad3c1 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 546f8b08..ea935dee 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 0aae236a..1fa0bb84 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 85664851..8d65bb87 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b11a81ee..516a3aca 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 24319ad6..3d3d4700 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4c14134c..46624045 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index fab97f6a..c8d64313 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index deb651aa..66bdcc6c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index dd9e2a18..a01fcde9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index ae8e7035..4a7c8523 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 1b8dca0d..22131ab9 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -268,11 +268,13 @@ BOOLEAN OPM_OpenPar (void) CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27); + OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); OPM_LogWStr(Configuration_versionLong, 41); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84); + OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Usage:", 7); @@ -288,15 +290,15 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL.", 37); + OPM_LogWStr((CHAR*)" -p Initialise pointers to NIL. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -a Halt on assertion failures.", 37); + OPM_LogWStr((CHAR*)" -a Halt on assertion failures. On by default.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -r Halt on range check failures.", 39); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -t Halt on type guad failure.", 36); + OPM_LogWStr((CHAR*)" -t Halt on type guard failure. On by default.", 52); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -x Halt on index out of range.", 37); + OPM_LogWStr((CHAR*)" -x Halt on index out of range. On by default.", 52); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Symbol file management", 25); @@ -326,16 +328,16 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types", 34); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 94); + OPM_LogWStr((CHAR*)" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET.", 95); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Target machine address size and alignment", 44); + OPM_LogWStr((CHAR*)" Target machine address size and alignment (default is that of the running compiler binary)", 93); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86).", 79); OPM_LogWLn(); @@ -344,6 +346,8 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); + OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); + OPM_LogWLn(); OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e2737249..b1fab659 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e9fcba89..8c85929d 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6dd03161..28045a86 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d79e207f..869dfa4b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 40853589..7de91cb4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 63b773cd..2dd48c74 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 0cc86a01..a1956589 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8026831f..22d0def4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index a89aa61a..4a3f9d07 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0a24d4e9..6651ddd3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 0c4c2127..8fd37cdd 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f2623b03..039a3b6d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 05b31bee..e27d5dca 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4226bdb9..2f1a7062 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b13ba079..90baacae 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 4cdaa6b9..ee371c4e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 10d0a9bb..32047663 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index e1d112ec..87812cc2 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index ca898552..897999f4 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d574008d..6ca6c961 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index db3aec30..1647c4fe 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 847e440e..0b905427 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index ac832261..8b57066f 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 054f6ddd..e8809371 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index 33965ece..b3298aed 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -218,6 +218,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Undocumented options used by the build system: + Todo - this is obsoleted by the -A and -O options. Remove when the build system + has been updated. + The following parameter overrides the integer size, pointer size and alignment settings compiled into the binary. They are used when bootstrapping to generate the C source for a compiler with different sizes to the current compiler. @@ -236,19 +239,22 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN IF Platform.ArgCount = 1 THEN LogWLn; - LogWStr("Vishap Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; - LogWStr("Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others."); LogWLn; + LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; + LogWStr("Based on Ofront by Software Templ OEG."); LogWLn; + LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; LogWLn; - LogWStr('Usage:'); LogWLn; LogWLn; - LogWStr(' '); LogWStr(Configuration.name); LogWStr(' options {files {options}}.'); LogWLn; LogWLn; - LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWStr("Usage:"); LogWLn; + LogWLn; + LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn; + LogWLn; + LogWStr('Where options = ["-" {option} ].'); LogWLn; LogWLn; LogWStr(" Run time safety"); LogWLn; - LogWStr(" -p Initialise pointers to NIL."); LogWLn; - LogWStr(" -a Halt on assertion failures."); LogWLn; + LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn; + LogWStr(" -a Halt on assertion failures. On by default."); LogWLn; LogWStr(" -r Halt on range check failures."); LogWLn; - LogWStr(" -t Halt on type guad failure."); LogWLn; - LogWStr(" -x Halt on index out of range."); LogWLn; + LogWStr(" -t Halt on type guard failure. On by default."); LogWLn; + LogWStr(" -x Halt on index out of range. On by default."); LogWLn; LogWLn; LogWStr(" Symbol file management"); LogWLn; LogWStr(" -e Allow extension of old symbol file."); LogWLn; @@ -265,19 +271,20 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; - LogWStr(" Size model for elementary types"); LogWLn; - LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; - LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; - LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)"); LogWLn; + LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; + LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; + LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWLn; - LogWStr(" Target machine address size and alignment"); LogWLn; + LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; - LogWStr('Initial options specify defaults for all files.'); LogWLn; - LogWStr('Options following a filename are specific to that file.'); LogWLn; - LogWStr('Repeating an option toggles its value.'); LogWLn; + LogWStr("All options are off by default, except where noted above."); LogWLn; + LogWStr("Initial options specify defaults for all files."); LogWLn; + LogWStr("Options following a filename are specific to that file."); LogWLn; + LogWStr("Repeating an option toggles its value."); LogWLn; RETURN FALSE ELSE S:=1; s:=""; Platform.GetArg(S, s); @@ -577,17 +584,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE VerboseListSizes; BEGIN LogWLn; - (*LogWStr("Type Size Alignement"); LogWLn;*) LogWStr("Type Size"); LogWLn; - (* - LogWStr("CHAR "); LogWNum(CharSize, 4); (* LogWNum(CharAlign, 5); *) LogWLn; - LogWStr("BOOLEAN "); LogWNum(BoolSize, 4); (* LogWNum(BoolAlign, 5); *) LogWLn; - LogWStr("REAL "); LogWNum(RealSize, 4); (* LogWNum(RealAlign, 5); *) LogWLn; - LogWStr("LONGREAL "); LogWNum(LRealSize, 4); (* LogWNum(LRealAlign, 5); *) LogWLn; - LogWStr("RECORD "); LogWNum(RecSize, 4); (* LogWNum(RecAlign, 5); *) LogWLn; - LogWStr("PROC "); LogWNum(ProcSize, 4); (* LogWNum(ProcAlign, 5); *) LogWLn; - LogWStr("ENDIAN "); LogWNum(ByteOrder, 4); LogWNum(BitOrder, 5); LogWLn; - *) LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; @@ -595,13 +592,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; LogWLn; LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - (* - LogWStr("Min shortint "); LogWNum(MinSInt, 4); LogWLn; - LogWStr("Max shortint "); LogWNum(MaxSInt, 4); LogWLn; - LogWStr("Min integer "); LogWNum(MinInt, 4); LogWLn; - LogWStr("Max integer "); LogWNum(MaxInt, 4); LogWLn; - LogWStr("Min longint "); LogWNum(MinLInt, 4); LogWLn; - *) END VerboseListSizes; @@ -864,7 +854,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN - Texts.OpenWriter(W); MODULES := ""; Platform.GetEnv("MODULES", MODULES); @@ -881,16 +870,18 @@ BEGIN (* type sizes with configuration based defaults *) AddressSize := Configuration.addressSize; Alignment := Configuration.alignment; - ShortintSize := 1; IF Configuration.intsize = 2 THEN - IntegerSize := 2; - LongintSize := 4; - SetSize := 4; + (* Original Oberon-2 implementation sizes (-O2) *) + ShortintSize := 1; + IntegerSize := 2; + LongintSize := 4; + SetSize := 4; ELSE - IntegerSize := 4; - LongintSize := 8; - SetSize := 8; - END; - + (* Legacy Vishap 64 bit build sizes (-OV) *) + ShortintSize := 1; + IntegerSize := 4; + LongintSize := 8; + SetSize := 8; + END END OPM. From b158671cf80643c1d90c75d8fb6f0ecc06cbc9ad Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 18:40:35 +0100 Subject: [PATCH 046/140] SYSTEM.ADR and LEN both return SYSTEM.ADDRESS. --- src/compiler/OPB.Mod | 20 ++- src/system/Platformunix.Mod | 2 +- src/tools/make/vishap.make | 315 ++++++++++++++++-------------------- 3 files changed, 156 insertions(+), 181 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 32520266..cd3ae496 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -341,7 +341,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (z^.class < OPT.Nconst) OR (f = OPT.String) THEN z := NewOp(op, typ, z) ELSE err(127) END ; - z^.typ := OPT.linttyp + z^.typ := OPT.adrtyp |OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END ELSE err(69) @@ -1052,8 +1052,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.bitfn, OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.adrtyp.size) THEN Convert(x, OPT.adrtyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.adrtyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1124,7 +1124,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE x^.obj := NIL; IF typ^.comp = OPT.DynArr THEN WHILE p^.class = OPT.Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) - p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.linttyp + p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.adrtyp ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) END END @@ -1229,8 +1229,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.adrtyp.size) THEN Convert(x, OPT.adrtyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.AddressSize)) THEN err(111); x^.typ := OPT.adrtyp END; p^.link := x |OPT.assertfn: (*ASSERT*) @@ -1293,7 +1293,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (fctno = OPT.lenfn) & (parno = 1) THEN (*LEN*) IF p^.typ^.comp = OPT.DynArr THEN dim := 0; WHILE p^.class = OPT.Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) - BindNodes(OPT.Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := OPT.len + BindNodes(OPT.Ndop, OPT.adrtyp, p, NewIntConst(dim)); p^.subcl := OPT.len ELSE p := NewIntConst(p^.typ^.n) END @@ -1379,7 +1379,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) THEN + IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *) + ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *) + ELSE err(123) + END ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 6c86de7c..78daad35 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -22,7 +22,7 @@ TYPE EnvPtr = POINTER TO ARRAY 1024 OF CHAR; ArgPtr = POINTER TO ARRAY 1024 OF CHAR; ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; VAR diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 5b854fa2..9e9dec60 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -102,26 +102,26 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/library/misc/vt100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/errors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPM.cmdln.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -B$(INTSIZE)$(ADRSIZE)$(ALIGNMENT) ../../src/compiler/Vishap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPM.cmdln.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/Vishap.Mod @printf "$(BUILDDIR) filled with compiler C source.\n" @@ -130,7 +130,7 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm $(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ @@ -141,25 +141,6 @@ browsercmd: FORCE: -testcoordinator: FORCE - @rm -f testcoordinator.exe testclient.exe - @make -f src/tools/make/vishap.make -s testtools - - -testtools: - @printf "\nMaking test coordinator\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SfFs ../../src/tools/testcoordinator/IP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestCoordinator.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Sfsm ../../src/tools/testcoordinator/TestClient.Mod - cd $(BUILDDIR); $(COMPILE) -c IP.c - cd $(BUILDDIR); $(COMPILE) TestCoordinator.c -o $(ROOTDIR)/testcoordinator \ - Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o - cd $(BUILDDIR); $(COMPILE) TestClient.c -o $(ROOTDIR)/testclient \ - Platform.o SYSTEM.o Heap.o Console.o Strings.o IP.o - - - - # installable: Check for access to the installation directory installable: @@ -205,152 +186,152 @@ uninstall: v4: @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/v4/Sets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Real0.Mod TODO: Comment disabled lines contain use of VAL that reads beyond source variable ooc: @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLongInts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocConvTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmProcess.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/pow/powStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/Listen.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZip.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethDates.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethStrings.Mod librarybinary: @printf "\nMaking lib$(ONAME)\n" @@ -394,13 +375,3 @@ confidence: cd src/test/confidence/arrayassignment; $(RUNTEST) if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi @printf "\n\n--- Confidence tests passed ---\n\n" - - - -# auto: A full build started from a central machine running TestCoordinator. -auto: - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @make -f src/tools/make/vishap.make -s testtools - while cmd=$$(./testclient -w "$(FLAVOUR)"); do $$cmd 2>&1 | ./testclient -s "$(FLAVOUR)"; done From b40dc4e2f80cecfe875d1abc8883c391d7196445 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 20:02:46 +0100 Subject: [PATCH 047/140] Some support in makefile for 32 bit model. --- bootstrap/unix-44/Console.c | 4 ++-- bootstrap/unix-44/Files.c | 4 ++-- bootstrap/unix-44/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-44/Platform.c | 8 ++++---- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-48/Console.c | 4 ++-- bootstrap/unix-48/Files.c | 4 ++-- bootstrap/unix-48/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-48/Platform.c | 8 ++++---- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-88/Console.c | 4 ++-- bootstrap/unix-88/Files.c | 4 ++-- bootstrap/unix-88/OPB.c | 26 +++++++++++++++----------- bootstrap/unix-88/Platform.c | 8 ++++---- bootstrap/unix-88/Platform.h | 2 +- bootstrap/windows-48/Console.c | 4 ++-- bootstrap/windows-48/Files.c | 4 ++-- bootstrap/windows-48/OPB.c | 26 +++++++++++++++----------- bootstrap/windows-88/Console.c | 4 ++-- bootstrap/windows-88/Files.c | 4 ++-- bootstrap/windows-88/OPB.c | 26 +++++++++++++++----------- makefile | 20 ++++++++++---------- src/system/Console.Mod | 2 +- src/system/Files.Mod | 29 ++++++++++++++++------------- src/system/Platformunix.Mod | 4 ++-- src/tools/make/configure.c | 1 + src/tools/make/vishap.make | 1 + 27 files changed, 141 insertions(+), 116 deletions(-) diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f330b900..3f691a07 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 22fabbc7..3ff2fa83 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2bb80b77..e2eb0c80 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Size (int32 h, address *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +int16 Platform_Size (int32 h, address *l) { int16 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2b954508..d024c4ed 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Size (int32 h, address *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 260915fb..e86ee126 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 4ce28c47..076eb5a8 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c318921f..733b53ef 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -83,7 +83,7 @@ export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, int64 *l); +export int32 Platform_Size (int64 h, address *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -155,7 +155,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (LONGINT)s.st_size +#define Platform_statsize() (address)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int32 Platform_Size (int64 h, address *l) { int32 _o_result; Platform_structstats(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index e4145b85..97c6cb2a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -67,7 +67,7 @@ import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, int64 *l); +import int32 Platform_Size (int64 h, address *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int64 Platform_Time (void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8a36bd2f..2e0565e9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - int32 n; + address n; int16 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3c273102..4b2bb492 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 99ca6ea0..4c60257b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 23f25bda..84cb998f 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; + address n; int32 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ea935dee..8336cb0e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + offset, (address)x + xpos, min); + __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + xpos, (address)buf->data + offset, min); + __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c8d64313..a3870901 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -639,7 +639,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } else { OPB_err(127); } - z->typ = OPT_linttyp; + z->typ = OPT_adrtyp; break; case 25: if ((f == 4 && z->class == 7)) { @@ -1938,11 +1938,11 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } break; case 26: case 27: @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_linttyp; + p->typ = OPT_adrtyp; } else { p = x; p->conval->intval = typ->n; @@ -2211,11 +2211,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { - OPB_Convert(&x, OPT_linttyp); + } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { + OPB_Convert(&x, OPT_adrtyp); } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { OPB_err(111); - x->typ = OPT_linttyp; + x->typ = OPT_adrtyp; } p->link = x; break; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); @@ -2450,8 +2450,12 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))))) { - OPB_err(123); + } else if (ap->typ != fp->typ) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { + } else { + OPB_err(123); + } } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/makefile b/makefile index 7f335f34..37fa64a0 100644 --- a/makefile +++ b/makefile @@ -262,21 +262,21 @@ bootstrap: configuration @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap diff --git a/src/system/Console.Mod b/src/system/Console.Mod index 6b35a090..bf1c9a1d 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: LONGINT; error: Platform.ErrorCode; + VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode; BEGIN Flush(); error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END diff --git a/src/system/Files.Mod b/src/system/Files.Mod index fb9fc421..388b3a95 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -34,14 +34,16 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Buffer = POINTER TO BufDesc; FileDesc = RECORD - workName, registerName: FileName; - tempFile: BOOLEAN; - identity: Platform.FileIdentity; - fd-: Platform.FileHandle; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper, state: INTEGER; - next: File; + workName: FileName; + registerName: FileName; + tempFile: BOOLEAN; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper: INTEGER; + state: INTEGER; + next: File; END; BufDesc = RECORD @@ -52,11 +54,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files data: ARRAY bufsize OF SYSTEM.BYTE END; - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org, offset: LONGINT + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org: LONGINT; + offset: LONGINT END; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 78daad35..a6e5d399 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(LONGINT)s.st_size"; +PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN @@ -358,7 +358,7 @@ BEGIN END MTimeAsClock; -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode; BEGIN structstats; IF fstat(h) < 0 THEN RETURN err() END; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index cd535c97..c000b68b 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -379,6 +379,7 @@ void writeMakeParameters() { fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); fprintf(fd, "INTSIZE=%d\n", intsize); + fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 9e9dec60..a56bebea 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -97,6 +97,7 @@ translate: @printf "\nmake translate - translating compiler source from Oberon to C:\n" @printf " PLATFORM: %s\n" $(PLATFORM) @printf " INTSIZE: %s\n" $(INTSIZE) + @printf " MODEL: %s\n" $(MODEL) @printf " ADRSIZE: %s\n" $(ADRSIZE) @printf " ALIGNMENT: %s\n" $(ALIGNMENT) @mkdir -p $(BUILDDIR) From 7b8eed99931942e52c11f803f4be6b3f3c8c5cc0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 22 Sep 2016 20:48:13 +0100 Subject: [PATCH 048/140] Revert LEN() to returnng LONGINT --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-88/OPB.c | 4 ++-- src/compiler/OPB.Mod | 4 ++-- src/tools/make/vishap.make | 1 + 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index a3870901..5cea943a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4c60257b..d0336349 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index a3870901..5cea943a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -2067,7 +2067,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x->conval->intval += 1; } p = NewOp__53(12, 19, p, x); - p->typ = OPT_adrtyp; + p->typ = OPT_linttyp; } else { p = x; p->conval->intval = typ->n; @@ -2323,7 +2323,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) p = p->left; dim += 1; } - OPB_BindNodes(12, OPT_adrtyp, &p, OPB_NewIntConst(dim)); + OPB_BindNodes(12, OPT_linttyp, &p, OPB_NewIntConst(dim)); p->subcl = 19; } else { p = OPB_NewIntConst(p->typ->n); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index cd3ae496..408eeaeb 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1124,7 +1124,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE x^.obj := NIL; IF typ^.comp = OPT.DynArr THEN WHILE p^.class = OPT.Nindex DO p := p^.left; INC(x^.conval^.intval) END ; (* possible side effect ignored *) - p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.adrtyp + p := NewOp(OPT.Ndop, OPT.len, p, x); p^.typ := OPT.linttyp ELSE p := x; p^.conval^.intval := typ^.n; SetIntType(p) END END @@ -1293,7 +1293,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (fctno = OPT.lenfn) & (parno = 1) THEN (*LEN*) IF p^.typ^.comp = OPT.DynArr THEN dim := 0; WHILE p^.class = OPT.Nindex DO p := p^.left; INC(dim) END ; (* possible side effect ignored *) - BindNodes(OPT.Ndop, OPT.adrtyp, p, NewIntConst(dim)); p^.subcl := OPT.len + BindNodes(OPT.Ndop, OPT.linttyp, p, NewIntConst(dim)); p^.subcl := OPT.len ELSE p := NewIntConst(p^.typ^.n) END diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index a56bebea..99e12608 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,6 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) +# MODEL=-O2 # Override model - build everything as S8,I16,L32. From cca132d7842840bfdd0703693e14fcf9955c6751 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 10:53:24 +0100 Subject: [PATCH 049/140] More adjustments to ADDRESS vs LONGINT. An -O2 on 64 bit compiler has worked once! --- bootstrap/SYSTEM.h | 10 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 6 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 116 ++++++++++---------- bootstrap/unix-44/Files.h | 60 +++++------ bootstrap/unix-44/Heap.c | 10 +- bootstrap/unix-44/Heap.h | 4 +- bootstrap/unix-44/Modules.c | 6 +- bootstrap/unix-44/Modules.h | 6 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 8 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 14 +-- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 4 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 14 +-- bootstrap/unix-44/OPT.h | 10 +- bootstrap/unix-44/OPV.c | 4 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 28 ++--- bootstrap/unix-44/Platform.h | 16 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 78 +++++++------- bootstrap/unix-44/Vishap.c | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 6 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 116 ++++++++++---------- bootstrap/unix-48/Files.h | 60 +++++------ bootstrap/unix-48/Heap.c | 10 +- bootstrap/unix-48/Heap.h | 4 +- bootstrap/unix-48/Modules.c | 6 +- bootstrap/unix-48/Modules.h | 6 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 8 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 14 +-- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 4 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 14 +-- bootstrap/unix-48/OPT.h | 10 +- bootstrap/unix-48/OPV.c | 4 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 28 ++--- bootstrap/unix-48/Platform.h | 16 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 78 +++++++------- bootstrap/unix-48/Vishap.c | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 6 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 116 ++++++++++---------- bootstrap/unix-88/Files.h | 60 +++++------ bootstrap/unix-88/Heap.c | 10 +- bootstrap/unix-88/Heap.h | 4 +- bootstrap/unix-88/Modules.c | 6 +- bootstrap/unix-88/Modules.h | 6 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 8 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 14 +-- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 4 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 14 +-- bootstrap/unix-88/OPT.h | 10 +- bootstrap/unix-88/OPV.c | 4 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 28 ++--- bootstrap/unix-88/Platform.h | 16 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 154 +++++++++++++-------------- bootstrap/unix-88/Texts.h | 78 +++++++------- bootstrap/unix-88/Vishap.c | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 6 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 116 ++++++++++---------- bootstrap/windows-48/Files.h | 60 +++++------ bootstrap/windows-48/Heap.c | 10 +- bootstrap/windows-48/Heap.h | 4 +- bootstrap/windows-48/Modules.c | 6 +- bootstrap/windows-48/Modules.h | 6 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 8 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 14 +-- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 4 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 14 +-- bootstrap/windows-48/OPT.h | 10 +- bootstrap/windows-48/OPV.c | 4 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 16 +-- bootstrap/windows-48/Platform.h | 10 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 154 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 78 +++++++------- bootstrap/windows-48/Vishap.c | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 6 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 116 ++++++++++---------- bootstrap/windows-88/Files.h | 60 +++++------ bootstrap/windows-88/Heap.c | 10 +- bootstrap/windows-88/Heap.h | 4 +- bootstrap/windows-88/Modules.c | 6 +- bootstrap/windows-88/Modules.h | 6 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 8 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 14 +-- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 4 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 14 +-- bootstrap/windows-88/OPT.h | 10 +- bootstrap/windows-88/OPV.c | 4 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 16 +-- bootstrap/windows-88/Platform.h | 10 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 154 +++++++++++++-------------- bootstrap/windows-88/Texts.h | 78 +++++++------- bootstrap/windows-88/Vishap.c | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPC.Mod | 6 +- src/system/Console.Mod | 2 +- src/system/Platformunix.Mod | 10 +- src/system/SYSTEM.h | 10 +- src/tools/make/vishap.make | 2 +- 201 files changed, 1468 insertions(+), 1456 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index ddd85144..6ddf909a 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -243,10 +243,16 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) + +//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) +//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) +#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 3f691a07..115e60f5 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3ff2fa83..0a7ac692 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4fd2efd8..e2b7a3bb 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index bd7bde13..8e7d9b8d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e2eb0c80..9de57a27 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -42,7 +42,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, address *l); +export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, address *l) +int16 Platform_Size (int32 h, int32 *l) { int16 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, address *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int16 Platform_Read (int32 h, address p, address l, address *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d024c4ed..bc487769 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, address *l); +import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index b29595be..f63a7cb6 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 59498ab9..1a87761b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 3f691a07..115e60f5 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3ff2fa83..0a7ac692 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4fd2efd8..e2b7a3bb 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index abd3934b..c52efac6 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e2eb0c80..9de57a27 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -42,7 +42,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, address *l); +export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, address *l) +int16 Platform_Size (int32 h, int32 *l) { int16 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, address *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int16 Platform_Read (int32 h, address p, address l, address *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d024c4ed..bc487769 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, address *l); +import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); import int32 Platform_Time (void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f69de03d..60a7ea7a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e3ed3241..df86e814 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -116,18 +116,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -138,35 +138,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8945bf88..fa5765f3 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index e86ee126..9d23b9fd 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - address n; + int64 n; int32 error; Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 02fad3c1..64d39044 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 076eb5a8..c63ea9c4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int64 *t, int64 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, address *r__typ) { int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) { int64 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int64 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int64 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int64 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int64 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int64 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index c2270808..645bc846 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 8d65bb87..c87cfd6d 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 @@ -74,10 +74,10 @@ static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int32 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 516a3aca..b4829f2f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3d3d4700..23fec310 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -43,8 +43,8 @@ export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 46624045..7cafac5f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5cea943a..81077606 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 66bdcc6c..6863fee8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a01fcde9..ee7f4baa 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int32 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4a7c8523..6fe30a31 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 22131ab9..3f07341b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -40,7 +40,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -48,10 +48,10 @@ export void OPM_FPrint (int64 *fp, int64 val); export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); export void OPM_FPrintReal (int64 *fp, REAL real); export void OPM_FPrintSet (int64 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int32 OPM_Integer (int64 n); @@ -495,7 +495,7 @@ static void OPM_LogErrMsg (int32 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -651,7 +651,7 @@ void OPM_FPrintLReal (int64 *fp, LONGREAL lr) OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -993,7 +993,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b1fab659..765b9680 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 8c85929d..9b25c35f 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 869dfa4b..cd24b8ee 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 7de91cb4..bcc2ae4d 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 2dd48c74..41686385 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -100,12 +100,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index a1956589..697eb2c9 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -74,10 +74,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 22d0def4..b57b2868 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -21,7 +21,7 @@ static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 733b53ef..27df644a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -42,7 +42,7 @@ static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int32 e); export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -61,8 +61,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int32 n, int64 *val); export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -72,8 +72,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, address l, address *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int32 Platform_Read (int64 h, address p, int64 l, int64 *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -81,9 +81,9 @@ export int32 Platform_Seek (int64 h, int64 offset, int32 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, address *l); +export int32 Platform_Size (int64 h, int64 *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); @@ -446,7 +446,7 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; Platform_structstats(); @@ -461,7 +461,7 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; __DUP(n, n__len, CHAR); @@ -493,7 +493,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } @@ -504,7 +504,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, address *l) +int32 Platform_Size (int64 h, int64 *l) { int32 _o_result; Platform_structstats(); @@ -517,7 +517,7 @@ int32 Platform_Size (int64 h, address *l) return _o_result; } -int32 Platform_Read (int64 h, address p, address l, address *n) +int32 Platform_Read (int64 h, address p, int64 l, int64 *n) { int32 _o_result; *n = Platform_readfile(h, p, l); @@ -532,7 +532,7 @@ int32 Platform_Read (int64 h, address p, address l, address *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { int32 _o_result; *n = Platform_readfile(h, (address)b, b__len); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 97c6cb2a..f44cd9e8 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int32 e); import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -45,8 +45,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int32 n, int64 *val); import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -56,8 +56,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, address l, address *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int32 Platform_Read (int64 h, address p, int64 l, int64 *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -65,9 +65,9 @@ import int32 Platform_Seek (int64 h, int64 offset, int32 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, address *l); +import int32 Platform_Size (int64 h, int64 *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); import int64 Platform_Time (void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 039a3b6d..7678a81e 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e27d5dca..4de192c6 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2f1a7062..49fbdd21 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 90baacae..4dd0d2c3 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ee371c4e..6403ce33 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int64 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int64 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int64 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, address *R__typ) { int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int32 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int32 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int32 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) { int32 i; int64 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) { int32 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) { int32 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int3 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int32 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) { int32 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int32 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int64 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int32 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; int64 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 32047663..e85157ed 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int64 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 87812cc2..5c6cada1 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 897999f4..4bb09433 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 1647c4fe..d6bc2194 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8b57066f..bb55d599 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index e8809371..2bc7d18f 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b17dc344..abdf151b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 2e0565e9..7b492ced 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -118,10 +118,10 @@ void Console_Hex (int32 i) void Console_Read (CHAR *ch) { - address n; + int32 n; int16 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 6837ab77..b08c93ea 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4b2bb492..98974743 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { int32 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int32 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int32 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int32 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int32 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int16 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1e8c0d89..80684752 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int32 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 17784d67..b7c8c827 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -74,10 +74,10 @@ static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int16 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index b1c745df..6ad4813e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 1564f5e0..7704f005 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -43,8 +43,8 @@ export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index dbc243c8..060208c6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d0336349..af4f4fc4 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 434172a2..dc0085af 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 11f64b59..99353400 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 09952648..4215947f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2122bed9..039d1c77 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -41,7 +41,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -49,10 +49,10 @@ export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -496,7 +496,7 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < (int64)OPM_ErrorLineStartPos) { @@ -654,7 +654,7 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -996,7 +996,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 8ca21351..a6b7990c 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d2b3e83f..a3ab1dd3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 99aba006..0cac83bd 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index f7dd1d10..caef45f4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index abd3934b..c52efac6 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -101,12 +101,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 5de02c8b..0bd1f189 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -75,10 +75,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index efddd202..8bb5ec32 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -21,7 +21,7 @@ static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f8d3f76c..54a94ae8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -44,7 +44,7 @@ export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int16 e); export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -63,8 +63,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int16 n, int32 *val); export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -82,7 +82,7 @@ export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export int16 Platform_Size (int32 h, int32 *l); export int16 Platform_Sync (int32 h); export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); @@ -467,7 +467,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; Platform_byHandleFileInformation(); @@ -484,7 +484,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int16 _o_result; int32 h; @@ -517,7 +517,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c93c79ce..18ca5267 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -29,7 +29,7 @@ import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int16 e); import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -47,8 +47,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int16 n, int32 *val); import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); @@ -66,7 +66,7 @@ import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import int16 Platform_Size (int32 h, int32 *l); import int16 Platform_Sync (int32 h); import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index c1ffff0a..fe93e8be 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 0ccc7989..e7cba0d8 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 0f221fe7..427a0cc4 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9fdb55fb..44c51b2a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f69de03d..60a7ea7a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int32 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int32 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int32 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int16 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int16 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { int16 i; int32 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { int16 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { int16 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int16 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { int16 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int16 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int32 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int16 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; int32 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e3ed3241..df86e814 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -116,18 +116,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -138,35 +138,35 @@ import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int32 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int32 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 7b2dcd23..1ec89e33 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 3a4b1ce7..0a40d5e9 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 2167c7f8..8be0b63d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index c337a9e2..4f6a6c9d 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 2428fce4..94f8add4 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8945bf88..fa5765f3 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/22] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index dca477a6..f51f63f2 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 84cb998f..939de5cc 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -118,10 +118,10 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - address n; + int64 n; int32 error; Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, (void*)&n); + error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { *ch = 0x00; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 02fad3c1..64d39044 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8336cb0e..27fb9031 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -56,11 +56,11 @@ static struct { CHAR data[1]; } *Files_SearchPath; -export LONGINT *Files_FileDesc__typ; -export LONGINT *Files_BufDesc__typ; -export LONGINT *Files_Rider__typ; +export address *Files_FileDesc__typ; +export address *Files_BufDesc__typ; +export address *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); export void Files_Close (Files_File f); @@ -79,37 +79,37 @@ export int64 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +export int64 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -export void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -export void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -export void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) @@ -544,14 +544,14 @@ void Files_GetDate (Files_File f, int64 *t, int64 *d) Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, LONGINT *r__typ) +int64 Files_Pos (Files_Rider *r, address *r__typ) { int64 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) { int64 org, offset, i, n; Files_Buffer buf = NIL; @@ -613,7 +613,7 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { int64 offset; Files_Buffer buf = NIL; @@ -637,7 +637,7 @@ void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -673,19 +673,19 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) { Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); } -Files_File Files_Base (Files_Rider *r, LONGINT *r__typ) +Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; _o_result = (*r).buf->f; return _o_result; } -void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; int64 offset; @@ -706,7 +706,7 @@ void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) { int64 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; @@ -849,26 +849,26 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); *x = b[0] + __ASHL(b[1], 8); } -void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; int64 l; @@ -877,21 +877,21 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) *x = (SET)l; } -void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -903,7 +903,7 @@ void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; CHAR ch; @@ -921,7 +921,7 @@ void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) { int8 s; CHAR ch; @@ -938,19 +938,19 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x) +void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { int64 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } -void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -968,7 +968,7 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; int64 i; @@ -980,21 +980,21 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { int32 i; i = 0; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1013,7 +1013,7 @@ void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x) Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); } -void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x) +void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1fa0bb84..399f2137 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef Files__h #define Files__h @@ -24,10 +24,10 @@ typedef -import LONGINT *Files_FileDesc__typ; -import LONGINT *Files_Rider__typ; +import address *Files_FileDesc__typ; +import address *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, LONGINT *r__typ); +import Files_File Files_Base (Files_Rider *r, address *r__typ); import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); import void Files_Close (Files_File f); import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); @@ -36,36 +36,36 @@ import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); import int64 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, LONGINT *r__typ); +import int64 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadNum64 (Files_Rider *R, LONGINT *R__typ, int64 *x); -import void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x); -import void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); +import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, int64 pos); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteNum64 (Files_Rider *R, LONGINT *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x); -import void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 8d65bb87..c87cfd6d 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #define INTEGER int32 #define LONGINT int64 @@ -74,10 +74,10 @@ static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; export int32 Heap_FileCount; -export LONGINT *Heap_ModuleDesc__typ; -export LONGINT *Heap_CmdDesc__typ; -export LONGINT *Heap_FinDesc__typ; -export LONGINT *Heap__1__typ; +export address *Heap_ModuleDesc__typ; +export address *Heap_CmdDesc__typ; +export address *Heap_FinDesc__typ; +export address *Heap__1__typ; static void Heap_CheckFin (void); static void Heap_ExtendHeap (address blksz); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 516a3aca..b4829f2f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ #ifndef Heap__h #define Heap__h @@ -34,7 +34,7 @@ import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; -import LONGINT *Heap_ModuleDesc__typ; +import address *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3d3d4700..23fec310 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -43,8 +43,8 @@ export int32 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export LONGINT *Modules_ModuleDesc__typ; -export LONGINT *Modules_CmdDesc__typ; +export address *Modules_ModuleDesc__typ; +export address *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 46624045..7cafac5f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -40,8 +40,8 @@ import int32 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import LONGINT *Modules_ModuleDesc__typ; -import LONGINT *Modules_CmdDesc__typ; +import address *Modules_ModuleDesc__typ; +import address *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5cea943a..81077606 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 66bdcc6c..6863fee8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a01fcde9..ee7f4baa 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -1041,7 +1041,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1078,7 +1078,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", LONGINT *", 12); + OPM_WriteString((CHAR*)", address *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1166,7 +1166,7 @@ static void OPC_GenDynTypes (OPT_Node n, int32 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"LONGINT *", 10); + OPM_WriteString((CHAR*)"address *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4a7c8523..6fe30a31 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 22131ab9..3f07341b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -40,7 +40,7 @@ static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); @@ -48,10 +48,10 @@ export void OPM_FPrint (int64 *fp, int64 val); export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); export void OPM_FPrintReal (int64 *fp, REAL real); export void OPM_FPrintSet (int64 *fp, SET set); -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos); +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int32 OPM_Integer (int64 n); @@ -495,7 +495,7 @@ static void OPM_LogErrMsg (int32 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; if (pos < OPM_ErrorLineStartPos) { @@ -651,7 +651,7 @@ void OPM_FPrintLReal (int64 *fp, LONGREAL lr) OPM_FPrint(&*fp, __VAL(int64, lr)); } -static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { @@ -993,7 +993,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b1fab659..765b9680 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 8c85929d..9b25c35f 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -24,7 +24,7 @@ static OPT_Node OPP_TDinit, OPP_lastTDinit; static int32 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export LONGINT *OPP__1__typ; +export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 28045a86..e5a59f6c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 869dfa4b..cd24b8ee 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 7de91cb4..bcc2ae4d 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 2dd48c74..41686385 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -100,12 +100,12 @@ static OPT_ExpCtxt OPT_expCtxt; static int64 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -export LONGINT *OPT_ConstDesc__typ; -export LONGINT *OPT_ObjDesc__typ; -export LONGINT *OPT_StrDesc__typ; -export LONGINT *OPT_NodeDesc__typ; -export LONGINT *OPT_ImpCtxt__typ; -export LONGINT *OPT_ExpCtxt__typ; +export address *OPT_ConstDesc__typ; +export address *OPT_ObjDesc__typ; +export address *OPT_StrDesc__typ; +export address *OPT_NodeDesc__typ; +export address *OPT_ImpCtxt__typ; +export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index a1956589..697eb2c9 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -74,10 +74,10 @@ import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import LONGINT *OPT_ConstDesc__typ; -import LONGINT *OPT_ObjDesc__typ; -import LONGINT *OPT_StrDesc__typ; -import LONGINT *OPT_NodeDesc__typ; +import address *OPT_ConstDesc__typ; +import address *OPT_ObjDesc__typ; +import address *OPT_StrDesc__typ; +import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 22d0def4..b57b2868 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -21,7 +21,7 @@ static int64 OPV_recno; static OPV_ExitInfo OPV_exit; static int32 OPV_nofExitLabels; -export LONGINT *OPV_ExitInfo__typ; +export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 4a3f9d07..c309d63c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6651ddd3..363a0045 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -44,7 +44,7 @@ export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; -export LONGINT *Platform_FileIdentity__typ; +export address *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (int32 e); export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -63,8 +63,8 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (int32 n, int64 *val); export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -82,7 +82,7 @@ export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde export int32 Platform_Seek (int64 h, int64 o, int32 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export int32 Platform_Size (int64 h, int64 *l); export int32 Platform_Sync (int64 h); export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); @@ -467,7 +467,7 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; Platform_byHandleFileInformation(); @@ -484,7 +484,7 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ) +int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { int32 _o_result; int64 h; @@ -517,7 +517,7 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return _o_result; } -void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 8fd37cdd..6cab3690 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -29,7 +29,7 @@ import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; -import LONGINT *Platform_FileIdentity__typ; +import address *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (int32 e); import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); @@ -47,8 +47,8 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (int32 n, int64 *val); import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); +import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); +import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); @@ -66,7 +66,7 @@ import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIde import int32 Platform_Seek (int64 h, int64 o, int32 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, LONGINT *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import int32 Platform_Size (int64 h, int64 *l); import int32 Platform_Sync (int64 h); import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 039a3b6d..7678a81e 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e27d5dca..4de192c6 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2f1a7062..49fbdd21 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 90baacae..4dd0d2c3 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ee371c4e..6403ce33 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -33,7 +33,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_TextDesc *Texts_Text; @@ -167,20 +167,20 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export LONGINT *Texts_FontDesc__typ; -export LONGINT *Texts_RunDesc__typ; -export LONGINT *Texts_PieceDesc__typ; -export LONGINT *Texts_ElemMsg__typ; -export LONGINT *Texts_ElemDesc__typ; -export LONGINT *Texts_FileMsg__typ; -export LONGINT *Texts_CopyMsg__typ; -export LONGINT *Texts_IdentifyMsg__typ; -export LONGINT *Texts_BufDesc__typ; -export LONGINT *Texts_TextDesc__typ; -export LONGINT *Texts_Reader__typ; -export LONGINT *Texts_Scanner__typ; -export LONGINT *Texts_Writer__typ; -export LONGINT *Texts__1__typ; +export address *Texts_FontDesc__typ; +export address *Texts_RunDesc__typ; +export address *Texts_PieceDesc__typ; +export address *Texts_ElemMsg__typ; +export address *Texts_ElemDesc__typ; +export address *Texts_FileMsg__typ; +export address *Texts_CopyMsg__typ; +export address *Texts_IdentifyMsg__typ; +export address *Texts_BufDesc__typ; +export address *Texts_TextDesc__typ; +export address *Texts_Reader__typ; +export address *Texts_Scanner__typ; +export address *Texts_Writer__typ; +export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -194,41 +194,41 @@ export Texts_Text Texts_ElemBase (Texts_Elem E); export int64 Texts_ElemPos (Texts_Elem E); static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -export void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -export int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -export void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, address *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -export void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); +export void Texts_Scan (Texts_Scanner *S, address *S__typ); +export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -export void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -export void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -export void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +export void Texts_WriteLn (Texts_Writer *W, address *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -388,7 +388,7 @@ int64 Texts_ElemPos (Texts_Elem E) return _o_result; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) { Texts_Alien e = NIL; Files_Rider r; @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -618,7 +618,7 @@ void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos } } -void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; int64 pos; @@ -663,7 +663,7 @@ void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -691,7 +691,7 @@ void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ) +int64 Texts_Pos (Texts_Reader *R, address *R__typ) { int64 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -729,7 +729,7 @@ void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 p static struct Scan__31 { Texts_Scanner *S; - LONGINT *S__typ; + address *S__typ; CHAR *ch; BOOLEAN *negE; int32 *e; @@ -756,7 +756,7 @@ static void ReadScaleFactor__32 (void) } } -void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) +void Texts_Scan (Texts_Scanner *S, address *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; @@ -962,7 +962,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) +void Texts_OpenWriter (Texts_Writer *W, address *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -973,22 +973,22 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1014,7 +1014,7 @@ void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1033,12 +1033,12 @@ void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ) +void Texts_WriteLn (Texts_Writer *W, address *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { int32 i; __DUP(s, s__len, CHAR); @@ -1050,7 +1050,7 @@ void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { int32 i; int64 x0; @@ -1085,7 +1085,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) { int32 i; int64 y; @@ -1108,7 +1108,7 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) { int32 e; REAL x0; @@ -1180,7 +1180,7 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; int32 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; @@ -1206,7 +1206,7 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) { int32 e, i; CHAR sign; @@ -1278,7 +1278,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int3 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { int32 i; CHAR d[8]; @@ -1290,7 +1290,7 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) { int32 e; LONGREAL x0; @@ -1362,7 +1362,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { int32 i; CHAR d[16]; @@ -1376,7 +1376,7 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - LONGINT *W__typ; + address *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; @@ -1389,7 +1389,7 @@ static void WritePair__44 (CHAR ch, int64 x) Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,9 +1413,9 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; @@ -1466,7 +1466,7 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, int64 pos, int64 span } } -static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1540,7 +1540,7 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { int32 tag; Files_ReadInt(&*r, r__typ, &tag); @@ -1614,9 +1614,9 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) { Files_Rider r1; int64 org, span; @@ -1646,7 +1646,7 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, int64 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 32047663..e85157ed 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -35,7 +35,7 @@ typedef } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, LONGINT *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); typedef struct Texts_ElemDesc { @@ -115,18 +115,18 @@ typedef import Texts_Elem Texts_new; -import LONGINT *Texts_FontDesc__typ; -import LONGINT *Texts_RunDesc__typ; -import LONGINT *Texts_ElemMsg__typ; -import LONGINT *Texts_ElemDesc__typ; -import LONGINT *Texts_FileMsg__typ; -import LONGINT *Texts_CopyMsg__typ; -import LONGINT *Texts_IdentifyMsg__typ; -import LONGINT *Texts_BufDesc__typ; -import LONGINT *Texts_TextDesc__typ; -import LONGINT *Texts_Reader__typ; -import LONGINT *Texts_Scanner__typ; -import LONGINT *Texts_Writer__typ; +import address *Texts_FontDesc__typ; +import address *Texts_RunDesc__typ; +import address *Texts_ElemMsg__typ; +import address *Texts_ElemDesc__typ; +import address *Texts_FileMsg__typ; +import address *Texts_CopyMsg__typ; +import address *Texts_IdentifyMsg__typ; +import address *Texts_BufDesc__typ; +import address *Texts_TextDesc__typ; +import address *Texts_Reader__typ; +import address *Texts_Scanner__typ; +import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); @@ -137,35 +137,35 @@ import void Texts_Delete (Texts_Text T, int64 beg, int64 end); import Texts_Text Texts_ElemBase (Texts_Elem E); import int64 Texts_ElemPos (Texts_Elem E); import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, LONGINT *r__typ, Texts_Text T); +import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, LONGINT *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, LONGINT *S__typ, Texts_Text T, int64 pos); -import void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ); -import int64 Texts_Pos (Texts_Reader *R, LONGINT *R__typ); -import void Texts_Read (Texts_Reader *R, LONGINT *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, LONGINT *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, LONGINT *R__typ); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); +import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, address *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ); -import void Texts_SetColor (Texts_Writer *W, LONGINT *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, LONGINT *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, LONGINT *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, int64 t, int64 d); -import void Texts_WriteElem (Texts_Writer *W, LONGINT *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, int64 x); -import void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, LONGINT *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, int32 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, int32 n, int32 k); -import void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, LONGINT *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Scan (Texts_Scanner *S, address *S__typ); +import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); +import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); +import void Texts_WriteLn (Texts_Writer *W, address *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 87812cc2..5c6cada1 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 897999f4..4bb09433 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 6ca6c961..759b613e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 1647c4fe..d6bc2194 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 0b905427..bff1c62c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8b57066f..bb55d599 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index e8809371..2bc7d18f 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/22] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 29b8c302..8059d5fb 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -698,7 +698,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; - OPM.WriteString("LONGINT *"); Ident(obj); OPM.WriteString(TagExt); + OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); base := NIL ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") @@ -726,7 +726,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString(", LONGINT "); LenList(obj, TRUE, showParamNames) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN - OPM.WriteString(", LONGINT *"); + OPM.WriteString(", address *"); IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END END ; IF (obj^.link = NIL) OR (obj^.link.mode = OPT.TProc) THEN EXIT END ; @@ -790,7 +790,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString('static ') ELSE OPM.WriteString(Export) END ; - OPM.WriteString("LONGINT *"); Andent(typ); OPM.WriteString(DynTypExt); + OPM.WriteString("address *"); Andent(typ); OPM.WriteString(DynTypExt); EndStat END ; n := n^.link diff --git a/src/system/Console.Mod b/src/system/Console.Mod index bf1c9a1d..6b35a090 100644 --- a/src/system/Console.Mod +++ b/src/system/Console.Mod @@ -65,7 +65,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Hex; PROCEDURE Read*(VAR ch: CHAR); - VAR n: SYSTEM.ADDRESS; error: Platform.ErrorCode; + VAR n: LONGINT; error: Platform.ErrorCode; BEGIN Flush(); error := Platform.ReadBuf(Platform.StdIn, ch, n); IF n # 1 THEN ch := 0X END diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index a6e5d399..f514c9cf 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -316,7 +316,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): SYSTEM.ADDRESS "(address)s.st_size"; +PROCEDURE -statsize(): LONGINT "(address)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN @@ -358,7 +358,7 @@ BEGIN END MTimeAsClock; -PROCEDURE Size*(h: FileHandle; VAR l: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN structstats; IF fstat(h) < 0 THEN RETURN err() END; @@ -368,16 +368,16 @@ END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT "read(fd, (void*)(address)(p), l)"; -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN n := readfile(h, p, l); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; BEGIN n := readfile(h, SYSTEM.ADR(b), LEN(b)); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index ddd85144..6ddf909a 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -243,10 +243,16 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CASECHK __HALT(-4) #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) + +//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) +//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) +#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) + #define __GUARDP(p, typ, level) ((typ*)(__ISP(p,typ,level)?p:(__HALT(-5),p))) #define __GUARDR(r, typ, level) (*((typ*)(__IS(r##__typ,typ,level)?r:(__HALT(-5),r)))) #define __GUARDA(p, typ, level) ((struct typ*)(__IS(__TYPEOF(p),typ,level)?p:(__HALT(-5),p))) diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 99e12608..260ca57c 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,7 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) -# MODEL=-O2 # Override model - build everything as S8,I16,L32. +#MODEL=-O2 # Override model - build everything as S8,I16,L32. From f1cbbdba285414314e76ede7516f7210d16e3cef Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 11:10:33 +0100 Subject: [PATCH 050/140] Simplify __TYPEOF. --- bootstrap/SYSTEM.h | 6 +----- src/system/SYSTEM.h | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 6ddf909a..7c55807b 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -244,12 +244,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) -//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - #define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) +#define __TYPEOF(p) (*(((address**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 6ddf909a..7c55807b 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -244,12 +244,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -//#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) -//#define __TYPEOF(p) ((address*)(address)(*(((LONGINT*)(p))-1))) -//#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) - #define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) ((address*)(address)(*(((address*)(p))-1))) +#define __TYPEOF(p) (*(((address**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) From 22a4f8e263cff9e49a9748e1db0f767f70ab8875 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 13:04:24 +0100 Subject: [PATCH 051/140] Use SYSTEM.ADDRESS in libraries. Build all with -O2. Support INC(a,b) for any int a,b that support a:=a+b. --- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPM.c | 6 +- bootstrap/unix-44/Platform.c | 6 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPM.c | 6 +- bootstrap/unix-48/Platform.c | 6 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-88/Configuration.c | 6 +- bootstrap/unix-88/Console.c | 42 ++-- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 186 ++++++++--------- bootstrap/unix-88/Files.h | 42 ++-- bootstrap/unix-88/Heap.c | 20 +- bootstrap/unix-88/Heap.h | 4 +- bootstrap/unix-88/Modules.c | 20 +- bootstrap/unix-88/Modules.h | 10 +- bootstrap/unix-88/OPB.c | 222 ++++++++++---------- bootstrap/unix-88/OPB.h | 6 +- bootstrap/unix-88/OPC.c | 228 ++++++++++----------- bootstrap/unix-88/OPC.h | 22 +- bootstrap/unix-88/OPM.c | 209 +++++++++---------- bootstrap/unix-88/OPM.h | 28 +-- bootstrap/unix-88/OPP.c | 88 ++++---- bootstrap/unix-88/OPS.c | 36 ++-- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 261 ++++++++++++------------ bootstrap/unix-88/OPT.h | 23 ++- bootstrap/unix-88/OPV.c | 144 ++++++------- bootstrap/unix-88/Platform.c | 266 ++++++++++++------------ bootstrap/unix-88/Platform.h | 88 ++++---- bootstrap/unix-88/Reals.c | 85 ++++---- bootstrap/unix-88/Reals.h | 14 +- bootstrap/unix-88/Strings.c | 68 +++---- bootstrap/unix-88/Strings.h | 12 +- bootstrap/unix-88/Texts.c | 230 ++++++++++----------- bootstrap/unix-88/Texts.h | 57 +++--- bootstrap/unix-88/Vishap.c | 28 +-- bootstrap/unix-88/errors.c | 6 +- bootstrap/unix-88/extTools.c | 10 +- bootstrap/unix-88/vt100.c | 102 +++++----- bootstrap/unix-88/vt100.h | 34 ++-- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPM.c | 6 +- bootstrap/windows-48/Platform.c | 24 ++- bootstrap/windows-48/Platform.h | 6 +- bootstrap/windows-88/Configuration.c | 6 +- bootstrap/windows-88/Console.c | 42 ++-- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 186 ++++++++--------- bootstrap/windows-88/Files.h | 42 ++-- bootstrap/windows-88/Heap.c | 20 +- bootstrap/windows-88/Heap.h | 4 +- bootstrap/windows-88/Modules.c | 20 +- bootstrap/windows-88/Modules.h | 10 +- bootstrap/windows-88/OPB.c | 222 ++++++++++---------- bootstrap/windows-88/OPB.h | 6 +- bootstrap/windows-88/OPC.c | 228 ++++++++++----------- bootstrap/windows-88/OPC.h | 22 +- bootstrap/windows-88/OPM.c | 209 +++++++++---------- bootstrap/windows-88/OPM.h | 28 +-- bootstrap/windows-88/OPP.c | 88 ++++---- bootstrap/windows-88/OPS.c | 36 ++-- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 261 ++++++++++++------------ bootstrap/windows-88/OPT.h | 23 ++- bootstrap/windows-88/OPV.c | 144 ++++++------- bootstrap/windows-88/Platform.c | 292 ++++++++++++++------------- bootstrap/windows-88/Platform.h | 92 ++++----- bootstrap/windows-88/Reals.c | 85 ++++---- bootstrap/windows-88/Reals.h | 14 +- bootstrap/windows-88/Strings.c | 68 +++---- bootstrap/windows-88/Strings.h | 12 +- bootstrap/windows-88/Texts.c | 230 ++++++++++----------- bootstrap/windows-88/Texts.h | 57 +++--- bootstrap/windows-88/Vishap.c | 28 +-- bootstrap/windows-88/errors.c | 6 +- bootstrap/windows-88/extTools.c | 10 +- bootstrap/windows-88/vt100.c | 102 +++++----- bootstrap/windows-88/vt100.h | 34 ++-- makefile | 8 +- src/compiler/OPB.Mod | 4 +- src/compiler/OPM.cmdln.Mod | 18 +- src/library/s3/ethMD5.Mod | 3 +- src/library/s3/ethZlibBuffers.Mod | 22 +- src/library/ulm/ulmIO.Mod | 20 +- src/library/ulm/ulmSYSTEM.Mod | 6 +- src/library/v4/Args.Mod | 8 +- src/library/v4/Printer.Mod | 24 +-- src/system/Platformunix.Mod | 4 +- src/system/Platformwindows.Mod | 26 ++- src/tools/make/vishap.make | 2 +- 92 files changed, 2752 insertions(+), 2695 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 9de57a27..2dacc4b8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, address l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -547,7 +547,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; address written; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bc487769..32d37057 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, address l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 9de57a27..2dacc4b8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, address l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -547,7 +547,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; address written; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bc487769..32d37057 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, address l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index fa5765f3..abdf151b 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 9d23b9fd..115e60f5 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,21 +1,21 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" static CHAR Console_line[128]; -static int32 Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (int64 i); +export void Console_Hex (int32 i); export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); @@ -25,7 +25,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - int32 error; + int16 error; error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } @@ -44,7 +44,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -57,17 +57,17 @@ void Console_String (CHAR *s, LONGINT s__len) void Console_Int (int64 i, int64 n) { CHAR s[32]; - int64 i1, k; - if (i == __LSHL(1, 63, 64)) { - __MOVE("8085774586302733229", s, 20); - k = 19; + int32 i1, k; + if (i == (int64)__LSHL(1, 31, 32)) { + __MOVE("8463847412", s, 11); + k = 10; } else { - i1 = __ABS((int64)i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __ABS(__VAL(int32, i)); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -76,7 +76,7 @@ void Console_Int (int64 i, int64 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } @@ -100,11 +100,11 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (int64 i) +void Console_Hex (int32 i) { - int32 k; + int16 k; int64 n; - k = -60; + k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { @@ -118,8 +118,8 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; - int32 error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); if (n != 1) { @@ -129,7 +129,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - int64 i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 64d39044..b08c93ea 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -11,7 +11,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (int64 i); +import void Console_Hex (int32 i); import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index c63ea9c4..e7eb30f3 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int64 org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,23 +33,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int64 fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - int32 swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; Files_Buffer buf; - int64 org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static int32 Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -62,50 +62,50 @@ export address *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int64 *t, int64 *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int64 Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, address *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); @@ -113,7 +113,7 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -142,7 +142,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int32 i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -167,7 +167,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int64 n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -199,7 +199,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -207,7 +207,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -219,7 +219,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int32 error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -256,7 +256,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int32 error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -280,7 +280,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int32 error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -300,8 +300,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int64 i; - int32 error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -317,9 +317,9 @@ void Files_Close (Files_File f) } } -int64 Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - int64 _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -342,9 +342,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - int32 i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -388,7 +388,7 @@ static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - int32 i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -404,7 +404,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - int32 i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -434,11 +434,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - int64 fd; - int32 pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int32 error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -513,9 +513,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int32 i; + int16 i; Platform_FileIdentity identity; - int32 error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -535,27 +535,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int64 *t, int64 *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - int32 error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, address *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { - int64 org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - int32 error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -615,7 +615,7 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { - int64 offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -637,9 +637,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -688,7 +688,7 @@ Files_File Files_Base (Files_Rider *r, address *r__typ) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int64 offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -706,9 +706,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -742,17 +742,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - int64 fdold, fdnew, n; - int32 error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -807,7 +807,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int32 idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -826,7 +826,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -835,7 +835,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int64 i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -854,26 +854,26 @@ void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; - int64 l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -893,7 +893,7 @@ void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -905,7 +905,7 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -921,26 +921,26 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; - int64 n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((int64)(ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { - int64 n; + int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } @@ -950,7 +950,7 @@ void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -971,8 +971,8 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; - int64 i; - i = (int64)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -996,7 +996,7 @@ void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1030,7 +1030,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int64 res; + int32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); @@ -1058,9 +1058,9 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 304), {256, 264, 272, 280, 296, -48}}; -__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; -__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 280), {232, 240, 248, 256, 272, -48}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 645bc846..a371a423 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -10,16 +10,18 @@ typedef typedef struct Files_FileDesc { - char _prvt0[232]; - int64 fd; - char _prvt1[64]; + int64 _prvt0; + char _prvt1[208]; + int32 fd; + char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; - char _prvt0[31]; + int64 _prvt0; + char _prvt1[8]; } Files_Rider; @@ -28,40 +30,40 @@ import address *Files_FileDesc__typ; import address *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -import void Files_GetDate (Files_File f, int64 *t, int64 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int64 Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, address *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c87cfd6d..16ae9ffd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -54,11 +54,11 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int64 refcnt; + int32 refcnt; Heap_Cmd cmds; address types; Heap_EnumProc enumPtrs; - int64 reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; @@ -70,9 +70,9 @@ static BOOLEAN Heap_firstTry; static address Heap_heap, Heap_heapend; export address Heap_heapsize; static Heap_FinNode Heap_fin; -static int32 Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int32 Heap_FileCount; +export int16 Heap_FileCount; export address *Heap_ModuleDesc__typ; export address *Heap_CmdDesc__typ; @@ -129,7 +129,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { - __SYSNEW(m, 80); + __SYSNEW(m, 64); } else { __NEW(m, Heap_ModuleDesc); } @@ -602,7 +602,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) while (sp != stack0) { __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == cand__len) { + if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -734,7 +734,7 @@ static void EnumPtrs(void (*P)(void*)) P(Heap_fin); } -__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; __TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; __TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b4829f2f..151a2d59 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -23,7 +23,7 @@ typedef typedef struct Heap_ModuleDesc { int64 _prvt0; - char _prvt1[72]; + char _prvt1[56]; } Heap_ModuleDesc; typedef @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; -import int32 Heap_FileCount; +import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 23fec310..f844dfa9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -31,15 +31,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - int64 reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export int32 Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int32 i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { @@ -160,7 +160,7 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7cafac5f..060208c6 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - char _prvt0[16]; + int32 types; + void (*enumPtrs)(void(*)(int32)); + char _prvt0[8]; } Modules_ModuleDesc; -import int32 Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 81077606..e09bf1b4 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ export void (*OPB_typSize)(OPT_Struct); -static int32 OPB_exp; +static int16 OPB_exp; static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,9 +25,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); @@ -56,17 +56,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int32 n); +static void OPB_err (int16 n); static int64 OPB_log (int64 x); -static void OPB_err (int32 n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -323,18 +323,18 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300, 64)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -355,7 +355,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010, 64))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -448,7 +448,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { @@ -459,7 +459,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -489,7 +489,7 @@ static int64 OPB_log (int64 x) return _o_result; } -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -529,7 +529,7 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) void OPB_MOp (int8 op, OPT_Node *x) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -555,12 +555,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70, 64)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0, 64)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -569,7 +569,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -583,7 +583,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70, 64)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -606,7 +606,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,7 +666,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int32 g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -730,7 +730,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0, 64)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -750,17 +750,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int32 *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int32 ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static int32 ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - int32 _o_result; - int32 res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -824,9 +824,9 @@ static int32 ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; int64 xv, yv; BOOLEAN temp; @@ -906,7 +906,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -937,7 +937,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -961,7 +961,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1015,7 +1015,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1037,7 +1037,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1065,28 +1065,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1104,7 +1104,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int32 f, g; + int16 f, g; int64 k; LONGREAL r; f = (*x)->typ->form; @@ -1119,7 +1119,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1128,8 +1128,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60, 64)) { - if (__IN(g, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1137,12 +1137,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1156,7 +1156,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int32 *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; @@ -1178,8 +1178,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1208,7 +1208,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; @@ -1238,7 +1238,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70, 64)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1247,23 +1247,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70, 64)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1324,7 +1324,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1, 64)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1340,7 +1340,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1407,7 +1407,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1426,7 +1426,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1450,7 +1450,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1459,7 +1459,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1501,10 +1501,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l, 64); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k, 64); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1526,7 +1526,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k,64); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1540,9 +1540,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int32 f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); @@ -1571,7 +1571,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a, 64) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1586,12 +1586,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30, 64)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70, 64)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1639,7 +1639,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1647,7 +1647,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1674,7 +1674,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1683,9 +1683,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int32 fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1712,7 +1712,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c, 64)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1745,7 +1745,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1820,7 +1820,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11, 64)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1881,7 +1881,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c, 64)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1892,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1916,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1931,7 +1931,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a, 64)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2009,7 +2009,7 @@ static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - int32 f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2053,11 +2053,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = OPM_Integer(x->conval->intval); typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2081,7 +2081,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2103,8 +2103,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2155,7 +2155,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff, 64)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2181,7 +2181,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -2251,10 +2251,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - int32 f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2296,9 +2296,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - int32 dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2362,17 +2362,17 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int32 f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 64)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c, 64)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2411,7 +2411,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2451,7 +2451,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { } else { OPB_err(123); @@ -2481,7 +2481,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,64); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6863fee8..dc0085af 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -37,10 +37,10 @@ import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index ee7f4baa..99353400 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -10,26 +10,26 @@ #include "OPT.h" -static int32 OPC_indentLevel; +static int16 OPC_indentLevel; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int64 *adr, int64 base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int64 OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int32 vis); -export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int64 caseVal, int16 form); static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int32 rel); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int32 form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -46,45 +46,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int32 vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int64 n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int32 vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int32 vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int32 count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int32 OPC_Length (CHAR *s, LONGINT s__len); -export int64 OPC_NofPtrs (OPT_Struct typ); -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int64 OPC_SizeAlignment (int64 size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int32 vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -95,14 +95,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int32 count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int32 i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -138,10 +138,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - int32 i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -157,10 +157,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) __DEL(s); } -static int32 OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -169,14 +169,14 @@ static int32 OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -185,10 +185,10 @@ static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int32 mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -225,10 +225,10 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int32 pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c, 64)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -261,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int32 form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -285,7 +285,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c, 64)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -319,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -327,8 +327,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int32 nofdims; - int64 off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +387,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int64 OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - int64 _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +430,11 @@ int64 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +510,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -608,7 +608,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - int64 mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -690,7 +690,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c, 64)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -733,7 +733,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - int32 i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -746,14 +746,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, int32 vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - int32 i; + int16 i; OPT_ConstExt ext = NIL; - int32 _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -762,7 +762,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -774,7 +774,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) } } -void OPC_TypeDefs (OPT_Object obj, int32 vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -806,7 +806,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int64 nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -821,7 +821,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -843,7 +843,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int64 *adr, int64 base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -863,11 +863,11 @@ void OPC_Align (int64 *adr, int64 base) } } -int64 OPC_SizeAlignment (int64 size) +int32 OPC_SizeAlignment (int32 size) { - int64 _o_result; - int64 alignment; - if (size < (int64)OPM_Alignment) { + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -879,10 +879,10 @@ int64 OPC_SizeAlignment (int64 size) return _o_result; } -int64 OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - int64 _o_result; - int64 alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -896,9 +896,9 @@ int64 OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - int64 adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -933,11 +933,11 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int64 gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -981,7 +981,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } if (last) { - adr = typ->size - (int64)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -993,16 +993,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } -static void OPC_IdentList (OPT_Object obj, int32 vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int32 lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1045,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1115,7 +1115,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1141,18 +1141,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int32 vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int32 vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1201,15 +1201,15 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int32 i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; - while (i <= 63) { - if (__IN(i, OPM_glbopt, 64)) { + while (i <= 31) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1352,7 +1352,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int64 n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1411,7 +1411,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1422,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 64) && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1455,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1497,7 +1497,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1537,7 +1537,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1585,7 +1585,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c, 64)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -1711,7 +1711,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int32 comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1740,10 +1740,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int32 i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1759,7 +1759,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int32 rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1803,15 +1803,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - int64 i; - int32 c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1831,7 +1831,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) __DEL(s); } -void OPC_Case (int64 caseVal, int32 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1869,12 +1869,12 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int64 n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int64 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1904,11 +1904,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int32 form) +void OPC_Constant (OPT_Const con, int16 form) { - int32 i; + int16 i; SET s; - int64 hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1933,13 +1933,13 @@ void OPC_Constant (OPT_Const con, int32 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 64; + i = 32; do { hex = 0; do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 64)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); @@ -1975,7 +1975,7 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - int32 h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6fe30a31..4215947f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (int64 *adr, int64 base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int64 OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int32 form); -import void OPC_Cmp (int32 rel); +import void OPC_Case (int64 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int32 form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int64 n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int32 count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); -import int64 OPC_NofPtrs (OPT_Struct typ); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int64 OPC_SizeAlignment (int64 size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int32 vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 3f07341b..366d6522 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -19,23 +19,24 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int64 OPM_curpos, OPM_errpos, OPM_breakpc; -export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int32 OPM_S; +static int16 OPM_S; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -44,25 +45,25 @@ static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int64 *fp, int64 val); -export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -export void OPM_FPrintReal (int64 *fp, REAL real); -export void OPM_FPrintSet (int64 *fp, SET set); +export void OPM_FPrint (int32 *fp, int64 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int32 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int32 n); +export int16 OPM_Integer (int64 n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int64 OPM_Longint (int64 n); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int32 n, int64 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -70,10 +71,10 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int64 bytecount); -export int64 OPM_SignedMinimum (int64 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int64 OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); @@ -92,9 +93,9 @@ export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int32 n); -static int64 OPM_minusop (int64 i); -static int64 OPM_power0 (int64 i, int64 j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -119,23 +120,23 @@ void OPM_LogWLn (void) Console_Ln(); } -int64 OPM_Longint (int64 n) -{ - int64 _o_result; - _o_result = (int64)n; - return _o_result; -} - -int32 OPM_Integer (int64 n) +int32 OPM_Longint (int64 n) { int32 _o_result; _o_result = __VAL(int32, n); return _o_result; } +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -219,23 +220,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = s[__X(i + 1, s__len)] - 48; - OPM_Alignment = s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -385,9 +386,9 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 64)) { - OPM_glbopt |= __SETOF(10,64); - OPM_opt |= __SETOF(10,64); + if (__IN(15, OPM_opt, 32)) { + OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -395,7 +396,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int64 beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -443,7 +444,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int32 i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -465,28 +466,28 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int32 n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int32 i; + int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -498,18 +499,18 @@ static void OPM_LogErrMsg (int32 n) static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -532,7 +533,7 @@ static void OPM_ShowLine (int64 pos) Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int32 i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -551,25 +552,25 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } -void OPM_Mark (int32 n, int64 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -621,49 +622,51 @@ void OPM_Mark (int32 n, int64 pos) } } -void OPM_err (int32 n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int64 *fp, int64 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } -void OPM_FPrintSet (int64 *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (int64)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (int64 *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - int32 i; - int64 l; - __GET((address)&real, i, int32); - l = i; + int16 i; + int32 l; + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int64 *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - int64 l, h; - OPM_FPrint(&*fp, __VAL(int64, lr)); + int32 l, h; + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int32)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int32)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -674,17 +677,17 @@ static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONG __DEL(name); } -static int64 OPM_minusop (int64 i) +static int32 OPM_minusop (int32 i) { - int64 _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static int64 OPM_power0 (int64 i, int64 j) +static int32 OPM_power0 (int32 i, int32 j) { - int64 _o_result; - int64 k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -721,7 +724,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int64 OPM_SignedMaximum (int64 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { int64 _o_result; int64 result; @@ -731,7 +734,7 @@ int64 OPM_SignedMaximum (int64 bytecount) return _o_result; } -int64 OPM_SignedMinimum (int64 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; @@ -746,7 +749,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } @@ -756,10 +759,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int64 OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - int64 _o_result; - int64 k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -776,7 +779,7 @@ int64 OPM_SymRInt64 (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -830,7 +833,7 @@ void OPM_SymWInt (int64 i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -845,7 +848,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -874,7 +877,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -884,7 +887,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -948,14 +951,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int32 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -1036,7 +1039,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int32 res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); @@ -1044,10 +1047,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 64)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1073,12 +1076,12 @@ void OPM_CloseFiles (void) static void EnumPtrs(void (*P)(void*)) { - __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); - __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); - __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); - __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); P(OPM_oldSFile); P(OPM_newSFile); P(OPM_HFile); @@ -1121,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 765b9680..a6b7990c 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int64 OPM_curpos, OPM_errpos, OPM_breakpc; -import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -20,29 +20,29 @@ import SET OPM_opt, OPM_glbopt; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int64 *fp, int64 val); -import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -import void OPM_FPrintReal (int64 *fp, REAL real); -import void OPM_FPrintSet (int64 *fp, SET set); +import void OPM_FPrint (int32 *fp, int64 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int32 OPM_Integer (int64 n); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int64 OPM_Longint (int64 n); -import void OPM_Mark (int32 n, int64 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int64 bytecount); -import int64 OPM_SignedMinimum (int64 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int64 OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); @@ -60,7 +60,7 @@ import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int32 n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9b25c35f..74f93e77 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -11,7 +11,7 @@ #include "OPT.h" struct OPP__1 { - int64 low, high; + int32 low, high; }; typedef @@ -19,9 +19,9 @@ typedef static int8 OPP_sym, OPP_level; -static int32 OPP_LoopLevel; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int32 OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export address *OPP__1__typ; @@ -29,10 +29,10 @@ export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int32 s); -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -51,19 +51,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int32 n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int32 n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (int32 s) +static void OPP_CheckSym (int16 s) { - if (OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -131,7 +131,7 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; int64 sf; @@ -162,7 +162,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int32 sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,7 +255,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; int64 n; - int32 sysflag; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c, 64)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -629,8 +629,8 @@ static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; int8 m; - int32 n; - m = (int8)((int32)(*x)->obj->adr); + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -931,7 +931,7 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int32 n; + int16 n; int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -996,9 +996,9 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1168,17 +1168,17 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int32 i, f; - int64 xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18, 64)) { + if (__IN(f, 0x18, 32)) { xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); @@ -1188,14 +1188,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1239,7 +1239,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP } static struct StatSeq__30 { - int64 *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1249,8 +1249,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int32 n; - int64 low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18, 64)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1333,7 +1333,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int64 pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1626,7 +1626,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int32 i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c, 64)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; @@ -1779,7 +1779,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; @@ -1880,7 +1880,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPP_FwdPtr, 64, P); } -__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-8}}; export void *OPP__init(void) { diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index cd24b8ee..0cac83bd 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -16,7 +16,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int32 OPS_numtyp; +export int16 OPS_numtyp; export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; @@ -28,17 +28,17 @@ static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); static void OPS_Str (int8 *sym); -static void OPS_err (int32 n); +static void OPS_err (int16 n); -static void OPS_err (int32 n) +static void OPS_err (int16 n) { OPM_err(n); } static void OPS_Str (int8 *sym) { - int32 i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -64,7 +64,7 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } @@ -72,7 +72,7 @@ static void OPS_Str (int8 *sym) static void OPS_Identifier (int8 *sym) { - int32 i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -91,10 +91,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int32 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int32 e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (int32 e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -113,14 +113,14 @@ static LONGREAL Ten__9 (int32 e) return _o_result; } -static int32 Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int32 _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -235,7 +235,7 @@ static void OPS_Number (void) do { n = Ord__7(OPS_ch, 0); OPM_Get(&OPS_ch); - if (e <= __DIV(2147483647 - n, 10)) { + if (e <= __DIV(32767 - n, 10)) { e = e * 10 + n; } else { OPS_err(203); diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bcc2ae4d..caef45f4 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -14,7 +14,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int32 OPS_numtyp; +import int16 OPS_numtyp; import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 41686385..d40808d2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -17,15 +17,16 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int64 reffp; - int32 ref; + int32 reffp; + int16 ref; int8 nofm; int8 locmno[64]; } OPT_ExpCtxt; @@ -38,12 +39,12 @@ typedef typedef struct OPT_ImpCtxt { - int64 nextTag, reffp; - int32 nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int64 pvfp[255]; + int32 pvfp[255]; int8 glbmno[64]; } OPT_ImpCtxt; @@ -67,20 +68,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int64 idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -97,7 +98,7 @@ export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int64 OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export address *OPT_ConstDesc__typ; @@ -110,22 +111,22 @@ export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int64 value); -static void OPT_EnterProc (OPS_Name name, int32 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int32 errcode); -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int64 f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); @@ -133,13 +134,13 @@ static OPT_Object OPT_InObj (int8 mno); static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int64 tag); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int32 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int64 size); +export int16 OPT_IntSize (int64 n); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (int8 class); @@ -147,27 +148,27 @@ export OPT_Object OPT_NewObj (void); export OPT_Struct OPT_NewStr (int8 form, int8 comp); export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); -static void OPT_OutMod (int32 mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); -static void OPT_err (int32 n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (int32 n) +static void OPT_err (int16 n) { OPM_err(n); } -int32 OPT_IntSize (int64 n) +int16 OPT_IntSize (int64 n) { - int32 _o_result; - int32 bytes; + int16 _o_result; + int16 bytes; if (n < 0) { n = -(n + 1); } @@ -179,7 +180,7 @@ int32 OPT_IntSize (int64 n) return _o_result; } -OPT_Struct OPT_IntType (int64 size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; if (size <= OPT_int8typ->size) { @@ -198,10 +199,10 @@ OPT_Struct OPT_IntType (int64 size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - int32 i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -323,15 +324,15 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt, 64); - OPT_findpc = __IN(8, opt, 64); - OPT_extsf = OPT_newsf || __IN(9, opt, 64); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } void OPT_Close (void) { - int32 i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -461,14 +462,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -506,7 +507,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -522,8 +523,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int64 idfp; - int32 f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -552,17 +553,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__13 { - int64 *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__13 *lnk; } *FPrintStr__13_s; -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__14(typ->link, adr, 0); @@ -592,7 +593,7 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -627,10 +628,10 @@ static void FPrintTProcs__18 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int32 f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int64 pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -658,7 +659,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c, 64)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -691,8 +692,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int64 fprint; - int32 f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -729,16 +730,16 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480, 64)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -749,9 +750,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int32 errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - int32 i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -841,7 +842,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -855,7 +856,7 @@ static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - int64 mn; + int32 mn; int8 i; mn = OPM_SymRInt(); if (mn == 0) { @@ -893,16 +894,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int64 f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - int32 i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -945,7 +946,7 @@ static void OPT_InConstant (int64 f, OPT_Const conval) static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int64 tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -973,7 +974,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1005,7 +1006,7 @@ static OPT_Object OPT_InFld (void) static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1030,7 +1031,7 @@ static OPT_Object OPT_InTProc (int8 mno) return _o_result; } -static OPT_Struct OPT_InTyp (int64 tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -1046,8 +1047,8 @@ static OPT_Struct OPT_InTyp (int64 tag) static void OPT_InStruct (OPT_Struct *typ) { int8 mno; - int32 ref; - int64 tag; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1103,7 +1104,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int32)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1228,11 +1229,11 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - int32 i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int64 tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1265,7 +1266,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int32)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1374,7 +1375,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -1384,7 +1385,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int32 mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1396,9 +1397,9 @@ static void OPT_OutMod (int32 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1428,7 +1429,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1583,7 +1584,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int32 f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1618,11 +1619,11 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int32 i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea, 64)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -1685,7 +1686,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1708,7 +1709,7 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int32 i; + int16 i; int8 nofmod; BOOLEAN done; OPT_symExtended = 0; @@ -1732,7 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { @@ -1762,7 +1763,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int64 value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1774,7 +1775,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int64 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1809,7 +1810,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int32 num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1849,46 +1850,46 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); - __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; -__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; -__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, - 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, - 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, - 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, - 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, - 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, - 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, - 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, - 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, - 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, - 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, - 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, - 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, - 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, - 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, - 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, - 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, - 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, - 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, - 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, - 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, - 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, - 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, - 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, - 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, - 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, - 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, - 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, - 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, - 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, - 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, - 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; -__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, + 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, + 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, + 400, 408, 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, + 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, + 656, 664, 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, + 784, 792, 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, + 912, 920, 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, + 1040, 1048, 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, + 1168, 1176, 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, + 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, + 1424, 1432, 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, + 1552, 1560, 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, + 1680, 1688, 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, + 1808, 1816, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, + 1936, 1944, 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, + 2064, 2072, 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, + 2192, 2200, 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, + 2320, 2328, 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, + 2448, 2456, 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, + 2576, 2584, 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, + 2704, 2712, 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, + 2832, 2840, 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, + 2960, 2968, 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, + 3088, 3096, 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, + 3216, 3224, 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, + 3344, 3352, 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, + 3472, 3480, 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, + 3600, 3608, 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, + 3728, 3736, 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, + 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, + 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; export void *OPT__init(void) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 697eb2c9..0bd1f189 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -46,20 +47,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[24]; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -82,7 +83,7 @@ import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int32 errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,15 +94,15 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int32 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int64 size); +import int16 OPT_IntSize (int64 n); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index b57b2868..8ef2c450 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -12,51 +12,51 @@ typedef struct OPV_ExitInfo { - int32 level, label; + int16 level, label; } OPV_ExitInfo; -static int32 OPV_stamp; -static int64 OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static int32 OPV_nofExitLabels; +static int16 OPV_nofExitLabels; export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int32 prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int64 size); -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); +static void OPV_ParIntLiteral (int64 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int64 from, int64 to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int32 prec); -static void OPV_expr (OPT_Node n, int32 prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); void OPV_TypSize (OPT_Struct typ) { - int32 f, c; - int64 offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -71,7 +71,7 @@ void OPV_TypSize (OPT_Struct typ) base = 1; } else { OPV_TypSize(btyp); - offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -99,7 +99,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -133,7 +133,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int64 oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -145,7 +145,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 64)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -169,7 +169,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int32 i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -199,7 +199,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int32 mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -225,12 +225,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26, 64)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0, 64)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -275,9 +275,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int32 _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -285,7 +285,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -294,7 +294,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c, 64)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -439,9 +439,9 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int32 prec) +static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60, 64)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -450,7 +450,7 @@ static void OPV_Entier (OPT_Node n, int32 prec) } } -static void OPV_SizeCast (int64 from, int64 to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { OPM_WriteString((CHAR*)"(int", 5); @@ -459,9 +459,9 @@ static void OPV_SizeCast (int64 from, int64 to) } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - int32 from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -471,7 +471,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -486,7 +486,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 64)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -509,7 +509,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15, 64)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -525,9 +525,9 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -542,18 +542,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) } } -static void OPV_design (OPT_Node n, int32 prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__27; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -570,7 +570,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c, 64)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -632,7 +632,7 @@ static void OPV_design (OPT_Node n, int32 prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int64)i < __ASHR(d->typ->size - 4, 2)) { + while (i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -649,10 +649,10 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -721,7 +721,7 @@ static void OPV_design (OPT_Node n, int32 prec) } } -static void OPV_ParIntLiteral (int64 n, int64 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { OPM_WriteInt(n); } @@ -729,7 +729,7 @@ static void OPV_ParIntLiteral (int64 n, int64 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int32 comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -743,7 +743,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c, 64)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -751,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else { - if ((__IN(comp, 0x0c, 64) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -821,9 +821,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, int32 prec) +static void OPV_expr (OPT_Node n, int16 prec) { - int32 class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -833,7 +833,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -913,18 +913,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1021,12 +1021,12 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18008000, 64)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); if (subclass == 15) { OPM_WriteInt(__ASHL(r->typ->size, 3)); @@ -1038,7 +1038,7 @@ static void OPV_expr (OPT_Node n, int32 prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100, 64)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1135,7 +1135,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1145,7 +1145,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int64 adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1196,7 +1196,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; int64 low, high; - int32 form, i; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1263,7 +1263,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int32 nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; @@ -1425,7 +1425,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1516,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 64)) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1582,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1618,7 +1618,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000, 64)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; @@ -1627,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } @@ -1635,7 +1635,7 @@ void OPV_Module (OPT_Node prog) OPV_stat(prog, NIL); } -__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-8}}; export void *OPV__init(void) { diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 27df644a..016d1d64 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -20,84 +20,84 @@ typedef typedef struct Platform_FileIdentity { - int64 volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; export address Platform_MainStackFrame; -export int64 Platform_HaltCode; -export int32 Platform_PID; +export int32 Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[256]; -export int32 Platform_ArgCount; +export int16 Platform_ArgCount; export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int64 Platform_TimeStart; -export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_nl[3]; export address *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int32 e); -export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int64 code); -export int32 Platform_Chdir (CHAR *n, LONGINT n__len); -export int32 Platform_Close (int64 h); -export BOOLEAN Platform_ConnectionFailed (int32 e); -export void Platform_Delay (int64 ms); -export BOOLEAN Platform_DifferentFilesystems (int32 e); -static void Platform_DisplayHaltCode (int64 code); -export int32 Platform_Error (void); -export void Platform_Exit (int32 code); -export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int64 *t, int64 *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int32 n, int64 *val); -export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, address argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -export BOOLEAN Platform_NoSuchDirectory (int32 e); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, address argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); -export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); -export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int32 Platform_Seek (int64 h, int64 offset, int32 whence); +export int16 Platform_Seek (int32 h, int32 offset, int16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int32 Platform_Size (int64 h, int64 *l); -export int32 Platform_Sync (int64 h); -export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int64 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int32 e); -export BOOLEAN Platform_TooManyFiles (int32 e); -export int32 Platform_Truncate (int64 h, int64 l); -export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, address p, address l); -static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 l); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, address p, int32 l); +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int64 l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (int64 l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -144,7 +144,7 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR @@ -169,49 +169,49 @@ extern void Heap_InitHeap(); #define Platform_unlink(n, n__len) unlink((char*)n) #define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) -BOOLEAN Platform_TooManyFiles (int32 e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (int32 e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (int32 e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_EXDEV(); return _o_result; } -BOOLEAN Platform_Inaccessible (int32 e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); return _o_result; } -BOOLEAN Platform_Absent (int32 e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ENOENT(); return _o_result; } -BOOLEAN Platform_TimedOut (int32 e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (int32 e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); @@ -230,7 +230,7 @@ void Platform_OSFree (address address) Platform_free(address); } -void Platform_Init (int32 argc, address argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -264,7 +264,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -273,10 +273,10 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int32 n, int64 *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - int64 k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -284,11 +284,11 @@ void Platform_GetIntArg (int32 n, int64 *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -299,10 +299,10 @@ void Platform_GetIntArg (int32 n, int64 *val) } } -int32 Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -331,64 +331,64 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d) +static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) { - *d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int64 *t, int64 *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int64 *sec, int64 *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int64 Platform_Time (void) +int32 Platform_Time (void) { - int64 _o_result; - int64 ms; + int32 _o_result; + int32 ms; Platform_gettimeval(); - ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (int64 ms) +void Platform_Delay (int32 ms) { - int64 s, ns; + int32 s, ns; s = __DIV(ms, 1000); - ns = __MOD(ms, 1000) * 1000000; + ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int32 Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int32 _o_result; + int16 _o_result; __DUP(cmd, cmd__len, CHAR); _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); return _o_result; } -int32 Platform_Error (void) +int16 Platform_Error (void) { - int32 _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -401,10 +401,10 @@ int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -417,10 +417,10 @@ int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int32 fd; + int16 _o_result; + int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { _o_result = Platform_err(); @@ -433,9 +433,9 @@ int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_Close (int64 h) +int16 Platform_Close (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_closefile(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -446,9 +446,9 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -461,9 +461,9 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { @@ -498,15 +498,15 @@ void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Pla (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int16 Platform_Size (int32 h, int32 *l) { - int32 _o_result; + int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { _o_result = Platform_err(); @@ -517,9 +517,9 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, address p, int64 l, int64 *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { - int32 _o_result; + int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; @@ -532,9 +532,9 @@ int32 Platform_Read (int64 h, address p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int32 _o_result; + int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; @@ -547,9 +547,9 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) __RETCHK; } -int32 Platform_Write (int64 h, address p, address l) +int16 Platform_Write (int32 h, address p, int32 l) { - int32 _o_result; + int16 _o_result; address written; written = Platform_writefile(h, p, l); if (written < 0) { @@ -562,9 +562,9 @@ int32 Platform_Write (int64 h, address p, address l) __RETCHK; } -int32 Platform_Sync (int64 h) +int16 Platform_Sync (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_fsync(h) < 0) { _o_result = Platform_err(); return _o_result; @@ -575,9 +575,9 @@ int32 Platform_Sync (int64 h) __RETCHK; } -int32 Platform_Seek (int64 h, int64 offset, int32 whence) +int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int32 _o_result; + int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { _o_result = Platform_err(); return _o_result; @@ -588,9 +588,9 @@ int32 Platform_Seek (int64 h, int64 offset, int32 whence) __RETCHK; } -int32 Platform_Truncate (int64 h, int64 l) +int16 Platform_Truncate (int32 h, int32 l) { - int32 _o_result; + int16 _o_result; if (Platform_ftruncate(h, l) < 0) { _o_result = Platform_err(); return _o_result; @@ -601,9 +601,9 @@ int32 Platform_Truncate (int64 h, int64 l) __RETCHK; } -int32 Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_unlink(n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -614,10 +614,10 @@ int32 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int32 _o_result; - int32 r; + int16 _o_result; + int16 r; r = Platform_chdir(n, n__len); Platform_getcwd((void*)Platform_CWD, 256); if (r < 0) { @@ -630,9 +630,9 @@ int32 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { _o_result = Platform_err(); return _o_result; @@ -643,7 +643,7 @@ int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int32 code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -658,15 +658,15 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int64 l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int64 l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -675,7 +675,7 @@ static void Platform_errint (int64 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int64 code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -731,7 +731,7 @@ static void Platform_DisplayHaltCode (int64 code) } } -void Platform_Halt (int64 code) +void Platform_Halt (int32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -744,10 +744,10 @@ void Platform_Halt (int64 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (int64 code) +void Platform_AssertFail (int32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -756,7 +756,7 @@ void Platform_AssertFail (int64 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -766,12 +766,12 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int32 i; + int16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } -__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-8}}; export void *Platform__init(void) { diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f44cd9e8..32d37057 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -7,75 +7,75 @@ typedef struct Platform_FileIdentity { - int64 volume, index, mtime; + int32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; import address Platform_MainStackFrame; -import int64 Platform_HaltCode; -import int32 Platform_PID; +import int32 Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[256]; -import int32 Platform_ArgCount; +import int16 Platform_ArgCount; import address Platform_ArgVector; -import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; import address *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int32 e); -import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int64 code); -import int32 Platform_Chdir (CHAR *n, LONGINT n__len); -import int32 Platform_Close (int64 h); -import BOOLEAN Platform_ConnectionFailed (int32 e); -import void Platform_Delay (int64 ms); -import BOOLEAN Platform_DifferentFilesystems (int32 e); -import int32 Platform_Error (void); -import void Platform_Exit (int32 code); -import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int64 *t, int64 *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int32 n, int64 *val); -import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, address argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -import BOOLEAN Platform_NoSuchDirectory (int32 e); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, address argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); -import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); -import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int32 Platform_Seek (int64 h, int64 offset, int32 whence); +import int16 Platform_Seek (int32 h, int32 offset, int16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int32 Platform_Size (int64 h, int64 *l); -import int32 Platform_Sync (int64 h); -import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int64 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int32 e); -import BOOLEAN Platform_TooManyFiles (int32 e); -import int32 Platform_Truncate (int64 h, int64 l); -import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, address p, address l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 l); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 7678a81e..fe93e8be 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -10,19 +10,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -export int32 Reals_Expo (REAL x); -export int32 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int32 ex); -export REAL Reals_Ten (int32 e); -export LONGREAL Reals_TenL (int32 e); -static CHAR Reals_ToHex (int32 i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (int32 e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -39,7 +39,7 @@ REAL Reals_Ten (int32 e) return _o_result; } -LONGREAL Reals_TenL (int32 e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -59,54 +59,67 @@ LONGREAL Reals_TenL (int32 e) __RETCHK; } -int32 Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 2, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, int32 ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int32 Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 6, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - int64 i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; - i = __ENTIER(x); - while (k < (int64)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + if (n > 9) { + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = (int32)__ENTIER(x); + } + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int32 i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -121,15 +134,15 @@ static CHAR Reals_ToHex (int32 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int32 i; - int64 l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; - while ((int64)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 4de192c6..e7cba0d8 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -import int32 Reals_Expo (REAL x); -import int32 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int32 ex); -import REAL Reals_Ten (int32 e); -import LONGREAL Reals_TenL (int32 e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 49fbdd21..427a0cc4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -11,22 +11,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -export int32 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -int32 Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; - while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,24 +36,24 @@ int32 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int64)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int64)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -64,10 +64,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int64)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int64)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -81,9 +81,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - int32 len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -96,7 +96,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int64)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -104,7 +104,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -112,12 +112,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - int32 len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int32)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA return; } i = 0; - while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -136,10 +136,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA __DEL(source); } -int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int32 _o_result; - int32 n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -174,7 +174,7 @@ int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -188,9 +188,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4dd0d2c3..44c51b2a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -import int32 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6403ce33..8c41a062 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -18,7 +18,7 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; @@ -41,26 +41,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int64 org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -69,7 +69,7 @@ typedef typedef struct Texts_BufDesc { - int64 len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -83,8 +83,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -99,7 +99,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -107,12 +107,12 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; Files_File file; - int64 org; + int32 org; } Texts_PieceDesc; typedef @@ -123,7 +123,7 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; } Texts_Reader; typedef @@ -134,10 +134,10 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -147,10 +147,10 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - int64 corg; + int32 corg; } Texts_TextDesc; typedef @@ -183,50 +183,50 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int64 beg, int64 end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int64 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, address *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, address *S__typ); export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); @@ -241,10 +241,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - int64 m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -274,7 +274,7 @@ static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int6 } } -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -373,11 +373,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -int64 Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - int64 _o_result; + int32 _o_result; Texts_Run u = NIL; - int64 pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -392,7 +392,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__t { Texts_Alien e = NIL; Files_Rider r; - int64 i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -468,10 +468,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int64 uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -502,11 +502,11 @@ void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int64 uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -525,7 +525,7 @@ void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int64 pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -540,10 +540,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int64 beg, int64 end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -565,10 +565,10 @@ void Texts_Delete (Texts_Text T, int64 beg, int64 end) } } -void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel, 64) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel, 64)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel, 64)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -621,7 +621,7 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; - int64 pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, address *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -732,7 +732,7 @@ static struct Scan__31 { address *S__typ; CHAR *ch; BOOLEAN *negE; - int32 *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -751,7 +751,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -761,8 +761,8 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) CHAR ch, term; BOOLEAN neg, negE, hex; int8 i, j, h; - int32 e; - int64 k; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -823,10 +823,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -838,13 +838,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -865,12 +865,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -897,12 +897,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -934,7 +934,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int64)(d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1040,7 +1040,7 @@ void Texts_WriteLn (Texts_Writer *W, address *W__typ) void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1052,7 +1052,7 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { - int32 i; + int16 i; int64 x0; CHAR a[24]; i = 0; @@ -1085,10 +1085,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { - int32 i; - int64 y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1108,9 +1108,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { - int32 e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1181,15 +1181,15 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; address *W__typ; - int32 *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int32 n); -static void seq__56 (CHAR ch, int32 n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, int32 n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1197,7 +1197,7 @@ static void seq__56 (CHAR ch, int32 n) } } -static void dig__54 (int32 n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1206,9 +1206,9 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { - int32 e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1280,7 +1280,7 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int3 void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { - int32 i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1290,9 +1290,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { - int32 e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1324,7 +1324,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int32)__ASHR((int64)(e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1364,7 +1364,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { - int32 i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1380,16 +1380,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int64 x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, int64 x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,14 +1413,14 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int64 org, ew, eh; + int32 org, ew, eh; int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); @@ -1471,7 +1471,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int64 org, pos, hlen, plen; + int32 org, pos, hlen, plen; int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; @@ -1490,7 +1490,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; T->head = u; @@ -1542,7 +1542,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { - int32 tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1557,7 +1557,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int64 hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Load0(&r, Files_Rider__typ, T); } else { __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; __NEW(p, Texts_PieceDesc); @@ -1614,12 +1614,12 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - int64 org, span; + int32 org, span; int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); @@ -1651,7 +1651,7 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int64 org, pos, delta, hlen, rlen; + int32 org, pos, delta, hlen, rlen; int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int32 i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); @@ -1803,16 +1803,16 @@ __TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; __TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; __TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; __TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; -__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; -__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 64), {0, 8, 24, 56, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 32), {16, -16}}; __TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; __TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; __TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; __TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; -__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; -__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 72), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 168), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 56), {0, 8, 32, 48, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 144), {0, 8, 24, 56, 64, -48}}; export void *Texts__init(void) { diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e85157ed..fa080b7f 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int64 len; - char _prvt0[8]; + int32 len; + int64 _prvt0; } Texts_BufDesc; typedef @@ -39,16 +39,17 @@ typedef typedef struct Texts_ElemDesc { - char _prvt0[40]; - int64 W, H; + int64 _prvt0; + char _prvt1[28]; + int32 W, H; Texts_Handler handle; - char _prvt1[8]; + char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,7 +70,7 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { @@ -77,7 +78,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; } Texts_Reader; typedef @@ -86,10 +87,10 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -99,9 +100,9 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; - char _prvt0[24]; + char _prvt0[20]; } Texts_TextDesc; typedef @@ -109,7 +110,7 @@ typedef Texts_Buffer buf; Texts_FontsFont fnt; int8 col, voff; - char _prvt0[54]; + char _prvt0[38]; } Texts_Writer; @@ -129,41 +130,41 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int64 beg, int64 end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int64 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, address *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, address *S__typ); import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 5c6cada1..1ec89e33 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +25,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (int32 sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 64)) { - if (__IN(14, OPM_opt, 64)) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } @@ -129,7 +129,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (int32 sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 4bb09433..0a40d5e9 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d6bc2194..8be0b63d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,10 +22,10 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int32 r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index bb55d599..4f6a6c9d 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -13,36 +13,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (int32 n); -export void vt100_CNL (int32 n); -export void vt100_CPL (int32 n); -export void vt100_CUB (int32 n); -export void vt100_CUD (int32 n); -export void vt100_CUF (int32 n); -export void vt100_CUP (int32 n, int32 m); -export void vt100_CUU (int32 n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (int32 n); -export void vt100_ED (int32 n); -export void vt100_EL (int32 n); -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int32 n, int32 m); -export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (int32 n); -export void vt100_SGR (int32 n); -export void vt100_SGR2 (int32 n, int32 m); -export void vt100_SU (int32 n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -54,15 +54,15 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) } } -void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int32 s, e; + int16 s, e; int8 maxLength; - maxLength = 20; - if (int_ == (-9223372036854775807-1)) { - __MOVE("-9223372036854775808", b, 21); - e = 20; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; } else { if (int_ < 0) { b[0] = '-'; @@ -73,7 +73,7 @@ void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); @@ -93,7 +93,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -106,7 +106,7 @@ static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -119,7 +119,7 @@ static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -135,82 +135,82 @@ static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int32 n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int32 n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int32 n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int32 n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int32 n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int32 n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int32 n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int32 n, int32 m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int32 n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int32 n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int32 n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int32 n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int32 n, int32 m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int32 n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int32 n, int32 m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int32 n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 2bc7d18f..94f8add4 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (int32 n); -import void vt100_CNL (int32 n); -import void vt100_CPL (int32 n); -import void vt100_CUB (int32 n); -import void vt100_CUD (int32 n); -import void vt100_CUF (int32 n); -import void vt100_CUP (int32 n, int32 m); -import void vt100_CUU (int32 n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (int32 n); -import void vt100_ED (int32 n); -import void vt100_EL (int32 n); -import void vt100_HVP (int32 n, int32 m); -import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (int32 n); -import void vt100_SGR (int32 n); -import void vt100_SGR2 (int32 n, int32 m); -import void vt100_SU (int32 n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index af4f4fc4..e09bf1b4 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 039d1c77..2769f708 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1124,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 54a94ae8..8aeae1b8 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -74,8 +74,8 @@ export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, address l, address *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -543,41 +543,43 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { int16 _o_result; int16 result; - *n = 0; - result = Platform_readfile(h, p, l, &*n); + int32 lengthread; + result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; int16 result; - *n = 0; - result = Platform_readfile(h, (address)b, b__len, &*n); + int32 lengthread; + result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 18ca5267..d62dd343 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -58,8 +58,8 @@ import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, address l, address *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index fa5765f3..abdf151b 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 939de5cc..7b492ced 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,21 +1,21 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" static CHAR Console_line[128]; -static int32 Console_pos; +static int16 Console_pos; export void Console_Bool (BOOLEAN b); export void Console_Char (CHAR ch); export void Console_Flush (void); -export void Console_Hex (int64 i); +export void Console_Hex (int32 i); export void Console_Int (int64 i, int64 n); export void Console_Ln (void); export void Console_Read (CHAR *ch); @@ -25,7 +25,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { - int32 error; + int16 error; error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } @@ -44,7 +44,7 @@ void Console_Char (CHAR ch) void Console_String (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] != 0x00) { @@ -57,17 +57,17 @@ void Console_String (CHAR *s, LONGINT s__len) void Console_Int (int64 i, int64 n) { CHAR s[32]; - int64 i1, k; - if (i == __LSHL(1, 63, 64)) { - __MOVE("8085774586302733229", s, 20); - k = 19; + int32 i1, k; + if (i == (int64)__LSHL(1, 31, 32)) { + __MOVE("8463847412", s, 11); + k = 10; } else { - i1 = __ABS((int64)i); - s[0] = (CHAR)(__MOD(i1, 10) + 48); + i1 = __ABS(__VAL(int32, i)); + s[0] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k = 1; while (i1 > 0) { - s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48); + s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); i1 = __DIV(i1, 10); k += 1; } @@ -76,7 +76,7 @@ void Console_Int (int64 i, int64 n) s[__X(k, 32)] = '-'; k += 1; } - while (n > k) { + while (n > (int64)k) { Console_Char(' '); n -= 1; } @@ -100,11 +100,11 @@ void Console_Bool (BOOLEAN b) } } -void Console_Hex (int64 i) +void Console_Hex (int32 i) { - int32 k; + int16 k; int64 n; - k = -60; + k = -28; while (k <= 0) { n = __MASK(__ASH(i, k), -16); if (n <= 9) { @@ -118,8 +118,8 @@ void Console_Hex (int64 i) void Console_Read (CHAR *ch) { - int64 n; - int32 error; + int32 n; + int16 error; Console_Flush(); error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); if (n != 1) { @@ -129,7 +129,7 @@ void Console_Read (CHAR *ch) void Console_ReadLine (CHAR *line, LONGINT line__len) { - int64 i; + int32 i; CHAR ch; Console_Flush(); i = 0; diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 64d39044..b08c93ea 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -11,7 +11,7 @@ import void Console_Bool (BOOLEAN b); import void Console_Char (CHAR ch); import void Console_Flush (void); -import void Console_Hex (int64 i); +import void Console_Hex (int32 i); import void Console_Int (int64 i, int64 n); import void Console_Ln (void); import void Console_Read (CHAR *ch); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 27fb9031..c30a1491 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int64 org, size; + int32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,23 +33,23 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int64 fd, len, pos; + int32 fd, len, pos; Files_Buffer bufs[4]; - int32 swapper, state; + int16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; Files_Buffer buf; - int64 org, offset; + int32 org, offset; } Files_Rider; static Files_File Files_files; -static int32 Files_tempno; +static int16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; @@ -62,50 +62,50 @@ export address *Files_Rider__typ; export Files_File Files_Base (Files_Rider *r, address *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int64 *t, int64 *d); +export void Files_GetDate (Files_File f, int32 *t, int32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int64 Files_Length (Files_File f); +export int32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int64 Files_Pos (Files_Rider *r, address *r__typ); +export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); @@ -113,7 +113,7 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT #define Files_IdxTrap() __HALT(-1) -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); Console_Ln(); @@ -142,7 +142,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int32 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int32 i, j; + int16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -167,7 +167,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int64 n, i, j; + int32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -199,7 +199,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na name[i + 5] = '.'; i += 6; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -207,7 +207,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na i += 1; n = Platform_PID; while (n > 0) { - name[i] = (CHAR)(__MOD(n, 10) + 48); + name[i] = (CHAR)((int)__MOD(n, 10) + 48); n = __DIV(n, 10); i += 1; } @@ -219,7 +219,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int32 error; + int16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -256,7 +256,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int32 error; + int16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -280,7 +280,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int32 error; + int16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -300,8 +300,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int64 i; - int32 error; + int32 i; + int16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -317,9 +317,9 @@ void Files_Close (Files_File f) } } -int64 Files_Length (Files_File f) +int32 Files_Length (Files_File f) { - int64 _o_result; + int32 _o_result; _o_result = f->len; return _o_result; } @@ -342,9 +342,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return _o_result; } -static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) { - int32 i; + int16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -388,7 +388,7 @@ static void Files_ScanPath (int32 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { BOOLEAN _o_result; - int32 i; + int16 i; CHAR ch; i = 0; ch = name[0]; @@ -404,7 +404,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File _o_result; Files_File f = NIL; - int32 i, error; + int16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -434,11 +434,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File _o_result; Files_File f = NIL; - int64 fd; - int32 pos; + int32 fd; + int16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int32 error; + int16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -513,9 +513,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int32 i; + int16 i; Platform_FileIdentity identity; - int32 error; + int16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -535,27 +535,27 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int64 *t, int64 *d) +void Files_GetDate (Files_File f, int32 *t, int32 *d) { Platform_FileIdentity identity; - int32 error; + int16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int64 Files_Pos (Files_Rider *r, address *r__typ) +int32 Files_Pos (Files_Rider *r, address *r__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*r).org + (*r).offset; return _o_result; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) +void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) { - int64 org, offset, i, n; + int32 org, offset, i, n; Files_Buffer buf = NIL; - int32 error; + int16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -615,7 +615,7 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos) void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) { - int64 offset; + int32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -637,9 +637,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -663,7 +663,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -688,7 +688,7 @@ Files_File Files_Base (Files_Rider *r, address *r__typ) void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int64 offset; + int32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -706,9 +706,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n) +void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) { - int64 xpos, min, restInBuf, offset; + int32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -728,7 +728,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -742,17 +742,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int32 *res) +void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) { - int64 fdold, fdnew, n; - int32 error, ignore; + int32 fdold, fdnew, n; + int16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -807,7 +807,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int32 idx, errcode; + int16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -826,7 +826,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -835,7 +835,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int64 i, j; + int32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -854,26 +854,26 @@ void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (int16)b[0] + __ASHL((int16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) { CHAR b[4]; - int64 l; + int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); *x = (SET)l; } @@ -893,7 +893,7 @@ void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -905,7 +905,7 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; CHAR ch; BOOLEAN b; i = 0; @@ -921,26 +921,26 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x) +void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; CHAR ch; - int64 n; + int32 n; s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((int64)(ch - 128), s); + while ((int16)ch >= 128) { + n += __ASH(((int16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((int64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); *x = n; } void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) { - int64 n; + int32 n; Files_ReadNum(&*R, R__typ, &n); *x = n; } @@ -950,7 +950,7 @@ void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -958,7 +958,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -971,8 +971,8 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x) void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) { CHAR b[4]; - int64 i; - i = (int64)x; + int32 i; + i = (int32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -996,7 +996,7 @@ void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) { - int32 i; + int16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -1004,7 +1004,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1030,7 +1030,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int64 res; + int32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); @@ -1058,9 +1058,9 @@ static void EnumPtrs(void (*P)(void*)) P(Files_SearchPath); } -__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 320), {272, 280, 288, 296, 312, -48}}; -__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4128), {0, -16}}; -__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 40), {16, -16}}; +__TDESC(Files_FileDesc, 1, 5) = {__TDFLDS("FileDesc", 288), {240, 248, 256, 264, 280, -48}}; +__TDESC(Files_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 4120), {0, -16}}; +__TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 399f2137..13fccd9a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -10,16 +10,18 @@ typedef typedef struct Files_FileDesc { - char _prvt0[248]; - int64 fd; - char _prvt1[64]; + int64 _prvt0; + char _prvt1[216]; + int32 fd; + char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int64 res; + int32 res; BOOLEAN eof; - char _prvt0[31]; + int64 _prvt0; + char _prvt1[8]; } Files_Rider; @@ -28,40 +30,40 @@ import address *Files_FileDesc__typ; import address *Files_Rider__typ; import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int32 *res); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int32 *res); -import void Files_GetDate (Files_File f, int64 *t, int64 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); +import void Files_GetDate (Files_File f, int32 *t, int32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int64 Files_Length (Files_File f); +import int32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int64 Files_Pos (Files_Rider *r, address *r__typ); +import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); +import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int64 *x); +import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int32 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int64 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); +import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int64 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); +import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); +import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c87cfd6d..16ae9ffd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -54,11 +54,11 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int64 refcnt; + int32 refcnt; Heap_Cmd cmds; address types; Heap_EnumProc enumPtrs; - int64 reserved1, reserved2; + int32 reserved1, reserved2; } Heap_ModuleDesc; @@ -70,9 +70,9 @@ static BOOLEAN Heap_firstTry; static address Heap_heap, Heap_heapend; export address Heap_heapsize; static Heap_FinNode Heap_fin; -static int32 Heap_lockdepth; +static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int32 Heap_FileCount; +export int16 Heap_FileCount; export address *Heap_ModuleDesc__typ; export address *Heap_CmdDesc__typ; @@ -129,7 +129,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { - __SYSNEW(m, 80); + __SYSNEW(m, 64); } else { __NEW(m, Heap_ModuleDesc); } @@ -602,7 +602,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) while (sp != stack0) { __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == cand__len) { + if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -734,7 +734,7 @@ static void EnumPtrs(void (*P)(void*)) P(Heap_fin); } -__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Heap_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Heap_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; __TDESC(Heap_FinDesc, 1, 1) = {__TDFLDS("FinDesc", 32), {0, -16}}; __TDESC(Heap__1, 1, 1) = {__TDFLDS("", 16), {8, -16}}; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b4829f2f..151a2d59 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -23,7 +23,7 @@ typedef typedef struct Heap_ModuleDesc { int64 _prvt0; - char _prvt1[72]; + char _prvt1[56]; } Heap_ModuleDesc; typedef @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; import address Heap_allocated, Heap_heapsize; -import int32 Heap_FileCount; +import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 23fec310..f844dfa9 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -31,15 +31,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - int64 reserved1, reserved2; + int32 types; + void (*enumPtrs)(void(*)(int32)); + int32 reserved1, reserved2; } Modules_ModuleDesc; -export int32 Modules_res; +export int16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int32 i, j; + int16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { @@ -160,7 +160,7 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } -__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 80), {0, 40, -24}}; +__TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7cafac5f..060208c6 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -28,15 +28,15 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int64 refcnt; + int32 refcnt; Modules_Cmd cmds; - int64 types; - void (*enumPtrs)(void(*)(int64)); - char _prvt0[16]; + int32 types; + void (*enumPtrs)(void(*)(int32)); + char _prvt0[8]; } Modules_ModuleDesc; -import int32 Modules_res; +import int16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 81077606..e09bf1b4 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ export void (*OPB_typSize)(OPT_Struct); -static int32 OPB_exp; +static int16 OPB_exp; static int64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int32 OPB_BoolToInt (BOOLEAN b); +static int16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,9 +25,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x); +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y); +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); @@ -56,17 +56,17 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -export void OPB_StPar0 (OPT_Node *par0, int32 fctno); +export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); export void OPB_StaticLink (int8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int32 n); +static void OPB_err (int16 n); static int64 OPB_log (int64 x); -static void OPB_err (int32 n) +static void OPB_err (int16 n) { OPM_err(n); } @@ -128,9 +128,9 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int32 OPB_BoolToInt (BOOLEAN b) +static int16 OPB_BoolToInt (BOOLEAN b) { - int32 _o_result; + int16 _o_result; if (b) { _o_result = 1; return _o_result; @@ -323,18 +323,18 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (f != 4 || __IN(y->class, 0x0300, 64)) { + } else if (f != 4 || __IN(y->class, 0x0300, 32)) { OPB_err(80); y->typ = OPT_inttyp; } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -355,7 +355,7 @@ void OPB_Field (OPT_Node *x, OPT_Object y) if ((*x)->class >= 7) { OPB_err(77); } - if ((y != NIL && __IN(y->mode, 0x2010, 64))) { + if ((y != NIL && __IN(y->mode, 0x2010, 32))) { OPB_BindNodes(2, y->typ, &*x, NIL); (*x)->obj = y; (*x)->readonly = (*x)->left->readonly || (y->vis == 2 && y->mnolev < 0); @@ -448,7 +448,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int32 f; + int16 f; int64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { @@ -459,7 +459,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -489,7 +489,7 @@ static int64 OPB_log (int64 x) return _o_result; } -static void OPB_CheckRealType (int32 f, int32 nr, OPT_Const x) +static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -529,7 +529,7 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) void OPB_MOp (int8 op, OPT_Node *x) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -555,12 +555,12 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x70, 64)) { + if (!__IN(f, 0x70, 32)) { OPB_err(96); } break; case 7: - if (__IN(f, 0xf0, 64)) { + if (__IN(f, 0xf0, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -569,7 +569,7 @@ void OPB_MOp (int8 op, OPT_Node *x) z->conval->intval = -z->conval->intval; OPB_SetIntType(z); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { z->conval->setval = ~z->conval->setval; @@ -583,7 +583,7 @@ void OPB_MOp (int8 op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x70, 64)) { + if (__IN(f, 0x70, 32)) { if (z->class == 7) { if (f == 4) { if (z->conval->intval == (-9223372036854775807-1)) { @@ -606,7 +606,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -666,7 +666,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int32 g; + int16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -730,7 +730,7 @@ void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames) static void OPB_CheckProc (OPT_Struct x, OPT_Object y) { - if (__IN(y->mode, 0x04c0, 64)) { + if (__IN(y->mode, 0x04c0, 32)) { if (y->mode == 6) { if (y->mnolev == 0) { y->mode = 7; @@ -750,17 +750,17 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int32 *f; + int16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int32 ConstCmp__14 (void); +static int16 ConstCmp__14 (void); -static int32 ConstCmp__14 (void) +static int16 ConstCmp__14 (void) { - int32 _o_result; - int32 res; + int16 _o_result; + int16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -824,9 +824,9 @@ static int32 ConstCmp__14 (void) return _o_result; } -static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Const xval = NIL, yval = NIL; int64 xv, yv; BOOLEAN temp; @@ -906,7 +906,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -937,7 +937,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(204); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) <= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 / (LONGREAL)__ABS(yval->realval)) { xval->realval = xval->realval * yval->realval; @@ -961,7 +961,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->realval = (LONGREAL)1; } x->typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = __ABS(yval->realval) >= (LONGREAL)1; if (temp || __ABS(xval->realval) <= 1.79769296342094e+308 * __ABS(yval->realval)) { xval->realval = xval->realval / yval->realval; @@ -1015,7 +1015,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(206); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 - yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 - yval->realval)) { xval->realval = xval->realval + yval->realval; @@ -1037,7 +1037,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) } else { OPB_err(207); } - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { temp = (yval->realval >= (LONGREAL)0 && xval->realval >= -1.79769296342094e+308 + yval->realval); if (temp || (yval->realval < (LONGREAL)0 && xval->realval <= 1.79769296342094e+308 + yval->realval)) { xval->realval = xval->realval - yval->realval; @@ -1065,28 +1065,28 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) xval->intval = OPB_BoolToInt(ConstCmp__14() != 9); break; case 11: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 11); } break; case 12: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 13); } break; case 13: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() == 13); } break; case 14: - if (__IN(f, 0x0a84, 64)) { + if (__IN(f, 0x0a84, 32)) { OPB_err(108); } else { xval->intval = OPB_BoolToInt(ConstCmp__14() != 11); @@ -1104,7 +1104,7 @@ static void OPB_ConstOp (int32 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int32 f, g; + int16 f, g; int64 k; LONGREAL r; f = (*x)->typ->form; @@ -1119,7 +1119,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->conval->intval = 1; } } - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { (*x)->conval->realval = (*x)->conval->intval; (*x)->conval->intval = -1; } else { @@ -1128,8 +1128,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(220); } } - } else if (__IN(f, 0x60, 64)) { - if (__IN(g, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { + if (__IN(g, 0x60, 32)) { OPB_CheckRealType(g, 203, (*x)->conval); } else { r = (*x)->conval->realval; @@ -1137,12 +1137,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = __ENTIER(r); + (*x)->conval->intval = (int32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1156,7 +1156,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int32 *f, *g; + int16 *f, *g; struct Op__38 *lnk; } *Op__38_s; @@ -1178,8 +1178,8 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; - yCharArr = (__IN((*y)->typ->comp, 0x0c, 64) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; + xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; + yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; if ((((xCharArr && *Op__38_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); *Op__38_s->g = 8; @@ -1208,7 +1208,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) { - int32 f, g; + int16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; @@ -1238,7 +1238,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 4: if ((g == 4 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x70, 64)) { + } else if (__IN(g, 0x70, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); @@ -1247,23 +1247,23 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 5: if (g == 4) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 6: - if (__IN(g, 0x70, 64)) { + if (__IN(g, 0x70, 32)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x60, 64)) { + } else if (__IN(g, 0x60, 32)) { OPB_Convert(&y, z->typ); } else { OPB_err(100); } break; case 9: - if (!__IN(g, 0x1800, 64)) { + if (!__IN(g, 0x1800, 32)) { OPB_err(100); } break; @@ -1324,7 +1324,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) y->obj = NIL; } } - } else if (!__IN(f, 0xe1, 64)) { + } else if (!__IN(f, 0xe1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1340,7 +1340,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_Convert(&z, OPT_realtyp); OPB_Convert(&y, OPT_realtyp); typ = OPT_realtyp; - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { if ((y->class == 7 && y->conval->realval == (LONGREAL)0)) { OPB_err(205); } @@ -1407,7 +1407,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(105); typ = OPT_undftyp; } @@ -1426,7 +1426,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0xf1, 64)) { + if (!__IN(f, 0xf1, 32)) { OPB_err(106); typ = OPT_undftyp; } @@ -1450,7 +1450,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x1aff, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x1aff, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); @@ -1459,7 +1459,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) NewOp__39(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x79, 64) || strings__41(&z, &y)) { + if (__IN(f, 0x79, 32) || strings__41(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1501,10 +1501,10 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { - (*x)->conval->setval = __SETRNG(k, l, 64); + (*x)->conval->setval = __SETRNG(k, l, 32); } else { OPB_err(201); - (*x)->conval->setval = __SETRNG(l, k, 64); + (*x)->conval->setval = __SETRNG(l, k, 32); } (*x)->obj = NIL; } else { @@ -1526,7 +1526,7 @@ void OPB_SetElem (OPT_Node *x) } else if ((*x)->class == 7) { k = (*x)->conval->intval; if ((0 <= k && k <= (int64)OPM_MaxSet)) { - (*x)->conval->setval = __SETOF(k,64); + (*x)->conval->setval = __SETOF(k,32); } else { OPB_err(202); } @@ -1540,9 +1540,9 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int32 f, g; + int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); OPM_LogWLn(); @@ -1550,7 +1550,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_LogWStr((CHAR*)"y.form = ", 10); OPM_LogWNum(y->form, 0); OPM_LogWLn(); @@ -1571,7 +1571,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 8: break; case 1: - if (!((__IN(g, 0x1a, 64) && y->size == 1))) { + if (!((__IN(g, 0x1a, 32) && y->size == 1))) { OPB_err(113); } break; @@ -1586,12 +1586,12 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) } break; case 5: - if (!__IN(g, 0x30, 64)) { + if (!__IN(g, 0x30, 32)) { OPB_err(113); } break; case 6: - if (!__IN(g, 0x70, 64)) { + if (!__IN(g, 0x70, 32)) { OPB_err(113); } break; @@ -1639,7 +1639,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) if (ynode->conval->intval2 > x->n) { OPB_err(114); } - } else if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + } else if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1647,7 +1647,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } } else if ((x->comp == 3 && x->BaseTyp == OPT_chartyp)) { - if ((__IN(y->comp, 0x0c, 64) && y->BaseTyp == OPT_chartyp)) { + if ((__IN(y->comp, 0x0c, 32) && y->BaseTyp == OPT_chartyp)) { } else { OPB_err(113); } @@ -1674,7 +1674,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 64))) && __IN(f, 0x70, 64))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0x30, 32))) && __IN(f, 0x70, 32))) { OPB_Convert(&ynode, x); } } @@ -1683,9 +1683,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int32 fctno) +void OPB_StPar0 (OPT_Node *par0, int16 fctno) { - int32 f; + int16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1712,7 +1712,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(76); } f = x->typ->BaseTyp->comp; - if (__IN(f, 0x1c, 64)) { + if (__IN(f, 0x1c, 32)) { if (f == 3) { typ = x->typ->BaseTyp; } @@ -1745,7 +1745,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 5: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x60, 64)) { + } else if (__IN(f, 0x60, 32)) { OPB_Convert(&x, OPT_linttyp); } else { OPB_err(111); @@ -1820,7 +1820,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x11, 64)) { + } else if (__IN(f, 0x11, 32)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1881,7 +1881,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } break; case 17: - if (!__IN(x->typ->comp, 0x0c, 64)) { + if (!__IN(x->typ->comp, 0x0c, 32)) { OPB_err(131); } break; @@ -1892,7 +1892,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) } if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (((!__IN(x->typ->comp, 0x0c, 64) || x->typ->BaseTyp->form != 3) && f != 8)) { + } else if (((!__IN(x->typ->comp, 0x0c, 32) || x->typ->BaseTyp->form != 3) && f != 8)) { OPB_err(111); } break; @@ -1916,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) if (x->class != 8) { OPB_err(110); x = OPB_NewIntConst(1); - } else if (__IN(f, 0x18fe, 64) || __IN(x->typ->comp, 0x14, 64)) { + } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { (*OPB_typSize)(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); @@ -1931,7 +1931,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x9a, 64)) { + } else if (!__IN(f, 0x9a, 32)) { OPB_err(111); } break; @@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -1957,7 +1957,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno) case 29: if (x->class != 8) { OPB_err(110); - } else if (__IN(f, 0x0501, 64) || x->typ->comp == 3) { + } else if (__IN(f, 0x0501, 32) || x->typ->comp == 3) { OPB_err(111); } break; @@ -2009,7 +2009,7 @@ static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) { - int32 f, L; + int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__52 _s; @@ -2024,7 +2024,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && f == 4)) { + if ((f == 4 && (x->class == 7 || (p->typ->form == 4 && x->typ->size <= p->typ->size)))) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2053,11 +2053,11 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } else if (x->typ->size == 1) { L = OPM_Integer(x->conval->intval); typ = p->typ; - while ((L > 0 && __IN(typ->comp, 0x0c, 64))) { + while ((L > 0 && __IN(typ->comp, 0x0c, 32))) { typ = typ->BaseTyp; L -= 1; } - if (L != 0 || !__IN(typ->comp, 0x0c, 64)) { + if (L != 0 || !__IN(typ->comp, 0x0c, 32)) { OPB_err(132); } else { x->obj = NIL; @@ -2081,7 +2081,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 18: if (OPB_NotVar(x)) { OPB_err(112); - } else if ((__IN(x->typ->comp, 0x0c, 64) && x->typ->BaseTyp->form == 3)) { + } else if ((__IN(x->typ->comp, 0x0c, 32) && x->typ->BaseTyp->form == 3)) { if (x->readonly) { OPB_err(76); } @@ -2103,8 +2103,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, __ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * __ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2155,7 +2155,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) case 24: case 25: case 26: case 27: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x18ff, 64)) { + } else if (__IN(f, 0x18ff, 32)) { if (fctno == 24 || fctno == 26) { if (OPB_NotVar(x)) { OPB_err(112); @@ -2181,7 +2181,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p->typ = OPT_booltyp; break; case 29: - if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 64)) || x->typ->comp == 3) { + if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } if ((x->class != 7 && x->typ->size < p->typ->size)) { @@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(126); } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_adrtyp->size)) { OPB_Convert(&x, OPT_adrtyp); - } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) { + } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) { OPB_err(111); x->typ = OPT_adrtyp; } @@ -2251,10 +2251,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__52_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) { OPT_Node node = NIL; - int32 f; + int16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2296,9 +2296,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) +void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) { - int32 dim; + int16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2362,17 +2362,17 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int32 f; + int16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c, 64) || !((__IN(atyp->form, 0x1e, 64) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 64)) { + if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { + if (__IN(18, OPM_opt, 32)) { OPB_err(-301); } } - } else if (__IN(f, 0x0c, 64)) { + } else if (__IN(f, 0x0c, 32)) { if (ftyp->comp == 3) { OPB_DynArrParCheck(ftyp, atyp, fvarpar); } else if (ftyp != atyp) { @@ -2411,7 +2411,7 @@ static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp) void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar) { - if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 64))) { + if (((*x)->obj != NIL && __IN((*x)->obj->mode, 0x22c0, 32))) { *fpar = (*x)->obj->link; if ((*x)->obj->mode == 13) { OPB_CheckReceiver(&(*x)->left, *fpar); @@ -2451,7 +2451,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 64) && ap->typ->size == 1)))) { + if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { } else { OPB_err(123); @@ -2481,7 +2481,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,64); + scope->link->conval->setval |= __SETOF(3,32); scope = scope->left; } } @@ -2576,7 +2576,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y) y->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(0)); } - if ((((((__IN((*x)->typ->comp, 0x0c, 64) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 64))) && y->typ->BaseTyp == OPT_chartyp)) { + if ((((((__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c, 32))) && y->typ->BaseTyp == OPT_chartyp)) { subcl = 18; } else { subcl = 0; diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6863fee8..dc0085af 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -37,10 +37,10 @@ import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int32 parno); -import void OPB_StPar0 (OPT_Node *par0, int32 fctno); +import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); +import void OPB_StPar0 (OPT_Node *par0, int16 fctno); import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int32 fctno, int32 n); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); import void OPB_StaticLink (int8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index ee7f4baa..99353400 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -10,26 +10,26 @@ #include "OPT.h" -static int32 OPC_indentLevel; +static int16 OPC_indentLevel; static int8 OPC_hashtab[105]; static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int64 *adr, int64 base); +export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int64 OPC_BaseAlignment (OPT_Struct typ); +export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int32 vis); -export void OPC_Case (int64 caseVal, int32 form); +static void OPC_CProcDefs (OPT_Object obj, int16 vis); +export void OPC_Case (int64 caseVal, int16 form); static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int32 rel); +export void OPC_Cmp (int16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int32 form); +export void OPC_Constant (OPT_Const con, int16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -46,45 +46,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign); -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int32 vis); +static void OPC_GenDynTypes (OPT_Node n, int16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int64 n); +export void OPC_Halt (int32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int32 vis); +static void OPC_IdentList (OPT_Object obj, int16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int32 vis); +static void OPC_IncludeImports (OPT_Object obj, int16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int32 count); +export void OPC_Indent (int16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int64 size); +export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int32 OPC_Length (CHAR *s, LONGINT s__len); -export int64 OPC_NofPtrs (OPT_Struct typ); -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len); +static int16 OPC_Length (CHAR *s, LONGINT s__len); +export int32 OPC_NofPtrs (OPT_Struct typ); +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); static void OPC_ProcPredefs (OPT_Object obj, int8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int64 OPC_SizeAlignment (int64 size); +export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int32 vis); +export void OPC_TypeDefs (OPT_Object obj, int16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -95,14 +95,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int32 count) +void OPC_Indent (int16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int32 i; + int16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -138,10 +138,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) { CHAR ch; - int32 i; + int16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -157,10 +157,10 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int64 x) __DEL(s); } -static int32 OPC_Length (CHAR *s, LONGINT s__len) +static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -169,14 +169,14 @@ static int32 OPC_Length (CHAR *s, LONGINT s__len) return _o_result; } -static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i, h; + int16 _o_result; + int16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -185,10 +185,10 @@ static int32 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int32 mode, level, h; + int16 mode, level, h; mode = obj->mode; level = obj->mnolev; - if ((__IN(mode, 0x62, 64) && level > 0) || __IN(mode, 0x14, 64)) { + if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { @@ -225,10 +225,10 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int32 pointers; + int16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { - if (__IN(typ->comp, 0x0c, 64)) { + if (__IN(typ->comp, 0x0c, 32)) { OPC_Stars(typ->BaseTyp, &*openClause); *openClause = typ->comp == 2; } else if (typ->form == 12) { @@ -261,7 +261,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int32 form, comp; + int16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -285,7 +285,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) break; } else if ((form == 11 && typ->BaseTyp->comp != 3)) { openClause = 1; - } else if (form == 12 || __IN(comp, 0x0c, 64)) { + } else if (form == 12 || __IN(comp, 0x0c, 32)) { if (openClause) { OPM_Write(')'); openClause = 0; @@ -319,7 +319,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (int64)(3 + OPM_currFile))) && obj->linkadr != 2); + _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); return _o_result; } @@ -327,8 +327,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int32 nofdims; - int64 off, n, dummy; + int16 nofdims; + int32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -387,12 +387,12 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int64 OPC_NofPtrs (OPT_Struct typ) +int32 OPC_NofPtrs (OPT_Struct typ) { - int64 _o_result; + int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n; + int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { _o_result = 1; return _o_result; @@ -430,11 +430,11 @@ int64 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int64 adr, int64 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int64 n, i; + int32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -510,7 +510,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -608,7 +608,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; - int64 mno; + int32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -690,7 +690,7 @@ static void OPC_DefineType (OPT_Struct str) if (str->BaseTyp->comp != 4) { OPC_DefineType(str->BaseTyp); } - } else if (__IN(str->comp, 0x0c, 64)) { + } else if (__IN(str->comp, 0x0c, 32)) { OPC_DefineType(str->BaseTyp); } else if (str->form == 12) { if (str->BaseTyp != OPT_notyp) { @@ -733,7 +733,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { BOOLEAN _o_result; - int32 i; + int16 i; BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; @@ -746,14 +746,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return _o_result; } -static void OPC_CProcDefs (OPT_Object obj, int32 vis) +static void OPC_CProcDefs (OPT_Object obj, int16 vis) { - int32 i; + int16 i; OPT_ConstExt ext = NIL; - int32 _for__9; + int16 _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -762,7 +762,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (int16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -774,7 +774,7 @@ static void OPC_CProcDefs (OPT_Object obj, int32 vis) } } -void OPC_TypeDefs (OPT_Object obj, int32 vis) +void OPC_TypeDefs (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -806,7 +806,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int64 nofptrs; + int32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -821,7 +821,7 @@ void OPC_TDescDecl (OPT_Struct typ) OPC_Str1((CHAR*)", #), {", 8, typ->size); nofptrs = 0; OPC_PutPtrOffsets(typ, 0, &nofptrs); - OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize)); + OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize)); OPC_EndStat(); } @@ -843,7 +843,7 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int64 *adr, int64 base) +void OPC_Align (int32 *adr, int32 base) { switch (base) { case 2: @@ -863,11 +863,11 @@ void OPC_Align (int64 *adr, int64 base) } } -int64 OPC_SizeAlignment (int64 size) +int32 OPC_SizeAlignment (int32 size) { - int64 _o_result; - int64 alignment; - if (size < (int64)OPM_Alignment) { + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { alignment = __ASHL(alignment, 1); @@ -879,10 +879,10 @@ int64 OPC_SizeAlignment (int64 size) return _o_result; } -int64 OPC_BaseAlignment (OPT_Struct typ) +int32 OPC_BaseAlignment (OPT_Struct typ) { - int64 _o_result; - int64 alignment; + int32 _o_result; + int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -896,9 +896,9 @@ int64 OPC_BaseAlignment (OPT_Struct typ) return _o_result; } -static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *curAlign) +static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { - int64 adr; + int32 adr; adr = off; OPC_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -933,11 +933,11 @@ static void OPC_FillGap (int64 gap, int64 off, int64 align, int64 *n, int64 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, int64 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int64 gap, adr, align, fldAlign; + int32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -981,7 +981,7 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } if (last) { - adr = typ->size - (int64)__ASHR(typ->sysflag, 8); + adr = typ->size - __ASHR(typ->sysflag, 8); if (adr == 0) { gap = 1; } else { @@ -993,16 +993,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int64 *off, int64 *n, i } } -static void OPC_IdentList (OPT_Object obj, int32 vis) +static void OPC_IdentList (OPT_Object obj, int16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int32 lastvis; + int16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { - if ((__IN(vis, 0x05, 64) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { + if (obj->typ != base || (int16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1045,7 +1045,7 @@ static void OPC_IdentList (OPT_Object obj, int32 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 64) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1115,7 +1115,7 @@ static void OPC_ProcPredefs (OPT_Object obj, int8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); - if ((((__IN(obj->mode, 0xc0, 64) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { + if ((((__IN(obj->mode, 0xc0, 32) && obj->vis >= vis)) && (obj->history != 4 || obj->mode == 6))) { if (vis == 1) { OPM_WriteString((CHAR*)"import ", 8); } else if (obj->vis == 0) { @@ -1141,18 +1141,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int32 vis) +static void OPC_IncludeImports (OPT_Object obj, int16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int32 vis) +static void OPC_GenDynTypes (OPT_Node n, int16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1201,15 +1201,15 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int32 i; + int16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); OPM_WriteString(Configuration_versionLong, 41); OPM_Write(' '); i = 0; - while (i <= 63) { - if (__IN(i, OPM_glbopt, 64)) { + while (i <= 31) { + if (__IN(i, OPM_glbopt, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1352,7 +1352,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int64 n; + int32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1411,7 +1411,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1422,20 +1422,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 64) && 0)) { + if ((__IN(10, OPM_opt, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1455,7 +1455,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); @@ -1497,7 +1497,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int32 dim; + int16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1537,7 +1537,7 @@ void OPC_EnterProc (OPT_Object proc) } var = proc->link; while (var != NIL) { - if ((((__IN(var->typ->comp, 0x0c, 64) && var->mode == 1)) && var->typ->sysflag == 0)) { + if ((((__IN(var->typ->comp, 0x0c, 32) && var->mode == 1)) && var->typ->sysflag == 0)) { OPC_BegStat(); if (var->typ->comp == 2) { OPM_WriteString((CHAR*)"__DUPARR(", 10); @@ -1585,7 +1585,7 @@ void OPC_EnterProc (OPT_Object proc) OPM_Write('.'); OPC_Ident(var); OPM_WriteString((CHAR*)" = ", 4); - if (__IN(var->typ->comp, 0x0c, 64)) { + if (__IN(var->typ->comp, 0x0c, 32)) { OPM_WriteString((CHAR*)"(void*)", 8); } else if (var->mode != 2) { OPM_Write('&'); @@ -1711,7 +1711,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int32 comp, level; + int16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1740,10 +1740,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int32 i; + int16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((int16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1759,7 +1759,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int32 rel) +void OPC_Cmp (int16 rel) { switch (rel) { case 9: @@ -1803,15 +1803,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) { - int64 i; - int32 c; + int32 i; + int16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (int16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1831,7 +1831,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int64 l) __DEL(s); } -void OPC_Case (int64 caseVal, int32 form) +void OPC_Case (int64 caseVal, int16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1869,12 +1869,12 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int64 n) +void OPC_Halt (int32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int64 size) +void OPC_IntLiteral (int64 n, int32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { OPM_WriteString((CHAR*)"((int", 6); @@ -1904,11 +1904,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int32 form) +void OPC_Constant (OPT_Const con, int16 form) { - int32 i; + int16 i; SET s; - int64 hex; + int32 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1933,13 +1933,13 @@ void OPC_Constant (OPT_Const con, int32 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 64; + i = 32; do { hex = 0; do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 64)) { + if (__IN(i, s, 32)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); @@ -1975,7 +1975,7 @@ static void Enter__49 (CHAR *s, LONGINT s__len); static void Enter__49 (CHAR *s, LONGINT s__len) { - int32 h; + int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6fe30a31..4215947f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -9,16 +9,16 @@ -import void OPC_Align (int64 *adr, int64 base); +import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int64 OPC_BaseAlignment (OPT_Struct typ); +import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int32 form); -import void OPC_Cmp (int32 rel); +import void OPC_Case (int64 caseVal, int16 form); +import void OPC_Cmp (int16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int32 form); +import void OPC_Constant (OPT_Const con, int16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -31,19 +31,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int64 n); +import void OPC_Halt (int32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int32 count); +import void OPC_Indent (int16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int64 size); +import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); -import int64 OPC_NofPtrs (OPT_Struct typ); +import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int64 OPC_SizeAlignment (int64 size); +import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int32 vis); +import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 3f07341b..366d6522 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -19,23 +19,24 @@ typedef static CHAR OPM_SourceFileName[256]; -export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int64 OPM_curpos, OPM_errpos, OPM_breakpc; -export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export int32 OPM_curpos, OPM_errpos, OPM_breakpc; +export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; +static int64 OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int32 OPM_S; +static int16 OPM_S; static CHAR OPM_OBERON[1024]; static CHAR OPM_MODULES[1024]; @@ -44,25 +45,25 @@ static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int64 *fp, int64 val); -export void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -export void OPM_FPrintReal (int64 *fp, REAL real); -export void OPM_FPrintSet (int64 *fp, SET set); +export void OPM_FPrint (int32 *fp, int64 val); +export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +export void OPM_FPrintReal (int32 *fp, REAL real); +export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align); +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int32 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int32 n); +export int16 OPM_Integer (int64 n); +static void OPM_LogErrMsg (int16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int64 OPM_Longint (int64 n); +export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int32 n, int64 pos); +export void OPM_Mark (int16 n, int64 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -70,10 +71,10 @@ export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int64 bytecount); -export int64 OPM_SignedMinimum (int64 bytecount); +export int64 OPM_SignedMaximum (int32 bytecount); +export int64 OPM_SignedMinimum (int32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int64 OPM_SymRInt (void); +export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); @@ -92,9 +93,9 @@ export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int32 n); -static int64 OPM_minusop (int64 i); -static int64 OPM_power0 (int64 i, int64 j); +export void OPM_err (int16 n); +static int32 OPM_minusop (int32 i); +static int32 OPM_power0 (int32 i, int32 j); void OPM_LogW (CHAR ch) @@ -119,23 +120,23 @@ void OPM_LogWLn (void) Console_Ln(); } -int64 OPM_Longint (int64 n) -{ - int64 _o_result; - _o_result = (int64)n; - return _o_result; -} - -int32 OPM_Integer (int64 n) +int32 OPM_Longint (int64 n) { int32 _o_result; _o_result = __VAL(int32, n); return _o_result; } +int16 OPM_Integer (int64 n) +{ + int16 _o_result; + _o_result = __VAL(int16, n); + return _o_result; +} + static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -219,23 +220,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = s[__X(i + 1, s__len)] - 48; - OPM_Alignment = s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = s[__X(i, s__len)] - 48; + OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = s[__X(i, s__len)] - 48; + OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (int16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -385,9 +386,9 @@ void OPM_InitOptions (void) s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 64)) { - OPM_glbopt |= __SETOF(10,64); - OPM_opt |= __SETOF(10,64); + if (__IN(15, OPM_opt, 32)) { + OPM_glbopt |= __SETOF(10,32); + OPM_opt |= __SETOF(10,32); } OPM_GetProperties(); } @@ -395,7 +396,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int64 beg, end, time; + int32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -443,7 +444,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int32 i, j; + int16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -465,28 +466,28 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int32 n) +static void OPM_LogErrMsg (int16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int32 i; + int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -498,18 +499,18 @@ static void OPM_LogErrMsg (int32 n) static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) { CHAR ch, cheol; - if (pos < OPM_ErrorLineStartPos) { + if (pos < (int64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < OPM_ErrorLineLimitPos) { + if (pos < (int64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -532,7 +533,7 @@ static void OPM_ShowLine (int64 pos) Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int32 i; + int16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -551,25 +552,25 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= OPM_ErrorLineLimitPos) { + if (pos >= (int64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos); + i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } -void OPM_Mark (int32 n, int64 pos) +void OPM_Mark (int16 n, int64 pos) { if (pos == -1) { pos = 0; @@ -621,49 +622,51 @@ void OPM_Mark (int32 n, int64 pos) } } -void OPM_err (int32 n) +void OPM_err (int16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int64 *fp, int64 val) +void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64); + *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); } -void OPM_FPrintSet (int64 *fp, SET set) +void OPM_FPrintSet (int32 *fp, SET set) { - OPM_FPrint(&*fp, (int64)set); + OPM_FPrint(&*fp, (int32)set); } -void OPM_FPrintReal (int64 *fp, REAL real) +void OPM_FPrintReal (int32 *fp, REAL real) { - int32 i; - int64 l; - __GET((address)&real, i, int32); - l = i; + int16 i; + int32 l; + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int64 *fp, LONGREAL lr) +void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { - int64 l, h; - OPM_FPrint(&*fp, __VAL(int64, lr)); + int32 l, h; + __GET((address)&lr, l, int32); + __GET((address)&lr + 4, h, int32); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align) +static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) { __DUP(name, name__len, CHAR); if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (int32)(*S).i; + *size = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (int32)(*S).i; + *align = (int16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -674,17 +677,17 @@ static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONG __DEL(name); } -static int64 OPM_minusop (int64 i) +static int32 OPM_minusop (int32 i) { - int64 _o_result; + int32 _o_result; _o_result = -i; return _o_result; } -static int64 OPM_power0 (int64 i, int64 j) +static int32 OPM_power0 (int32 i, int32 j) { - int64 _o_result; - int64 k, p; + int32 _o_result; + int32 k, p; k = 1; p = i; do { @@ -721,7 +724,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWLn(); } -int64 OPM_SignedMaximum (int64 bytecount) +int64 OPM_SignedMaximum (int32 bytecount) { int64 _o_result; int64 result; @@ -731,7 +734,7 @@ int64 OPM_SignedMaximum (int64 bytecount) return _o_result; } -int64 OPM_SignedMinimum (int64 bytecount) +int64 OPM_SignedMinimum (int32 bytecount) { int64 _o_result; _o_result = -OPM_SignedMaximum(bytecount) - 1; @@ -746,7 +749,7 @@ static void OPM_GetProperties (void) OPM_MinLReal = -OPM_MaxLReal; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { OPM_VerboseListSizes(); } } @@ -756,10 +759,10 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int64 OPM_SymRInt (void) +int32 OPM_SymRInt (void) { - int64 _o_result; - int64 k; + int32 _o_result; + int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); _o_result = k; return _o_result; @@ -776,7 +779,7 @@ int64 OPM_SymRInt64 (void) void OPM_SymRSet (SET *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } void OPM_SymRReal (REAL *r) @@ -830,7 +833,7 @@ void OPM_SymWInt (int64 i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } void OPM_SymWReal (REAL r) @@ -845,7 +848,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { Files_Register(OPM_newSFile); } } @@ -874,7 +877,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -884,7 +887,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -948,14 +951,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int32 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) { + int16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt(__ENTIER(r)); + OPM_WriteInt((int32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -1036,7 +1039,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int32 res; + int16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); @@ -1044,10 +1047,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 64)) { + } else if (!__IN(10, OPM_opt, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1073,12 +1076,12 @@ void OPM_CloseFiles (void) static void EnumPtrs(void (*P)(void*)) { - __ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P); + __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P); - __ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P); - __ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P); - __ENUMR(OPM_R, Files_Rider__typ, 40, 3, P); + __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); + __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); + __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); + __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); P(OPM_oldSFile); P(OPM_newSFile); P(OPM_HFile); @@ -1121,8 +1124,8 @@ export void *OPM__init(void) OPM_AddressSize = 8; OPM_Alignment = 8; OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 765b9680..a6b7990c 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -6,12 +6,12 @@ #include "SYSTEM.h" -import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int64 OPM_curpos, OPM_errpos, OPM_breakpc; -import int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import int32 OPM_curpos, OPM_errpos, OPM_breakpc; +import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import SET OPM_opt, OPM_glbopt; @@ -20,29 +20,29 @@ import SET OPM_opt, OPM_glbopt; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int64 *fp, int64 val); -import void OPM_FPrintLReal (int64 *fp, LONGREAL lr); -import void OPM_FPrintReal (int64 *fp, REAL real); -import void OPM_FPrintSet (int64 *fp, SET set); +import void OPM_FPrint (int32 *fp, int64 val); +import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); +import void OPM_FPrintReal (int32 *fp, REAL real); +import void OPM_FPrintSet (int32 *fp, SET set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int32 OPM_Integer (int64 n); +import int16 OPM_Integer (int64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int64 OPM_Longint (int64 n); -import void OPM_Mark (int32 n, int64 pos); +import int32 OPM_Longint (int64 n); +import void OPM_Mark (int16 n, int64 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int64 bytecount); -import int64 OPM_SignedMinimum (int64 bytecount); +import int64 OPM_SignedMaximum (int32 bytecount); +import int64 OPM_SignedMinimum (int32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int64 OPM_SymRInt (void); +import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); @@ -60,7 +60,7 @@ import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int32 n); +import void OPM_err (int16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9b25c35f..74f93e77 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -11,7 +11,7 @@ #include "OPT.h" struct OPP__1 { - int64 low, high; + int32 low, high; }; typedef @@ -19,9 +19,9 @@ typedef static int8 OPP_sym, OPP_level; -static int32 OPP_LoopLevel; +static int16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int32 OPP_nofFwdPtr; +static int16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; export address *OPP__1__typ; @@ -29,10 +29,10 @@ export address *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int32 s); -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_); +static void OPP_CheckSym (int16 s); +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); @@ -51,19 +51,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int32 n); +static void OPP_err (int16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int32 n) +static void OPP_err (int16 n) { OPM_err(n); } -static void OPP_CheckSym (int32 s) +static void OPP_CheckSym (int16 s) { - if (OPP_sym == s) { + if ((int16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -94,7 +94,7 @@ static void OPP_qualident (OPT_Object *id) obj->adr = 0; } else { lev = obj->mnolev; - if ((__IN(obj->mode, 0x06, 64) && lev != OPP_level)) { + if ((__IN(obj->mode, 0x06, 32) && lev != OPP_level)) { obj->leaf = 0; if (lev > 0) { OPB_StaticLink(OPP_level - lev); @@ -131,7 +131,7 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int32 *sysflag, int32 default_) +static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) { OPT_Node x = NIL; int64 sf; @@ -162,7 +162,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int32 sysflag; + int16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,7 +255,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; int64 n; - int32 sysflag; + int16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -325,7 +325,7 @@ static void OPP_PointerType (OPT_Struct *typ) } else { OPP_qualident(&id); if (id->mode == 5) { - if (__IN(id->typ->comp, 0x1c, 64)) { + if (__IN(id->typ->comp, 0x1c, 32)) { (*typ)->BaseTyp = id->typ; } else { (*typ)->BaseTyp = OPT_undftyp; @@ -338,7 +338,7 @@ static void OPP_PointerType (OPT_Struct *typ) } } else { OPP_Type(&(*typ)->BaseTyp, &OPT_notyp); - if (!__IN((*typ)->BaseTyp->comp, 0x1c, 64)) { + if (!__IN((*typ)->BaseTyp->comp, 0x1c, 32)) { (*typ)->BaseTyp = OPT_undftyp; OPP_err(57); } @@ -629,8 +629,8 @@ static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; int8 m; - int32 n; - m = (int8)((int32)(*x)->obj->adr); + int16 n; + m = (int8)((int16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -931,7 +931,7 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int32 n; + int16 n; int64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; @@ -966,7 +966,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); } static void GetParams__21 (void) @@ -996,9 +996,9 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1041,7 +1041,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1075,7 +1075,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1118,7 +1118,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) } else { OPP_err(38); } - if ((__IN(mode, 0x0600, 64) && !OPT_SYSimported)) { + if ((__IN(mode, 0x0600, 32) && !OPT_SYSimported)) { OPP_err(135); } OPS_Get(&OPP_sym); @@ -1135,7 +1135,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 64))) && !__IN(1, fwd->conval->setval, 64))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { @@ -1168,17 +1168,17 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int32 i, f; - int64 xval, yval; + int16 i, f; + int32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x18, 64)) { + if (__IN(f, 0x18, 32)) { xval = OPM_Longint(x->conval->intval); } else { OPP_err(61); @@ -1188,14 +1188,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((int16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if ((y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1239,7 +1239,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int32 *n, OPP } static struct StatSeq__30 { - int64 *pos; + int32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1249,8 +1249,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int32 n; - int64 low, high; + int16 n; + int32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1258,7 +1258,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x18, 64)) { + } else if (!__IN((*x)->typ->form, 0x18, 32)) { OPP_err(125); } OPP_CheckSym(25); @@ -1333,7 +1333,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int64 pos; + int32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1626,7 +1626,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int32 i; + int16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1675,7 +1675,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) if (obj->typ->strobj == NIL) { obj->typ->strobj = obj; } - if (__IN(obj->typ->comp, 0x1c, 64)) { + if (__IN(obj->typ->comp, 0x1c, 32)) { i = 0; while (i < OPP_nofFwdPtr) { typ = OPP_FwdPtr[__X(i, 64)]; @@ -1779,7 +1779,7 @@ void OPP_Module (OPT_Node *prog, SET opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int64 c; + int32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; @@ -1880,7 +1880,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPP_FwdPtr, 64, P); } -__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 16), {-8}}; +__TDESC(OPP__1, 1, 0) = {__TDFLDS("", 8), {-8}}; export void *OPP__init(void) { diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index cd24b8ee..0cac83bd 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -16,7 +16,7 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int32 OPS_numtyp; +export int16 OPS_numtyp; export int64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; @@ -28,17 +28,17 @@ static void OPS_Identifier (int8 *sym); export void OPS_Init (void); static void OPS_Number (void); static void OPS_Str (int8 *sym); -static void OPS_err (int32 n); +static void OPS_err (int16 n); -static void OPS_err (int32 n) +static void OPS_err (int16 n) { OPM_err(n); } static void OPS_Str (int8 *sym) { - int32 i; + int16 i; CHAR och; i = 0; och = OPS_ch; @@ -64,7 +64,7 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (int16)OPS_str[0]; } else { *sym = 37; } @@ -72,7 +72,7 @@ static void OPS_Str (int8 *sym) static void OPS_Identifier (int8 *sym) { - int32 i; + int16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -91,10 +91,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int32 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int32 e); +static int16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (int16 e); -static LONGREAL Ten__9 (int32 e) +static LONGREAL Ten__9 (int16 e) { LONGREAL _o_result; LONGREAL x, p; @@ -113,14 +113,14 @@ static LONGREAL Ten__9 (int32 e) return _o_result; } -static int32 Ord__7 (CHAR ch, BOOLEAN hex) +static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int32 _o_result; + int16 _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (int16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((int16)ch - 65) + 10; return _o_result; } else { OPS_err(2); @@ -132,7 +132,7 @@ static int32 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int32 i, m, n, d, e; + int16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -235,7 +235,7 @@ static void OPS_Number (void) do { n = Ord__7(OPS_ch, 0); OPM_Get(&OPS_ch); - if (e <= __DIV(2147483647 - n, 10)) { + if (e <= __DIV(32767 - n, 10)) { e = e * 10 + n; } else { OPS_err(203); diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bcc2ae4d..caef45f4 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -14,7 +14,7 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int32 OPS_numtyp; +import int16 OPS_numtyp; import int64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 41686385..d40808d2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -17,15 +17,16 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int64 reffp; - int32 ref; + int32 reffp; + int16 ref; int8 nofm; int8 locmno[64]; } OPT_ExpCtxt; @@ -38,12 +39,12 @@ typedef typedef struct OPT_ImpCtxt { - int64 nextTag, reffp; - int32 nofr, minr, nofm; + int32 nextTag, reffp; + int16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int64 pvfp[255]; + int32 pvfp[255]; int8 glbmno[64]; } OPT_ImpCtxt; @@ -67,20 +68,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int64 idfp, pbfp, pvfp; + int32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -97,7 +98,7 @@ export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int64 OPT_nofhdfld; +static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; export address *OPT_ConstDesc__typ; @@ -110,22 +111,22 @@ export address *OPT_ExpCtxt__typ; export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int64 value); -static void OPT_EnterProc (OPS_Name name, int32 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, int32 value); +static void OPT_EnterProc (OPS_Name name, int16 num); +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int32 errcode); -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, int16 errcode); +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int64 f, OPT_Const conval); +static void OPT_InConstant (int32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); static void OPT_InMod (int8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); @@ -133,13 +134,13 @@ static OPT_Object OPT_InObj (int8 mno); static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int64 tag); +static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int32 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int64 size); +export int16 OPT_IntSize (int64 n); +export OPT_Struct OPT_IntType (int32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); export OPT_Node OPT_NewNode (int8 class); @@ -147,27 +148,27 @@ export OPT_Object OPT_NewObj (void); export OPT_Struct OPT_NewStr (int8 form, int8 comp); export void OPT_OpenScope (int8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr); -static void OPT_OutMod (int32 mno); +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); +static void OPT_OutMod (int16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); -static void OPT_err (int32 n); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +static void OPT_err (int16 n); -static void OPT_err (int32 n) +static void OPT_err (int16 n) { OPM_err(n); } -int32 OPT_IntSize (int64 n) +int16 OPT_IntSize (int64 n) { - int32 _o_result; - int32 bytes; + int16 _o_result; + int16 bytes; if (n < 0) { n = -(n + 1); } @@ -179,7 +180,7 @@ int32 OPT_IntSize (int64 n) return _o_result; } -OPT_Struct OPT_IntType (int64 size) +OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; if (size <= OPT_int8typ->size) { @@ -198,10 +199,10 @@ OPT_Struct OPT_IntType (int64 size) return _o_result; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; - int32 i; + int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -323,15 +324,15 @@ void OPT_Init (OPS_Name name, SET opt) __COPY(name, OPT_topScope->name, 256); OPT_GlbMod[0] = OPT_topScope; OPT_nofGmod = 1; - OPT_newsf = __IN(4, opt, 64); - OPT_findpc = __IN(8, opt, 64); - OPT_extsf = OPT_newsf || __IN(9, opt, 64); + OPT_newsf = __IN(4, opt, 32); + OPT_findpc = __IN(8, opt, 32); + OPT_extsf = OPT_newsf || __IN(9, opt, 32); OPT_sfpresent = 1; } void OPT_Close (void) { - int32 i; + int16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -461,14 +462,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (int16)ch); i += 1; } while (!(ch == 0x00)); } @@ -506,7 +507,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -522,8 +523,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int64 idfp; - int32 f, c; + int32 idfp; + int16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -552,17 +553,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__13 { - int64 *pbfp, *pvfp; + int32 *pbfp, *pvfp; struct FPrintStr__13 *lnk; } *FPrintStr__13_s; -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__14(typ->link, adr, 0); @@ -592,7 +593,7 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -627,10 +628,10 @@ static void FPrintTProcs__18 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int32 f, c; + int16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int64 pbfp, pvfp; + int32 pbfp, pvfp; struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -658,7 +659,7 @@ void OPT_FPrintStr (OPT_Struct typ) pvfp = pbfp; } } else if (f == 12) { - } else if (__IN(c, 0x0c, 64)) { + } else if (__IN(c, 0x0c, 32)) { OPT_FPrintStr(btyp); OPM_FPrint(&pbfp, btyp->pvfp); pvfp = pbfp; @@ -691,8 +692,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int64 fprint; - int32 f, m; + int32 fprint; + int16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -729,16 +730,16 @@ void OPT_FPrintObj (OPT_Object obj) OPM_FPrint(&fprint, obj->vis); OPT_FPrintStr(obj->typ); OPM_FPrint(&fprint, obj->typ->pbfp); - } else if (__IN(obj->mode, 0x0480, 64)) { + } else if (__IN(obj->mode, 0x0480, 32)) { OPT_FPrintSign(&fprint, obj->typ, obj->link); } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (int16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -749,9 +750,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int32 errcode) +void OPT_FPrintErr (OPT_Object obj, int16 errcode) { - int32 i, j; + int16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -841,7 +842,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -855,7 +856,7 @@ static void OPT_InMod (int8 *mno) { OPT_Object head = NIL; OPS_Name name; - int64 mn; + int32 mn; int8 i; mn = OPM_SymRInt(); if (mn == 0) { @@ -893,16 +894,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int64 f, OPT_Const conval) +static void OPT_InConstant (int32 f, OPT_Const conval) { CHAR ch; - int32 i; + int16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (int16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -945,7 +946,7 @@ static void OPT_InConstant (int64 f, OPT_Const conval) static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int64 tag; + int32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -973,7 +974,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1005,7 +1006,7 @@ static OPT_Object OPT_InFld (void) static OPT_Object OPT_InTProc (int8 mno) { OPT_Object _o_result; - int64 tag; + int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1030,7 +1031,7 @@ static OPT_Object OPT_InTProc (int8 mno) return _o_result; } -static OPT_Struct OPT_InTyp (int64 tag) +static OPT_Struct OPT_InTyp (int32 tag) { OPT_Struct _o_result; if (tag == 4) { @@ -1046,8 +1047,8 @@ static OPT_Struct OPT_InTyp (int64 tag) static void OPT_InStruct (OPT_Struct *typ) { int8 mno; - int32 ref; - int64 tag; + int16 ref; + int32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1103,7 +1104,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int32)OPM_SymRInt(); + (*typ)->sysflag = (int16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1228,11 +1229,11 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { OPT_Object _o_result; - int32 i, s; + int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int64 tag; + int32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1265,7 +1266,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int32)OPM_SymRInt(); + s = (int16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1374,7 +1375,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int32 i; + int16 i; CHAR ch; i = 0; do { @@ -1384,7 +1385,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int32 mno) +static void OPT_OutMod (int16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1396,9 +1397,9 @@ static void OPT_OutMod (int32 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) { - int64 i, j, n; + int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1428,7 +1429,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr) } } -static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1583,7 +1584,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int32 f; + int16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1618,11 +1619,11 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int32 i, j; + int16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); - if (__IN(obj->mode, 0x06ea, 64)) { + if (__IN(obj->mode, 0x06ea, 32)) { if (obj->history == 4) { OPT_FPrintErr(obj, 250); } else if (obj->vis != 0) { @@ -1685,7 +1686,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (int16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1708,7 +1709,7 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int32 i; + int16 i; int8 nofmod; BOOLEAN done; OPT_symExtended = 0; @@ -1732,7 +1733,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 64); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { @@ -1762,7 +1763,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int64 value) +static void OPT_EnterBoolConst (OPS_Name name, int32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1774,7 +1775,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int64 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1809,7 +1810,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int32 num) +static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1849,46 +1850,46 @@ static void EnumPtrs(void (*P)(void*)) __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); - __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); + __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; -__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 344), {0, 8, 16, 24, 304, 312, -56}}; -__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 104), {80, 88, 96, -32}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; +__TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; -__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 6216), {32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, - 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, 272, 280, - 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, 400, 408, - 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, 528, 536, - 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, 656, 664, - 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, 784, 792, - 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, 912, 920, - 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, 1040, 1048, - 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, 1168, 1176, - 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, 1296, 1304, - 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, 1424, 1432, - 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, 1552, 1560, - 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, 1680, 1688, - 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, 1808, 1816, - 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, 1936, 1944, - 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, 2064, 2072, - 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2200, - 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, 2320, 2328, - 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, 2448, 2456, - 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, 2576, 2584, - 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, 2704, 2712, - 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, 2832, 2840, - 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, 2960, 2968, - 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, 3088, 3096, - 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, 3216, 3224, - 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, 3344, 3352, - 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, 3472, 3480, - 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, 3600, 3608, - 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, 3728, 3736, - 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, 3856, 3864, - 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, 3984, 3992, - 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, 4096, 4104, -4088}}; -__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 80), {-8}}; +__TDESC(OPT_ImpCtxt, 1, 510) = {__TDFLDS("ImpCtxt", 5184), {16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, + 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 264, + 272, 280, 288, 296, 304, 312, 320, 328, 336, 344, 352, 360, 368, 376, 384, 392, + 400, 408, 416, 424, 432, 440, 448, 456, 464, 472, 480, 488, 496, 504, 512, 520, + 528, 536, 544, 552, 560, 568, 576, 584, 592, 600, 608, 616, 624, 632, 640, 648, + 656, 664, 672, 680, 688, 696, 704, 712, 720, 728, 736, 744, 752, 760, 768, 776, + 784, 792, 800, 808, 816, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 904, + 912, 920, 928, 936, 944, 952, 960, 968, 976, 984, 992, 1000, 1008, 1016, 1024, 1032, + 1040, 1048, 1056, 1064, 1072, 1080, 1088, 1096, 1104, 1112, 1120, 1128, 1136, 1144, 1152, 1160, + 1168, 1176, 1184, 1192, 1200, 1208, 1216, 1224, 1232, 1240, 1248, 1256, 1264, 1272, 1280, 1288, + 1296, 1304, 1312, 1320, 1328, 1336, 1344, 1352, 1360, 1368, 1376, 1384, 1392, 1400, 1408, 1416, + 1424, 1432, 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1496, 1504, 1512, 1520, 1528, 1536, 1544, + 1552, 1560, 1568, 1576, 1584, 1592, 1600, 1608, 1616, 1624, 1632, 1640, 1648, 1656, 1664, 1672, + 1680, 1688, 1696, 1704, 1712, 1720, 1728, 1736, 1744, 1752, 1760, 1768, 1776, 1784, 1792, 1800, + 1808, 1816, 1824, 1832, 1840, 1848, 1856, 1864, 1872, 1880, 1888, 1896, 1904, 1912, 1920, 1928, + 1936, 1944, 1952, 1960, 1968, 1976, 1984, 1992, 2000, 2008, 2016, 2024, 2032, 2040, 2048, 2056, + 2064, 2072, 2080, 2088, 2096, 2104, 2112, 2120, 2128, 2136, 2144, 2152, 2160, 2168, 2176, 2184, + 2192, 2200, 2208, 2216, 2224, 2232, 2240, 2248, 2256, 2264, 2272, 2280, 2288, 2296, 2304, 2312, + 2320, 2328, 2336, 2344, 2352, 2360, 2368, 2376, 2384, 2392, 2400, 2408, 2416, 2424, 2432, 2440, + 2448, 2456, 2464, 2472, 2480, 2488, 2496, 2504, 2512, 2520, 2528, 2536, 2544, 2552, 2560, 2568, + 2576, 2584, 2592, 2600, 2608, 2616, 2624, 2632, 2640, 2648, 2656, 2664, 2672, 2680, 2688, 2696, + 2704, 2712, 2720, 2728, 2736, 2744, 2752, 2760, 2768, 2776, 2784, 2792, 2800, 2808, 2816, 2824, + 2832, 2840, 2848, 2856, 2864, 2872, 2880, 2888, 2896, 2904, 2912, 2920, 2928, 2936, 2944, 2952, + 2960, 2968, 2976, 2984, 2992, 3000, 3008, 3016, 3024, 3032, 3040, 3048, 3056, 3064, 3072, 3080, + 3088, 3096, 3104, 3112, 3120, 3128, 3136, 3144, 3152, 3160, 3168, 3176, 3184, 3192, 3200, 3208, + 3216, 3224, 3232, 3240, 3248, 3256, 3264, 3272, 3280, 3288, 3296, 3304, 3312, 3320, 3328, 3336, + 3344, 3352, 3360, 3368, 3376, 3384, 3392, 3400, 3408, 3416, 3424, 3432, 3440, 3448, 3456, 3464, + 3472, 3480, 3488, 3496, 3504, 3512, 3520, 3528, 3536, 3544, 3552, 3560, 3568, 3576, 3584, 3592, + 3600, 3608, 3616, 3624, 3632, 3640, 3648, 3656, 3664, 3672, 3680, 3688, 3696, 3704, 3712, 3720, + 3728, 3736, 3744, 3752, 3760, 3768, 3776, 3784, 3792, 3800, 3808, 3816, 3824, 3832, 3840, 3848, + 3856, 3864, 3872, 3880, 3888, 3896, 3904, 3912, 3920, 3928, 3936, 3944, 3952, 3960, 3968, 3976, + 3984, 3992, 4000, 4008, 4016, 4024, 4032, 4040, 4048, 4056, 4064, 4072, 4080, 4088, -4088}}; +__TDESC(OPT_ExpCtxt, 1, 0) = {__TDFLDS("ExpCtxt", 72), {-8}}; export void *OPT__init(void) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 697eb2c9..0bd1f189 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -15,7 +15,8 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval, intval2; + int64 intval; + int32 intval2; SET setval; LONGREAL realval; } OPT_ConstDesc; @@ -46,20 +47,20 @@ typedef BOOLEAN leaf; int8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int64 fprint; + int32 fprint; OPT_Struct typ; OPT_Const conval; - int64 adr, linkadr; - int32 x; + int32 adr, linkadr; + int16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { int8 form, comp, mno, extlev; - int32 ref, sysflag; - int64 n, size, align, txtpos; + int16 ref, sysflag; + int32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[24]; + char _prvt0[16]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -82,7 +83,7 @@ import address *OPT_NodeDesc__typ; import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int32 errcode); +import void OPT_FPrintErr (OPT_Object obj, int16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -93,15 +94,15 @@ import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int32 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int64 size); +import int16 OPT_IntSize (int64 n); +import OPT_Struct OPT_IntType (int32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index b57b2868..8ef2c450 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -12,51 +12,51 @@ typedef struct OPV_ExitInfo { - int32 level, label; + int16 level, label; } OPV_ExitInfo; -static int32 OPV_stamp; -static int64 OPV_recno; +static int16 OPV_stamp; +static int32 OPV_recno; static OPV_ExitInfo OPV_exit; -static int32 OPV_nofExitLabels; +static int16 OPV_nofExitLabels; export address *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int32 prec); +static void OPV_Entier (OPT_Node n, int16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); static void OPV_Len (OPT_Node n, int64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int64 size); -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp); +static void OPV_ParIntLiteral (int64 n, int32 size); +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int64 from, int64 to); +static void OPV_SizeCast (int32 from, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int32 prec); -static void OPV_expr (OPT_Node n, int32 prec); +static void OPV_design (OPT_Node n, int16 prec); +static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); void OPV_TypSize (OPT_Struct typ) { - int32 f, c; - int64 offset, size, base, fbase, off0; + int16 f, c; + int32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -71,7 +71,7 @@ void OPV_TypSize (OPT_Struct typ) base = 1; } else { OPV_TypSize(btyp); - offset = btyp->size - (int64)__ASHR(btyp->sysflag, 8); + offset = btyp->size - __ASHR(btyp->sysflag, 8); base = btyp->align; } fld = typ->link; @@ -99,7 +99,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int32)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -133,7 +133,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int64 oldPos; + int32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -145,7 +145,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 64)) { + if (!__IN(2, obj->conval->setval, 32)) { OPM_err(119); } } else { @@ -169,7 +169,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int32 i, j, k; + int16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -199,7 +199,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int32 mode; + int16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -225,12 +225,12 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte OPV_TypSize(obj->typ); } if (!exported) { - if ((__IN(mode, 0x60, 64) && obj->mnolev > 0)) { + if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { OPV_Stamp(obj->name); } - if (__IN(mode, 0x26, 64)) { + if (__IN(mode, 0x26, 32)) { obj->scope = outerScope; - } else if (__IN(mode, 0x26c0, 64)) { + } else if (__IN(mode, 0x26c0, 32)) { if (obj->conval->setval == 0x0) { OPM_err(129); } @@ -275,9 +275,9 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp) +static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int32 _o_result; + int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: @@ -285,7 +285,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { _o_result = 10; return _o_result; } else { @@ -294,7 +294,7 @@ static int32 OPV_Precedence (int32 class, int32 subclass, int32 form, int32 comp } break; case 1: - if (__IN(comp, 0x0c, 64)) { + if (__IN(comp, 0x0c, 32)) { _o_result = 10; return _o_result; } else { @@ -439,9 +439,9 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int32 prec) +static void OPV_Entier (OPT_Node n, int16 prec) { - if (__IN(n->typ->form, 0x60, 64)) { + if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); OPV_expr(n, -1); OPM_Write(')'); @@ -450,7 +450,7 @@ static void OPV_Entier (OPT_Node n, int32 prec) } } -static void OPV_SizeCast (int64 from, int64 to) +static void OPV_SizeCast (int32 from, int32 to) { if ((from != to && (from > 4 || to != 4))) { OPM_WriteString((CHAR*)"(int", 5); @@ -459,9 +459,9 @@ static void OPV_SizeCast (int64 from, int64 to) } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) { - int32 from, to; + int16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -471,7 +471,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 64))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -486,7 +486,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int32 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 64)) { + if (__IN(2, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -509,7 +509,7 @@ static void OPV_TypeOf (OPT_Node n) OPM_WriteString((CHAR*)"__TYPEOF(", 10); OPV_expr(n, -1); OPM_Write(')'); - } else if (__IN(n->class, 0x15, 64)) { + } else if (__IN(n->class, 0x15, 32)) { OPC_Andent(n->typ); OPM_WriteString((CHAR*)"__typ", 6); } else if (n->class == 3) { @@ -525,9 +525,9 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 64) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -542,18 +542,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int32 prec, int32 dim) } } -static void OPV_design (OPT_Node n, int32 prec) +static void OPV_design (OPT_Node n, int16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 class, designPrec, comp; + int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int32 dims, i, _for__27; + int16 dims, i, _for__27; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -570,7 +570,7 @@ static void OPV_design (OPT_Node n, int32 prec) OPC_CompleteIdent(n->obj); break; case 1: - if (!__IN(comp, 0x0c, 64)) { + if (!__IN(comp, 0x0c, 32)) { OPM_Write('*'); } OPC_CompleteIdent(n->obj); @@ -632,7 +632,7 @@ static void OPV_design (OPT_Node n, int32 prec) } if (n->typ->comp == 3) { OPM_Write(')'); - while ((int64)i < __ASHR(d->typ->size - 4, 2)) { + while (i < __ASHR(d->typ->size - 4, 2)) { OPM_WriteString((CHAR*)" * ", 4); OPV_Len(d, i); i += 1; @@ -649,10 +649,10 @@ static void OPV_design (OPT_Node n, int32 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((int16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, int32 prec) } break; case 6: - if (__IN(3, OPM_opt, 64)) { + if (__IN(3, OPM_opt, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -721,7 +721,7 @@ static void OPV_design (OPT_Node n, int32 prec) } } -static void OPV_ParIntLiteral (int64 n, int64 size) +static void OPV_ParIntLiteral (int64 n, int32 size) { OPM_WriteInt(n); } @@ -729,7 +729,7 @@ static void OPV_ParIntLiteral (int64 n, int64 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int32 comp, form, mode, prec, dim; + int16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -743,7 +743,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"*)", 3); prec = 10; } - if (!__IN(n->typ->comp, 0x0c, 64)) { + if (!__IN(n->typ->comp, 0x0c, 32)) { if (mode == 2) { if (typ != n->typ) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -751,7 +751,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_Write('&'); prec = 9; } else { - if ((__IN(comp, 0x0c, 64) && n->class == 7)) { + if ((__IN(comp, 0x0c, 32) && n->class == 7)) { OPM_WriteString((CHAR*)"(CHAR*)", 8); } else if ((((form == 11 && typ != n->typ)) && n->typ != OPT_niltyp)) { OPM_WriteString((CHAR*)"(void*)", 8); @@ -821,9 +821,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return _o_result; } -static void OPV_expr (OPT_Node n, int32 prec) +static void OPV_expr (OPT_Node n, int16 prec) { - int32 class, subclass, form, exprPrec; + int16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -833,7 +833,7 @@ static void OPV_expr (OPT_Node n, int32 prec) l = n->left; r = n->right; exprPrec = OPV_Precedence(class, subclass, form, n->typ->comp); - if ((exprPrec <= prec && __IN(class, 0x3ce0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ce0, 32))) { OPM_Write('('); } switch (class) { @@ -913,18 +913,18 @@ static void OPV_expr (OPT_Node n, int32 prec) if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { - if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 64))) { + if ((l->typ->form != 8 && !__IN(l->typ->comp, 0x0c, 32))) { OPM_Write('&'); } OPV_expr(l, exprPrec); } break; case 29: - if (!__IN(l->class, 0x17, 64) || (((__IN(n->typ->form, 0x1890, 64) && __IN(l->typ->form, 0x1890, 64))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17, 32) || (((__IN(n->typ->form, 0x1890, 32) && __IN(l->typ->form, 0x1890, 32))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); - if (__IN(n->typ->form, 0x1800, 64) || __IN(l->typ->form, 0x1800, 64)) { + if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); @@ -1021,12 +1021,12 @@ static void OPV_expr (OPT_Node n, int32 prec) } OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); - if ((((__IN(subclass, 0x18020000, 64) && r->class == 7)) && r->conval->intval < 0)) { + if ((((__IN(subclass, 0x18020000, 32) && r->class == 7)) && r->conval->intval < 0)) { OPM_WriteInt(-r->conval->intval); } else { OPV_expr(r, -1); } - if (__IN(subclass, 0x18008000, 64)) { + if (__IN(subclass, 0x18008000, 32)) { OPM_WriteString((CHAR*)", ", 3); if (subclass == 15) { OPM_WriteInt(__ASHL(r->typ->size, 3)); @@ -1038,7 +1038,7 @@ static void OPV_expr (OPT_Node n, int32 prec) break; case 9: case 10: case 11: case 12: case 13: case 14: - if (__IN(l->typ->form, 0x2100, 64)) { + if (__IN(l->typ->form, 0x2100, 32)) { OPM_WriteString((CHAR*)"__STRCMP(", 10); OPV_expr(l, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1135,7 +1135,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPV_design(n, prec); break; } - if ((exprPrec <= prec && __IN(class, 0x3ca0, 64))) { + if ((exprPrec <= prec && __IN(class, 0x3ca0, 32))) { OPM_Write(')'); } } @@ -1145,7 +1145,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int64 adr; + int32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1196,7 +1196,7 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; int64 low, high; - int32 form, i; + int16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1263,7 +1263,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int32 nofdim, nofdyn; + int16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; @@ -1425,7 +1425,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)", ", 3); OPC_Andent(n->left->typ->BaseTyp); OPM_WriteString((CHAR*)")", 2); - } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 64)) { + } else if (__IN(n->left->typ->BaseTyp->comp, 0x0c, 32)) { OPV_NewArr(n->left, n->right); } break; @@ -1516,7 +1516,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 64)) { + } else if (__IN(7, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1582,7 +1582,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 64)) { + if (__IN(10, OPM_opt, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1618,7 +1618,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_LogWLn(); break; } - if (!__IN(n->class, 0x09744000, 64)) { + if (!__IN(n->class, 0x09744000, 32)) { OPC_EndStat(); } n = n->link; @@ -1627,7 +1627,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } @@ -1635,7 +1635,7 @@ void OPV_Module (OPT_Node prog) OPV_stat(prog, NIL); } -__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 8), {-8}}; +__TDESC(OPV_ExitInfo, 1, 0) = {__TDFLDS("ExitInfo", 4), {-8}}; export void *OPV__init(void) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 363a0045..59f9cfeb 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -13,91 +13,91 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + address (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int64 volume, indexhigh, indexlow, mtimehigh, mtimelow; + int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); export BOOLEAN Platform_LittleEndian; export address Platform_MainStackFrame; -export int64 Platform_HaltCode; -export int32 Platform_PID; +export int32 Platform_HaltCode; +export int16 Platform_PID; export CHAR Platform_CWD[4096]; -export int32 Platform_ArgCount; +export int16 Platform_ArgCount; export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int64 Platform_TimeStart; -export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static int32 Platform_TimeStart; +export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_nl[3]; export address *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int32 e); -export int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int64 code); -export int32 Platform_Chdir (CHAR *n, LONGINT n__len); -export int32 Platform_Close (int64 h); -export BOOLEAN Platform_ConnectionFailed (int32 e); -export void Platform_Delay (int64 ms); -export BOOLEAN Platform_DifferentFilesystems (int32 e); -static void Platform_DisplayHaltCode (int64 code); -export int32 Platform_Error (void); -export void Platform_Exit (int32 code); -export void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int64 *t, int64 *d); +export BOOLEAN Platform_Absent (int16 e); +export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (int32 code); +export int16 Platform_Chdir (CHAR *n, LONGINT n__len); +export int16 Platform_Close (int32 h); +export BOOLEAN Platform_ConnectionFailed (int16 e); +export void Platform_Delay (int32 ms); +export BOOLEAN Platform_DifferentFilesystems (int16 e); +static void Platform_DisplayHaltCode (int32 code); +export int16 Platform_Error (void); +export void Platform_Exit (int16 code); +export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (int32 *t, int32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int32 n, int64 *val); -export void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -export void Platform_Halt (int64 code); -export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, address argvadr); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -export BOOLEAN Platform_NoSuchDirectory (int32 e); +export void Platform_GetIntArg (int16 n, int32 *val); +export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +export void Platform_Halt (int32 code); +export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +export BOOLEAN Platform_Inaccessible (int16 e); +export void Platform_Init (int16 argc, address argvadr); +export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +export BOOLEAN Platform_NoSuchDirectory (int16 e); export address Platform_OSAllocate (address size); export void Platform_OSFree (address address); -export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, address p, address l, address *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); -export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int32 Platform_Seek (int64 h, int64 o, int32 r); +export int16 Platform_Seek (int32 h, int32 o, int16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int32 Platform_Size (int64 h, int64 *l); -export int32 Platform_Sync (int64 h); -export int32 Platform_System (CHAR *cmd, LONGINT cmd__len); +export int16 Platform_Size (int32 h, int32 *l); +export int16 Platform_Sync (int32 h); +export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int64 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int32 e); -export BOOLEAN Platform_TooManyFiles (int32 e); -export int32 Platform_Truncate (int64 h, int64 limit); -export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, int64 p, int64 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d); +export int32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (int16 e); +export BOOLEAN Platform_TooManyFiles (int16 e); +export int16 Platform_Truncate (int32 h, int32 limit); +export int16 Platform_Unlink (CHAR *n, LONGINT n__len); +export int16 Platform_Write (int32 h, address p, int32 l); +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int64 l); +static void Platform_errint (int32 l); static void Platform_errln (void); -static void Platform_errposint (int64 l); +static void Platform_errposint (int32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -181,49 +181,49 @@ extern void Heap_InitHeap(); #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) #define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int32 e) +BOOLEAN Platform_TooManyFiles (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORTOOMANYOPENFILES(); return _o_result; } -BOOLEAN Platform_NoSuchDirectory (int32 e) +BOOLEAN Platform_NoSuchDirectory (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_DifferentFilesystems (int32 e) +BOOLEAN Platform_DifferentFilesystems (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORNOTSAMEDEVICE(); return _o_result; } -BOOLEAN Platform_Inaccessible (int32 e) +BOOLEAN Platform_Inaccessible (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); return _o_result; } -BOOLEAN Platform_Absent (int32 e) +BOOLEAN Platform_Absent (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); return _o_result; } -BOOLEAN Platform_TimedOut (int32 e) +BOOLEAN Platform_TimedOut (int16 e) { BOOLEAN _o_result; _o_result = e == Platform_ETIMEDOUT(); return _o_result; } -BOOLEAN Platform_ConnectionFailed (int32 e) +BOOLEAN Platform_ConnectionFailed (int16 e) { BOOLEAN _o_result; _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); @@ -242,7 +242,7 @@ void Platform_OSFree (address address) Platform_free(address); } -void Platform_Init (int32 argc, address argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -257,7 +257,7 @@ BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__le { BOOLEAN _o_result; CHAR buf[4096]; - int32 res; + int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -282,7 +282,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -291,10 +291,10 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int32 n, int64 *val) +void Platform_GetIntArg (int16 n, int32 *val) { CHAR s[64]; - int64 k, d, i; + int32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -302,11 +302,11 @@ void Platform_GetIntArg (int32 n, int64 *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (int16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -317,10 +317,10 @@ void Platform_GetIntArg (int32 n, int64 *val) } } -int32 Platform_ArgPos (CHAR *s, LONGINT s__len) +int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -338,28 +338,28 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int64 *t, int64 *d) +static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) { - *d = (__ASHL((int64)(int)__MOD(ye, 100), 9) + __ASHL((int64)(mo + 1), 5)) + (int64)da; - *t = (__ASHL((int64)ho, 12) + __ASHL((int64)mi, 6)) + (int64)se; + *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; + *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int64 *t, int64 *d) +void Platform_GetClock (int32 *t, int32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int64 Platform_Time (void) +int32 Platform_Time (void) { - int64 _o_result; - int64 ms; + int32 _o_result; + int32 ms; ms = Platform_GetTickCount(); - _o_result = __MOD(ms - Platform_TimeStart, 2147483647); + _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); return _o_result; } -void Platform_Delay (int64 ms) +void Platform_Delay (int32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -370,7 +370,7 @@ void Platform_Delay (int64 ms) } } -void Platform_GetTimeOfDay (int64 *sec, int64 *usec) +void Platform_GetTimeOfDay (int32 *sec, int32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -380,10 +380,10 @@ void Platform_GetTimeOfDay (int64 *sec, int64 *usec) *usec = Platform_uluSec(); } -int32 Platform_System (CHAR *cmd, LONGINT cmd__len) +int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int32 _o_result; - int32 result; + int16 _o_result; + int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -399,17 +399,17 @@ int32 Platform_System (CHAR *cmd, LONGINT cmd__len) return _o_result; } -int32 Platform_Error (void) +int16 Platform_Error (void) { - int32 _o_result; + int16 _o_result; _o_result = Platform_err(); return _o_result; } -int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -422,10 +422,10 @@ int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -438,10 +438,10 @@ int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) +int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int32 _o_result; - int64 fd; + int16 _o_result; + int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { _o_result = Platform_err(); @@ -454,9 +454,9 @@ int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h) __RETCHK; } -int32 Platform_Close (int64 h) +int16 Platform_Close (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_closeHandle(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -467,9 +467,9 @@ int32 Platform_Close (int64 h) __RETCHK; } -int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; + int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { _o_result = Platform_err(); @@ -484,11 +484,11 @@ int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *iden return _o_result; } -int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int32 _o_result; - int64 h; - int32 e, i; + int16 _o_result; + int32 h; + int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -523,16 +523,16 @@ void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Pla (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Size (int64 h, int64 *l) +int16 Platform_Size (int32 h, int32 *l) { - int32 _o_result; + int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { _o_result = Platform_err(); @@ -543,43 +543,45 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, address p, address l, address *n) +int16 Platform_Read (int32 h, address p, int32 l, int32 *n) { - int32 _o_result; - int32 result; - *n = 0; - result = Platform_readfile(h, p, l, &*n); + int16 _o_result; + int16 result; + int32 lengthread; + result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int32 _o_result; - int32 result; - *n = 0; - result = Platform_readfile(h, (address)b, b__len, &*n); + int16 _o_result; + int16 result; + int32 lengthread; + result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; _o_result = Platform_err(); return _o_result; } else { + *n = lengthread; _o_result = 0; return _o_result; } __RETCHK; } -int32 Platform_Write (int64 h, int64 p, int64 l) +int16 Platform_Write (int32 h, address p, int32 l) { - int32 _o_result; + int16 _o_result; if (Platform_writefile(h, p, l) == 0) { _o_result = Platform_err(); return _o_result; @@ -590,9 +592,9 @@ int32 Platform_Write (int64 h, int64 p, int64 l) __RETCHK; } -int32 Platform_Sync (int64 h) +int16 Platform_Sync (int32 h) { - int32 _o_result; + int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { _o_result = Platform_err(); return _o_result; @@ -603,10 +605,10 @@ int32 Platform_Sync (int64 h) __RETCHK; } -int32 Platform_Seek (int64 h, int64 o, int32 r) +int16 Platform_Seek (int32 h, int32 o, int16 r) { - int32 _o_result; - int32 rc; + int16 _o_result; + int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -619,11 +621,11 @@ int32 Platform_Seek (int64 h, int64 o, int32 r) __RETCHK; } -int32 Platform_Truncate (int64 h, int64 limit) +int16 Platform_Truncate (int32 h, int32 limit) { - int32 _o_result; - int32 rc; - int64 oldpos; + int16 _o_result; + int16 rc; + int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -648,9 +650,9 @@ int32 Platform_Truncate (int64 h, int64 limit) return _o_result; } -int32 Platform_Unlink (CHAR *n, LONGINT n__len) +int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -661,10 +663,10 @@ int32 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int32 Platform_Chdir (CHAR *n, LONGINT n__len) +int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int32 _o_result; - int32 r; + int16 _o_result; + int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { _o_result = Platform_err(); @@ -675,9 +677,9 @@ int32 Platform_Chdir (CHAR *n, LONGINT n__len) return _o_result; } -int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int32 _o_result; + int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { _o_result = Platform_err(); return _o_result; @@ -688,7 +690,7 @@ int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int32 code) +void Platform_Exit (int16 code) { Platform_exit(code); } @@ -704,15 +706,15 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int64 l) +static void Platform_errposint (int32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); } - Platform_errch((CHAR)(48 + __MOD(l, 10))); + Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int64 l) +static void Platform_errint (int32 l) { if (l < 0) { Platform_errch('-'); @@ -721,7 +723,7 @@ static void Platform_errint (int64 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int64 code) +static void Platform_DisplayHaltCode (int32 code) { switch (code) { case -1: @@ -777,7 +779,7 @@ static void Platform_DisplayHaltCode (int64 code) } } -void Platform_Halt (int64 code) +void Platform_Halt (int32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -790,10 +792,10 @@ void Platform_Halt (int64 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } -void Platform_AssertFail (int64 code) +void Platform_AssertFail (int32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -802,7 +804,7 @@ void Platform_AssertFail (int64 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int32, code)); + Platform_exit(__VAL(int16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -812,12 +814,12 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int32 i; + int16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } -__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; +__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-8}}; export void *Platform__init(void) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 6cab3690..d62dd343 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -7,75 +7,75 @@ typedef struct Platform_FileIdentity { - int64 _prvt0; - char _prvt1[32]; + int32 _prvt0; + char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int64); + void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(int16); import BOOLEAN Platform_LittleEndian; import address Platform_MainStackFrame; -import int64 Platform_HaltCode; -import int32 Platform_PID; +import int32 Platform_HaltCode; +import int16 Platform_PID; import CHAR Platform_CWD[4096]; -import int32 Platform_ArgCount; +import int16 Platform_ArgCount; import address Platform_ArgVector; -import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; import address *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int32 e); -import int32 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int64 code); -import int32 Platform_Chdir (CHAR *n, LONGINT n__len); -import int32 Platform_Close (int64 h); -import BOOLEAN Platform_ConnectionFailed (int32 e); -import void Platform_Delay (int64 ms); -import BOOLEAN Platform_DifferentFilesystems (int32 e); -import int32 Platform_Error (void); -import void Platform_Exit (int32 code); -import void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int64 *t, int64 *d); +import BOOLEAN Platform_Absent (int16 e); +import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (int32 code); +import int16 Platform_Chdir (CHAR *n, LONGINT n__len); +import int16 Platform_Close (int32 h); +import BOOLEAN Platform_ConnectionFailed (int16 e); +import void Platform_Delay (int32 ms); +import BOOLEAN Platform_DifferentFilesystems (int16 e); +import int16 Platform_Error (void); +import void Platform_Exit (int16 code); +import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (int32 *t, int32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int32 n, int64 *val); -import void Platform_GetTimeOfDay (int64 *sec, int64 *usec); -import void Platform_Halt (int64 code); -import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, address *identity__typ); -import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, address argvadr); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); -import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); -import BOOLEAN Platform_NoSuchDirectory (int32 e); +import void Platform_GetIntArg (int16 n, int32 *val); +import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); +import void Platform_Halt (int32 code); +import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); +import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); +import BOOLEAN Platform_Inaccessible (int16 e); +import void Platform_Init (int16 argc, address argvadr); +import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); +import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); +import BOOLEAN Platform_NoSuchDirectory (int16 e); import address Platform_OSAllocate (address size); import void Platform_OSFree (address address); -import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, address p, address l, address *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); -import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); +import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int32 Platform_Seek (int64 h, int64 o, int32 r); +import int16 Platform_Seek (int32 h, int32 o, int16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int32 Platform_Size (int64 h, int64 *l); -import int32 Platform_Sync (int64 h); -import int32 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int64 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int32 e); -import BOOLEAN Platform_TooManyFiles (int32 e); -import int32 Platform_Truncate (int64 h, int64 limit); -import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, int64 p, int64 l); +import int16 Platform_Size (int32 h, int32 *l); +import int16 Platform_Sync (int32 h); +import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import int32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (int16 e); +import BOOLEAN Platform_TooManyFiles (int16 e); +import int16 Platform_Truncate (int32 h, int32 limit); +import int16 Platform_Unlink (CHAR *n, LONGINT n__len); +import int16 Platform_Write (int32 h, address p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 7678a81e..fe93e8be 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -10,19 +10,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -export int32 Reals_Expo (REAL x); -export int32 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int32 ex); -export REAL Reals_Ten (int32 e); -export LONGREAL Reals_TenL (int32 e); -static CHAR Reals_ToHex (int32 i); +export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +export int16 Reals_Expo (REAL x); +export int16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, int16 ex); +export REAL Reals_Ten (int16 e); +export LONGREAL Reals_TenL (int16 e); +static CHAR Reals_ToHex (int16 i); -REAL Reals_Ten (int32 e) +REAL Reals_Ten (int16 e) { REAL _o_result; LONGREAL r, power; @@ -39,7 +39,7 @@ REAL Reals_Ten (int32 e) return _o_result; } -LONGREAL Reals_TenL (int32 e) +LONGREAL Reals_TenL (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -59,54 +59,67 @@ LONGREAL Reals_TenL (int32 e) __RETCHK; } -int32 Reals_Expo (REAL x) +int16 Reals_Expo (REAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 2, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } -void Reals_SetExpo (REAL *x, int32 ex) +void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int32 Reals_ExpoL (LONGREAL x) +int16 Reals_ExpoL (LONGREAL x) { - int32 _o_result; - int32 i; - __GET((address)&x + 6, i, int32); + int16 _o_result; + int16 i; + __GET((address)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } -void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) { - int64 i, j, k; + int32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; - i = __ENTIER(x); - while (k < (int64)n) { - d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48); + if (n > 9) { + i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + if (j < 0) { + j = 0; + } + while (k < 9) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48); + j = __DIV(j, 10); + k += 1; + } + } else { + i = (int32)__ENTIER(x); + } + while (k < n) { + d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); i = __DIV(i, 10); k += 1; } } -void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int32 i) +static CHAR Reals_ToHex (int16 i) { CHAR _o_result; if (i < 10) { @@ -121,15 +134,15 @@ static CHAR Reals_ToHex (int32 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int32 i; - int64 l; + int16 i; + int32 l; CHAR by; i = 0; l = b__len; - while ((int64)i < l) { + while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 4de192c6..e7cba0d8 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int32 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int32 n, CHAR *d, LONGINT d__len); -import int32 Reals_Expo (REAL x); -import int32 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int32 ex); -import REAL Reals_Ten (int32 e); -import LONGREAL Reals_TenL (int32 e); +import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); +import int16 Reals_Expo (REAL x); +import int16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, int16 ex); +import REAL Reals_Ten (int16 e); +import LONGREAL Reals_TenL (int16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 49fbdd21..427a0cc4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -11,22 +11,22 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -export int32 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -int32 Strings_Length (CHAR *s, LONGINT s__len) +int16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; - int32 i; + int16 _o_result; + int16 i; __DUP(s, s__len, CHAR); i = 0; - while (((int64)i < s__len && s[__X(i, s__len)] != 0x00)) { + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } _o_result = i; @@ -36,24 +36,24 @@ int32 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); i = 0; - while ((i < n2 && (int64)(i + n1) < dest__len)) { + while ((i < n2 && (i + n1) < dest__len)) { dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)]; i += 1; } - if ((int64)(i + n1) < dest__len) { + if ((i + n1) < dest__len) { dest[__X(i + n1, dest__len)] = 0x00; } __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { - int32 n1, n2, i; + int16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -64,10 +64,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L Strings_Append(dest, dest__len, (void*)source, source__len); return; } - if ((int64)(pos + n2) < dest__len) { + if ((pos + n2) < dest__len) { i = n1; while (i >= pos) { - if ((int64)(i + n2) < dest__len) { + if ((i + n2) < dest__len) { dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)]; } i -= 1; @@ -81,9 +81,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) +void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) { - int32 len, i; + int16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -96,7 +96,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) s[__X(i - n, s__len)] = s[__X(i, s__len)]; i += 1; } - if ((int64)(i - n) < s__len) { + if ((i - n) < s__len) { s[__X(i - n, s__len)] = 0x00; } } else { @@ -104,7 +104,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -112,12 +112,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) { - int32 len, destLen, i; + int16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int32)dest__len - 1; + destLen = (int16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -126,7 +126,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA return; } i = 0; - while (((((int64)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { + while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) { if (i < destLen) { dest[__X(i, dest__len)] = source[__X(pos + i, source__len)]; } @@ -136,10 +136,10 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHA __DEL(source); } -int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos) +int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int32 _o_result; - int32 n1, n2, i, j; + int16 _o_result; + int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -174,7 +174,7 @@ int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int32 i; + int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -188,9 +188,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int32 n, int32 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4dd0d2c3..44c51b2a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int32 pos, int32 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int32 pos, int32 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); -import int32 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int32 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int32 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int32 pos, CHAR *dest, LONGINT dest__len); +import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6403ce33..8c41a062 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -18,7 +18,7 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; @@ -41,26 +41,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; - int64 W, H; + int32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int64 org, span; + int32 org, span; CHAR mod[32], proc[32]; }; @@ -69,7 +69,7 @@ typedef typedef struct Texts_BufDesc { - int64 len; + int32 len; Texts_Run head; } Texts_BufDesc; @@ -83,8 +83,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -99,7 +99,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -107,12 +107,12 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int64 len; + int32 len; Texts_FontsFont fnt; int8 col, voff; BOOLEAN ascii; Files_File file; - int64 org; + int32 org; } Texts_PieceDesc; typedef @@ -123,7 +123,7 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; } Texts_Reader; typedef @@ -134,10 +134,10 @@ typedef Texts_Elem elem; Files_Rider rider; Texts_Run run; - int64 org, off; + int32 org, off; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -147,10 +147,10 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; Texts_Run head, cache; - int64 corg; + int32 corg; } Texts_TextDesc; typedef @@ -183,50 +183,50 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int64 beg, int64 end); +export void Texts_Delete (Texts_Text T, int32 beg, int32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int64 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off); +export int32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int64 Texts_Pos (Texts_Reader *R, address *R__typ); +export int32 Texts_Pos (Texts_Reader *R, address *R__typ); export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); export void Texts_ReadElem (Texts_Reader *R, address *R__typ); export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); export void Texts_Scan (Texts_Scanner *S, address *S__typ); export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un); +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); @@ -241,10 +241,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return _o_result; } -static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int64 *off) +static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) { Texts_Run v = NIL; - int64 m; + int32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -274,7 +274,7 @@ static void Texts_Find (Texts_Text T, int64 *pos, Texts_Run *u, int64 *org, int6 } } -static void Texts_Split (int64 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -373,11 +373,11 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return _o_result; } -int64 Texts_ElemPos (Texts_Elem E) +int32 Texts_ElemPos (Texts_Elem E) { - int64 _o_result; + int32 _o_result; Texts_Run u = NIL; - int64 pos; + int32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -392,7 +392,7 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__t { Texts_Alien e = NIL; Files_Rider r; - int64 i; + int32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -468,10 +468,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int64 uo, ud, vo, vd; + int32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -502,11 +502,11 @@ void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int64 uo, ud, len; + int32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -525,7 +525,7 @@ void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int64 pos, len; + int32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -540,10 +540,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int64 beg, int64 end) +void Texts_Delete (Texts_Text T, int32 beg, int32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -565,10 +565,10 @@ void Texts_Delete (Texts_Text T, int64 beg, int64 end) } } -void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int64 co, uo, ud, vo, vd; + int32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -578,13 +578,13 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts T->cache = c; T->corg = co; while (un != vn) { - if ((__IN(0, sel, 64) && fnt != NIL)) { + if ((__IN(0, sel, 32) && fnt != NIL)) { un->fnt = fnt; } - if (__IN(1, sel, 64)) { + if (__IN(1, sel, 32)) { un->col = col; } - if (__IN(2, sel, 64)) { + if (__IN(2, sel, 32)) { un->voff = voff; } Texts_Merge(T, u, &un); @@ -604,7 +604,7 @@ void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_Fonts } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos) +void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -621,7 +621,7 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) { Texts_Run u = NIL; - int64 pos; + int32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -713,14 +713,14 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int64 Texts_Pos (Texts_Reader *R, address *R__typ) +int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int64 _o_result; + int32 _o_result; _o_result = (*R).org + (*R).off; return _o_result; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos) +void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -732,7 +732,7 @@ static struct Scan__31 { address *S__typ; CHAR *ch; BOOLEAN *negE; - int32 *e; + int16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -751,7 +751,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -761,8 +761,8 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) CHAR ch, term; BOOLEAN neg, negE, hex; int8 i, j, h; - int32 e; - int64 k; + int16 e; + int32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -823,10 +823,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((int16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((int16)ch - 39); } else { break; } @@ -838,13 +838,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (int16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (int64)(d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -865,12 +865,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((int16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -897,12 +897,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((int16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -934,7 +934,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (int64)(d[__X(j, 32)] - 48); + k = k * 10 + ((int16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1040,7 +1040,7 @@ void Texts_WriteLn (Texts_Writer *W, address *W__typ) void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) { - int32 i; + int16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1052,7 +1052,7 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) { - int32 i; + int16 i; int64 x0; CHAR a[24]; i = 0; @@ -1085,10 +1085,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) +void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) { - int32 i; - int64 y; + int16 i; + int32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1108,9 +1108,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) +void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) { - int32 e; + int16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1181,15 +1181,15 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n) static struct WriteRealFix__53 { Texts_Writer *W; address *W__typ; - int32 *i; + int16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int32 n); -static void seq__56 (CHAR ch, int32 n); +static void dig__54 (int16 n); +static void seq__56 (CHAR ch, int16 n); -static void seq__56 (CHAR ch, int32 n) +static void seq__56 (CHAR ch, int16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1197,7 +1197,7 @@ static void seq__56 (CHAR ch, int32 n) } } -static void dig__54 (int32 n) +static void dig__54 (int16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1206,9 +1206,9 @@ static void dig__54 (int32 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k) +void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) { - int32 e, i; + int16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1280,7 +1280,7 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int3 void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) { - int32 i; + int16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1290,9 +1290,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) +void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) { - int32 e; + int16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1324,7 +1324,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int32)__ASHR((int64)(e - 1023) * 77, 8); + e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1364,7 +1364,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n) void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) { - int32 i; + int16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1380,16 +1380,16 @@ static struct WriteDate__43 { struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int64 x); +static void WritePair__44 (CHAR ch, int32 x); -static void WritePair__44 (CHAR ch, int64 x) +static void WritePair__44 (CHAR ch, int32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); - Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48)); + Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d) +void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1413,14 +1413,14 @@ static struct Load0__16 { struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int64 pos, int64 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int64 org, ew, eh; + int32 org, ew, eh; int8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); @@ -1471,7 +1471,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int64 org, pos, hlen, plen; + int32 org, pos, hlen, plen; int8 ecnt, fno, fcnt, col, voff; Files_File f = NIL; Texts_FileMsg msg; @@ -1490,7 +1490,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) pos = Files_Pos(&*r, r__typ); f = Files_Base(&*r, r__typ); __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; T->head = u; @@ -1542,7 +1542,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) { - int32 tag; + int16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1557,7 +1557,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int64 hlen; + int32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Load0(&r, Files_Rider__typ, T); } else { __NEW(u, Texts_RunDesc); - u->len = 9223372036854775807; + u->len = 2147483647; u->fnt = NIL; u->col = 15; __NEW(p, Texts_PieceDesc); @@ -1614,12 +1614,12 @@ static struct Store__39 { struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int64 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) { Files_Rider r1; - int64 org, span; + int32 org, span; int8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); @@ -1651,7 +1651,7 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int64 org, pos, delta, hlen, rlen; + int32 org, pos, delta, hlen, rlen; int8 ecnt, fno, fcnt; CHAR ch; Texts_FileMsg msg; @@ -1769,7 +1769,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int32 i, res; + int16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); @@ -1803,16 +1803,16 @@ __TDESC(Texts_FontDesc, 1, 0) = {__TDFLDS("FontDesc", 32), {-8}}; __TDESC(Texts_RunDesc, 1, 3) = {__TDFLDS("RunDesc", 40), {0, 8, 24, -32}}; __TDESC(Texts_PieceDesc, 1, 4) = {__TDFLDS("PieceDesc", 56), {0, 8, 24, 40, -40}}; __TDESC(Texts_ElemMsg, 1, 0) = {__TDFLDS("ElemMsg", 1), {-8}}; -__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 72), {0, 8, 24, 64, -40}}; -__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 56), {32, -16}}; +__TDESC(Texts_ElemDesc, 1, 4) = {__TDFLDS("ElemDesc", 64), {0, 8, 24, 56, -40}}; +__TDESC(Texts_FileMsg, 1, 1) = {__TDFLDS("FileMsg", 32), {16, -16}}; __TDESC(Texts_CopyMsg, 1, 1) = {__TDFLDS("CopyMsg", 8), {0, -16}}; __TDESC(Texts_IdentifyMsg, 1, 0) = {__TDFLDS("IdentifyMsg", 64), {-8}}; __TDESC(Texts_BufDesc, 1, 1) = {__TDFLDS("BufDesc", 16), {8, -16}}; __TDESC(Texts_TextDesc, 1, 2) = {__TDFLDS("TextDesc", 40), {16, 24, -24}}; -__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 96), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 208), {8, 24, 48, 72, -40}}; -__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 72), {0, 8, 40, 64, -40}}; -__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 160), {0, 8, 24, 64, 72, -48}}; +__TDESC(Texts_Reader, 1, 4) = {__TDFLDS("Reader", 72), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Scanner, 1, 4) = {__TDFLDS("Scanner", 168), {8, 24, 40, 56, -40}}; +__TDESC(Texts_Writer, 1, 4) = {__TDFLDS("Writer", 56), {0, 8, 32, 48, -40}}; +__TDESC(Texts__1, 1, 5) = {__TDFLDS("", 144), {0, 8, 24, 56, 64, -48}}; export void *Texts__init(void) { diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e85157ed..fa080b7f 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int64 len; - char _prvt0[8]; + int32 len; + int64 _prvt0; } Texts_BufDesc; typedef @@ -39,16 +39,17 @@ typedef typedef struct Texts_ElemDesc { - char _prvt0[40]; - int64 W, H; + int64 _prvt0; + char _prvt1[28]; + int32 W, H; Texts_Handler handle; - char _prvt1[8]; + char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int32 id; - int64 pos; + int16 id; + int32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,7 +70,7 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int32, int64, int64); + void (*Texts_Notifier)(Texts_Text, int16, int32, int32); typedef struct Texts_Reader { @@ -77,7 +78,7 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; } Texts_Reader; typedef @@ -86,10 +87,10 @@ typedef Texts_FontsFont fnt; int8 col, voff; Texts_Elem elem; - char _prvt0[64]; + char _prvt0[40]; CHAR nextCh; - int32 line, class; - int64 i; + int16 line, class; + int32 i; REAL x; LONGREAL y; CHAR c; @@ -99,9 +100,9 @@ typedef typedef struct Texts_TextDesc { - int64 len; + int32 len; Texts_Notifier notify; - char _prvt0[24]; + char _prvt0[20]; } Texts_TextDesc; typedef @@ -109,7 +110,7 @@ typedef Texts_Buffer buf; Texts_FontsFont fnt; int8 col, voff; - char _prvt0[54]; + char _prvt0[38]; } Texts_Writer; @@ -129,41 +130,41 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int64 beg, int64 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int64 beg, int64 end); +import void Texts_Delete (Texts_Text T, int32 beg, int32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int64 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int64 pos, Texts_Buffer B); +import int32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int64 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int64 pos); +import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int64 Texts_Pos (Texts_Reader *R, address *R__typ); +import int32 Texts_Pos (Texts_Reader *R, address *R__typ); import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); import void Texts_ReadElem (Texts_Reader *R, address *R__typ); import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int64 beg, int64 end, Texts_Buffer B); +import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); import void Texts_Scan (Texts_Scanner *S, address *S__typ); import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int64 t, int64 d); +import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int64 x); +import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int32 n); +import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int32 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int32 n, int32 k); +import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); +import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 5c6cada1..1ec89e33 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +25,7 @@ static CHAR Vishap_mname[256]; export void Vishap_Module (BOOLEAN *done); static void Vishap_PropagateElementaryTypeSizes (void); export void Vishap_Translate (void); -static void Vishap_Trap (int32 sig); +static void Vishap_Trap (int16 sig); void Vishap_Module (BOOLEAN *done) @@ -42,22 +42,22 @@ void Vishap_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 64) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 64)) { + if (!__IN(16, OPM_opt, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -111,17 +111,17 @@ void Vishap_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 64)) { - if (__IN(14, OPM_opt, 64)) { + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 64)) { + if (!__IN(10, OPM_opt, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 64), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); } } } @@ -129,7 +129,7 @@ void Vishap_Translate (void) } } -static void Vishap_Trap (int32 sig) +static void Vishap_Trap (int16 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 4bb09433..0a40d5e9 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d6bc2194..8be0b63d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,10 +22,10 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int32 r, status, exitcode; + int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 64)) { + if (__IN(18, OPM_opt, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index bb55d599..4f6a6c9d 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,8 +1,8 @@ /* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ -#define INTEGER int32 -#define LONGINT int64 -#define SET uint64 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" @@ -13,36 +13,36 @@ export CHAR vt100_CSI[5]; static CHAR vt100_tmpstr[32]; -export void vt100_CHA (int32 n); -export void vt100_CNL (int32 n); -export void vt100_CPL (int32 n); -export void vt100_CUB (int32 n); -export void vt100_CUD (int32 n); -export void vt100_CUF (int32 n); -export void vt100_CUP (int32 n, int32 m); -export void vt100_CUU (int32 n); +export void vt100_CHA (int16 n); +export void vt100_CNL (int16 n); +export void vt100_CPL (int16 n); +export void vt100_CUB (int16 n); +export void vt100_CUD (int16 n); +export void vt100_CUF (int16 n); +export void vt100_CUP (int16 n, int16 m); +export void vt100_CUU (int16 n); export void vt100_DECTCEMh (void); export void vt100_DECTCEMl (void); -export void vt100_DSR (int32 n); -export void vt100_ED (int32 n); -export void vt100_EL (int32 n); -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len); +export void vt100_DSR (int16 n); +export void vt100_ED (int16 n); +export void vt100_EL (int16 n); +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int32 n, int32 m); -export void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void vt100_HVP (int16 n, int16 m); +export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end); +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); export void vt100_SCP (void); -export void vt100_SD (int32 n); -export void vt100_SGR (int32 n); -export void vt100_SGR2 (int32 n, int32 m); -export void vt100_SU (int32 n); +export void vt100_SD (int16 n); +export void vt100_SGR (int16 n); +export void vt100_SGR2 (int16 n, int16 m); +export void vt100_SU (int16 n); export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) +static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -54,15 +54,15 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int32 start, int32 end) } } -void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) +void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int32 s, e; + int16 s, e; int8 maxLength; - maxLength = 20; - if (int_ == (-9223372036854775807-1)) { - __MOVE("-9223372036854775808", b, 21); - e = 20; + maxLength = 11; + if (int_ == (-2147483647-1)) { + __MOVE("-2147483648", b, 12); + e = 11; } else { if (int_ < 0) { b[0] = '-'; @@ -73,7 +73,7 @@ void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len) } e = s; do { - b[__X(e, 21)] = (CHAR)(__MOD(int_, 10) + 48); + b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48); int_ = __DIV(int_, 10); e += 1; } while (!(int_ == 0)); @@ -93,7 +93,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -106,7 +106,7 @@ static void vt100_EscSeq (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -119,7 +119,7 @@ static void vt100_EscSeqSwapped (int32 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) +static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -135,82 +135,82 @@ static void vt100_EscSeq2 (int32 n, int32 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int32 n) +void vt100_CUU (int16 n) { vt100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int32 n) +void vt100_CUD (int16 n) { vt100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int32 n) +void vt100_CUF (int16 n) { vt100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int32 n) +void vt100_CUB (int16 n) { vt100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int32 n) +void vt100_CNL (int16 n) { vt100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int32 n) +void vt100_CPL (int16 n) { vt100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int32 n) +void vt100_CHA (int16 n) { vt100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int32 n, int32 m) +void vt100_CUP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int32 n) +void vt100_ED (int16 n) { vt100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int32 n) +void vt100_EL (int16 n) { vt100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int32 n) +void vt100_SU (int16 n) { vt100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int32 n) +void vt100_SD (int16 n) { vt100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int32 n, int32 m) +void vt100_HVP (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int32 n) +void vt100_SGR (int16 n) { vt100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int32 n, int32 m) +void vt100_SGR2 (int16 n, int16 m) { vt100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int32 n) +void vt100_DSR (int16 n) { vt100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 2bc7d18f..94f8add4 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -9,27 +9,27 @@ import CHAR vt100_CSI[5]; -import void vt100_CHA (int32 n); -import void vt100_CNL (int32 n); -import void vt100_CPL (int32 n); -import void vt100_CUB (int32 n); -import void vt100_CUD (int32 n); -import void vt100_CUF (int32 n); -import void vt100_CUP (int32 n, int32 m); -import void vt100_CUU (int32 n); +import void vt100_CHA (int16 n); +import void vt100_CNL (int16 n); +import void vt100_CPL (int16 n); +import void vt100_CUB (int16 n); +import void vt100_CUD (int16 n); +import void vt100_CUF (int16 n); +import void vt100_CUP (int16 n, int16 m); +import void vt100_CUU (int16 n); import void vt100_DECTCEMh (void); import void vt100_DECTCEMl (void); -import void vt100_DSR (int32 n); -import void vt100_ED (int32 n); -import void vt100_EL (int32 n); -import void vt100_HVP (int32 n, int32 m); -import void vt100_IntToStr (int64 int_, CHAR *str, LONGINT str__len); +import void vt100_DSR (int16 n); +import void vt100_ED (int16 n); +import void vt100_EL (int16 n); +import void vt100_HVP (int16 n, int16 m); +import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); import void vt100_RCP (void); import void vt100_SCP (void); -import void vt100_SD (int32 n); -import void vt100_SGR (int32 n); -import void vt100_SGR2 (int32 n, int32 m); -import void vt100_SU (int32 n); +import void vt100_SD (int16 n); +import void vt100_SGR (int16 n); +import void vt100_SGR2 (int16 n, int16 m); +import void vt100_SU (int16 n); import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); import void *vt100__init(void); diff --git a/makefile b/makefile index 37fa64a0..491b28f1 100644 --- a/makefile +++ b/makefile @@ -264,9 +264,9 @@ bootstrap: configuration rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap @@ -274,9 +274,9 @@ bootstrapunclean: rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-OV INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 408eeaeb..e1ed3aa0 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1098,7 +1098,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp ELSE IF x^.typ # p^.typ THEN - IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ) + IF (f = OPT.Int) + & ( (x^.class = OPT.Nconst) + OR (p.typ.form = OPT.Int) & (x.typ.size <= p.typ.size)) THEN Convert(x, p^.typ) ELSE err(111) END END ; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index b3298aed..ded87d02 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -871,17 +871,9 @@ BEGIN AddressSize := Configuration.addressSize; Alignment := Configuration.alignment; - IF Configuration.intsize = 2 THEN - (* Original Oberon-2 implementation sizes (-O2) *) - ShortintSize := 1; - IntegerSize := 2; - LongintSize := 4; - SetSize := 4; - ELSE - (* Legacy Vishap 64 bit build sizes (-OV) *) - ShortintSize := 1; - IntegerSize := 4; - LongintSize := 8; - SetSize := 8; - END + (* Default type size model is that of the original Oberon-2 implementation (-O2) *) + ShortintSize := 1; + IntegerSize := 2; + LongintSize := 4; + SetSize := 4 END OPM. diff --git a/src/library/s3/ethMD5.Mod b/src/library/s3/ethMD5.Mod index 07a605cb..4d33a026 100644 --- a/src/library/s3/ethMD5.Mod +++ b/src/library/s3/ethMD5.Mod @@ -41,7 +41,8 @@ under a public-key cryptosystem such as RSA. *) PROCEDURE ByteReverse(VAR in: ARRAY OF SYSTEM.BYTE; VAR out: ARRAY OF LONGINT; longs: LONGINT); VAR - adr, t, i: LONGINT; + adr: SYSTEM.ADDRESS; + t, i: LONGINT; bytes: ARRAY 4 OF CHAR; BEGIN adr := SYSTEM.ADR(in[0]); i := 0; diff --git a/src/library/s3/ethZlibBuffers.Mod b/src/library/s3/ethZlibBuffers.Mod index 9db0736c..f484a980 100644 --- a/src/library/s3/ethZlibBuffers.Mod +++ b/src/library/s3/ethZlibBuffers.Mod @@ -3,8 +3,7 @@ Refer to the "General ETH Oberon System Source License" contract available at: h MODULE ethZlibBuffers; (** Stefan Walthert **) -IMPORT - SYSTEM; +IMPORT SYSTEM; (* should be portable even if SYSTEM is imported: - PUT and GET only with byte sized operands @@ -13,13 +12,14 @@ IMPORT TYPE (** input/output buffer **) - Address = LONGINT; + Address = SYSTEM.ADDRESS; Buffer* = RECORD - avail-: LONGINT; (** number of bytes that can be produced/consumed **) - size-: LONGINT; (** total number of bytes in buffer memory **) - totalOut-, totalIn-: LONGINT; (** total number of bytes produced/consumed **) - next: Address; (* address of next byte to produce/consume **) - adr: Address; (* buffer memory *) + avail-: LONGINT; (** number of bytes that can be produced/consumed **) + size-: LONGINT; (** total number of bytes in buffer memory **) + totalOut-: LONGINT; (** total number of bytes produced **) + totalIn-: LONGINT; (** total number of bytes consumed **) + next: Address; (* address of next byte to produce/consume **) + adr: Address; (* buffer memory *) END; @@ -50,9 +50,9 @@ PROCEDURE ReadBytes* (VAR buf: Buffer; VAR dst: ARRAY OF CHAR; offset, len: LONG BEGIN ASSERT((0 <= offset) & (0 < len) & (offset + len <= LEN(dst)) & (len <= buf.avail), 100); SYSTEM.MOVE(buf.next, SYSTEM.ADR(dst[offset]), len); - INC(buf.next, len); DEC(buf.avail, len); INC(buf.totalIn, len) + INC(buf.next, len); DEC(buf.avail, len); INC(buf.totalIn, len) END ReadBytes; - + (** write byte into (output) buffer **) PROCEDURE Write* (VAR buf: Buffer; ch: CHAR); BEGIN @@ -89,7 +89,7 @@ PROCEDURE Rewrite* (VAR buf: Buffer); BEGIN buf.next := buf.adr; buf.avail := buf.size END Rewrite; - + (** fill input buffer with new bytes to consume **) PROCEDURE Fill* (VAR buf: Buffer; VAR src: ARRAY OF CHAR; offset, size: LONGINT); BEGIN diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 87ff46fa..04bc3bcb 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -1,6 +1,6 @@ MODULE ulmIO; - IMPORT SYS := ulmSYSTEM, SYSTEM; + IMPORT SYS := ulmSYSTEM, SYSTEM, Platform; CONST nl = 0AX; @@ -118,6 +118,7 @@ MODULE ulmIO; (* ========================= terminal ============================ *) +(* PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; CONST read = 3; (*VAR r0, r1: INTEGER;*) @@ -125,7 +126,17 @@ MODULE ulmIO; BEGIN RETURN SYS.UNIXCALL(read, r0, r1, 0, SYSTEM.ADR(ch), 1) & (r0 > 0) END ReadChar; +*) + PROCEDURE ReadChar(VAR ch: CHAR) : BOOLEAN; + (* Read one byte, returning success flag *) + VAR error: Platform.ErrorCode; readcount: LONGINT; + BEGIN + error := Platform.ReadBuf(Platform.StdIn, ch, readcount); + RETURN readcount > 0 + END ReadChar; + +(* PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; CONST write = 4; (*VAR r0, r1: INTEGER;*) @@ -133,6 +144,13 @@ MODULE ulmIO; BEGIN RETURN SYS.UNIXCALL(write, r0, r1, 1, SYSTEM.ADR(ch), 1) END WriteChar; +*) + + PROCEDURE WriteChar(ch: CHAR) : BOOLEAN; + (* Write one byte, returning success flag *) + BEGIN + RETURN Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) = 0 + END WriteChar; PROCEDURE Read*(VAR ch: CHAR); BEGIN diff --git a/src/library/ulm/ulmSYSTEM.Mod b/src/library/ulm/ulmSYSTEM.Mod index bbd054b8..ece334a7 100644 --- a/src/library/ulm/ulmSYSTEM.Mod +++ b/src/library/ulm/ulmSYSTEM.Mod @@ -49,6 +49,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; RETURN oldflag; END TAS; +(* PROCEDURE UNIXCALL*(syscall: LONGINT; VAR d0, d1: LONGINT; (* in ulm version both LONGINT and INTEGER are 4 byte size *) arg1, arg2, arg3: LONGINT) : BOOLEAN; VAR @@ -122,7 +123,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END END UNIXCALL; - +*) PROCEDURE UNIXFORK(VAR pid: LONGINT) : BOOLEAN; BEGIN @@ -135,8 +136,7 @@ TYPE pchar = POINTER TO ARRAY 1 OF CHAR; END UNIXSIGNAL; - PROCEDURE WMOVE*(from, to, n : LONGINT); - VAR l : LONGINT; + PROCEDURE WMOVE*(from, to, n : SYSTEM.ADDRESS); BEGIN SYSTEM.MOVE(from, to, n); END WMOVE; diff --git a/src/library/v4/Args.Mod b/src/library/v4/Args.Mod index 0d4ff925..a196b5c5 100644 --- a/src/library/v4/Args.Mod +++ b/src/library/v4/Args.Mod @@ -3,7 +3,7 @@ MODULE Args; (* jt, 8.12.94 *) (* command line argument handling for voc (jet backend) *) - IMPORT Platform; + IMPORT Platform, SYSTEM; TYPE ArgPtr = POINTER TO ARRAY 1024 OF CHAR; @@ -11,17 +11,17 @@ MODULE Args; (* jt, 8.12.94 *) VAR argc-: LONGINT; - argv-: LONGINT; + argv-: SYSTEM.ADDRESS; PROCEDURE Get* (n: INTEGER; VAR val: ARRAY OF CHAR); BEGIN Platform.GetArg(n, val) END Get; PROCEDURE GetInt*(n: INTEGER; VAR val: LONGINT); BEGIN Platform.GetIntArg(n, val) END GetInt; PROCEDURE Pos* (s: ARRAY OF CHAR): INTEGER; BEGIN RETURN Platform.ArgPos(s) END Pos; -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); BEGIN Platform.GetEnv(var, val) END GetEnv; -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; BEGIN RETURN Platform.getEnv(var, val) END getEnv; diff --git a/src/library/v4/Printer.Mod b/src/library/v4/Printer.Mod index 39b06c0c..803b567f 100644 --- a/src/library/v4/Printer.Mod +++ b/src/library/v4/Printer.Mod @@ -87,7 +87,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 VAR family: ARRAY 7 OF CHAR; BEGIN COPY(fname, family); - Ch(fontR, "/"); Str(fontR, fname); + Ch(fontR, "/"); Str(fontR, fname); IF family = "Syntax" THEN Str(fontR, " DefineSMapFont") ELSE Str(fontR, " DefineMapFont") END; Ln(fontR); Ln(fontR); END SetMappedFont; @@ -161,7 +161,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 | 92: Str(fontR, "backslash") | 93: Str(fontR, "bracketright") | 94: Str(fontR, "arrowup") - | 95: Str(fontR, "underscore") + | 95: Str(fontR, "underscore") | 96: Str(fontR, "grave") | 97..122: Ch(fontR, CHR(m)) | 123: Str(fontR, "braceleft") @@ -205,8 +205,8 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 Str(fontR, "% Conversion of the Oberon font "); Str(fontR, fd.name); Ln(fontR); Files.Read(R, ch); IF ch = fontFileId THEN - Files.Read(R, ch); Str(fontR, "% abstraction: "); Int(fontR, ORD(ch)); - Files.Read(R, ch); Str(fontR, ", family: "); Ch(fontR, ch); + Files.Read(R, ch); Str(fontR, "% abstraction: "); Int(fontR, ORD(ch)); + Files.Read(R, ch); Str(fontR, ", family: "); Ch(fontR, ch); Files.Read(R, ch); Str(fontR, ", variant: "); Int(fontR, ORD(ch)); Ln(fontR); Files.ReadInt(R, height); Str(fontR, "% height: "); Int(fontR, height); Ln(fontR); Ln(fontR); Files.ReadInt(R, minX); Files.ReadInt(R, maxX); @@ -223,7 +223,7 @@ MODULE Printer; (*UNIX version: JT 11.5.90, RC 2.7.93, JS 29.4.94, JT 14.4.95 Str(fontR, "/FontMatrix [ 72 "); Int(fontR, pRes); Str(fontR, " div "); Str(fontR, " .24 div 0 0 "); Str(fontR, "72 "); Int(fontR, pRes); Str(fontR, " div "); Str(fontR, " .24 div 0 0"); Str(fontR, "] def"); Ln(fontR); - Str(fontR, "/FontBBox ["); + Str(fontR, "/FontBBox ["); Int(fontR, minX); Ch(fontR, " "); Int(fontR, minY); Ch(fontR, " "); Int(fontR, maxX); Ch(fontR, " "); @@ -339,7 +339,7 @@ END; Error("file not found", headerFileName) END END Open; - + PROCEDURE UseListFont*(VAR name: ARRAY OF CHAR); BEGIN COPY(name, listFont); curFont := -1 @@ -368,7 +368,7 @@ END; IF fname = listFont THEN fontname := "Courier8.Scn.Fnt" ELSE COPY(fname, fontname) END ; IF (curFont < 0) OR (fontTable[curFont].name # fontname) THEN COPY(fontname, fontTable[fontIndex+1].name); - i := 0; WHILE i < 8 DO fontTable[fontIndex+1].used[i] := {}; INC(i) END; + i := 0; WHILE i < 8 DO fontTable[fontIndex+1].used[i] := {}; INC(i) END; fNo := 0; WHILE fontTable[fNo].name # fontname DO INC(fNo) END; IF fNo > fontIndex THEN (* DefineFont(fontname); *) fontIndex := fNo END; @@ -394,7 +394,7 @@ END; END; Str(bodyR, ") s"); Ln(bodyR) END ContString; - + PROCEDURE String*(x, y: INTEGER; VAR s, fname: ARRAY OF CHAR); BEGIN Int(bodyR, x); Ch(bodyR, " "); @@ -410,7 +410,7 @@ END; Int(bodyR, col); Str(bodyR, " b"); Ln(bodyR); END ReplPattern; - PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: LONGINT); + PROCEDURE Picture*(x, y, w, h, mode: INTEGER; adr: SYSTEM.ADDRESS); VAR n, i, v: INTEGER; ch: CHAR; BEGIN Int(bodyR, x); Ch(bodyR, " "); @@ -517,7 +517,7 @@ END; a[i] := 2.0*b[i-1] + hn; d[i] := d1 + dn; w[i] := 1.0; i := 0; WHILE i < n-2 DO c[i] := c[i]/a[i]; a[i+1] := a[i+1] - c[i]*b[i]; INC(i) END ; - SolveTriDiag(a, b, c, d, n-1); SolveTriDiag(a, b, c, w, n-1); + SolveTriDiag(a, b, c, d, n-1); SolveTriDiag(a, b, c, w, n-1); d1 := (d[0] + d[i])/(w[0] + w[i] + x[i+1] - x[i]); i := 0; WHILE i < n-1 DO d[i] := d[i] - d1*w[i]; INC(i) END ; d[i] := d[0] @@ -582,7 +582,7 @@ END; END Spline; PROCEDURE Page*(nofcopies: INTEGER); - BEGIN + BEGIN curR := 0; curG := 0; curB := 0; curFont := -1; INC(pno); ppos := Files.Pos(bodyR); PrintCopies := nofcopies; IF PrintMode[1] # ":" THEN @@ -639,7 +639,7 @@ END; IF PrinterName # "none" THEN Files.Write(printR, 4X) (*force reset postscript*) END ; Files.Register(printF); IF PrinterName # "none" THEN - cmd := "lp -c -s "; + cmd := "lp -c -s "; IF PrinterName # "Pluto" THEN Append(cmd, "-d "); Append(cmd, PrinterName) END ; Append(cmd, " "); Append(cmd, printFileName); i := Platform.System(cmd); diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index f514c9cf..2a908c99 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"read(fd, (void*)(address)(p), l)"; +"(LONGINT)read(fd, (void*)(address)(p), l)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -388,7 +388,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): ErrorCode; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; VAR written: SYSTEM.ADDRESS; BEGIN written := writefile(h, p, l); diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index a81507d9..f91415c5 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -25,7 +25,7 @@ TYPE EnvPtr = POINTER TO ARRAY 1024 OF CHAR; ArgPtr = POINTER TO ARRAY 1024 OF CHAR; ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF LONGINT; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; VAR @@ -412,31 +412,29 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): INTEGER +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER "(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; -VAR result: INTEGER; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; BEGIN - n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) - result := readfile(h, p, l, n); - IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END + result := readfile(h, p, l, lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; -VAR result: INTEGER; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; BEGIN - n := 0; (* Clear n because readfile takes a SYSTEM.ADDRESS but only updates the bottom 32 bits *) - result := readfile(h, SYSTEM.ADR(b), LEN(b), n); - IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END + result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): INTEGER +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER "(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; -PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END END Write; diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make index 260ca57c..b863944a 100644 --- a/src/tools/make/vishap.make +++ b/src/tools/make/vishap.make @@ -20,7 +20,7 @@ FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) BUILDDIR = build/$(FLAVOUR) VISHAP = $(ONAME)$(BINEXT) -#MODEL=-O2 # Override model - build everything as S8,I16,L32. +MODEL=-O2 # Override model - build everything as S8,I16,L32. From 8017aa445c8503388fa131a81d411c94ad85533f Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 17:12:02 +0100 Subject: [PATCH 052/140] Beginning to simplify build process --- bootstrap/unix-44/OPM.c | 14 +++++++------- bootstrap/unix-44/OPM.h | 4 ++-- bootstrap/unix-48/OPM.c | 14 +++++++------- bootstrap/unix-48/OPM.h | 4 ++-- bootstrap/unix-88/OPM.c | 12 ++++++------ bootstrap/unix-88/OPM.h | 4 ++-- bootstrap/windows-48/OPM.c | 14 +++++++------- bootstrap/windows-48/OPM.h | 4 ++-- bootstrap/windows-88/OPM.c | 12 ++++++------ bootstrap/windows-88/OPM.h | 4 ++-- src/compiler/OPM.cmdln.Mod | 21 ++++++++++++--------- src/compiler/Vishap.Mod | 2 +- src/tools/make/configure.c | 4 ---- 13 files changed, 56 insertions(+), 57 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2769f708..8b1f6805 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1121,8 +1121,8 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 366d6522..931ecb18 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -19,7 +19,7 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -28,8 +28,7 @@ export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; export SET OPM_opt, OPM_glbopt; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber; -static int64 OPM_lasterrpos; +static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; @@ -63,7 +62,7 @@ export void OPM_LogWNum (int64 i, int64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); export int32 OPM_Longint (int64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int64 pos); +export void OPM_Mark (int16 n, int32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); @@ -97,6 +96,7 @@ export void OPM_err (int16 n); static int32 OPM_minusop (int32 i); static int32 OPM_power0 (int32 i, int32 j); +#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s void OPM_LogW (CHAR ch) { @@ -570,7 +570,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int64 pos) +void OPM_Mark (int16 n, int32 pos) { if (pos == -1) { pos = 0; @@ -1122,7 +1122,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; - OPM_Alignment = 8; + OPM_GetAlignment(&OPM_Alignment); OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a6b7990c..96af4022 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -33,7 +33,7 @@ import void OPM_LogWLn (void); import void OPM_LogWNum (int64 i, int64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int64 pos); +import void OPM_Mark (int16 n, int32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.cmdln.Mod index ded87d02..e954ea63 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.cmdln.Mod @@ -67,7 +67,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BodyFile* = 1; HeaderInclude* = 2; - (* C default expression integral size details. Const for now, will be var with avr_gcc/sdcc support *) + (* C default expression integral size details. Const for now, should be var for avr_gcc/sdcc support *) CIntSize* = 4; CIntMax* = 7FFFFFFFH; CIntMin* = -CIntMax - 1; @@ -88,12 +88,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) SourceFileName : ARRAY 256 OF CHAR; (* Parameter selectable sizes *) - Alignment*, - AddressSize*, SetSize*, + AddressSize*, Alignment*, + SetSize*, ShortintSize*, IntegerSize*, LongintSize*: INTEGER; MaxSet*: INTEGER; - MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -110,7 +109,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) - lasterrpos: SYSTEM.INT64; + lasterrpos: LONGINT; inR: Texts.Reader; Log: Texts.Text; W: Texts.Writer; @@ -479,7 +478,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ShowLine; - PROCEDURE Mark*(n: INTEGER; pos: SYSTEM.INT64); + PROCEDURE Mark*(n: INTEGER; pos: LONGINT); BEGIN IF pos = -1 THEN pos := 0 END; IF n >= 0 THEN @@ -853,6 +852,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseFiles; + + +PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; + BEGIN Texts.OpenWriter(W); @@ -867,9 +870,9 @@ BEGIN Files.SetSearchPath(OBERON); - (* type sizes with configuration based defaults *) - AddressSize := Configuration.addressSize; - Alignment := Configuration.alignment; + (* Default address size and alignment are those of this compiler *) + AddressSize := SIZE(SYSTEM.ADDRESS); + GetAlignment(Alignment); (* Default type size model is that of the original Oberon-2 implementation (-O2) *) ShortintSize := 1; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index b6ca8bf2..a898c9a4 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -96,7 +96,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) extTools.Assemble(OPM.modName) ELSE IF ~(OPM.mainprog IN OPM.opt) THEN - (* Assemble non main rogram and add object name to link list *) + (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); Strings.Append(OPM.modName, modulesobj); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index c000b68b..936c71bb 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -401,15 +401,11 @@ void writeConfigurationMod() { fprintf(fd, "MODULE Configuration;\n"); fprintf(fd, "CONST\n"); fprintf(fd, " name* = '%s';\n", oname); - fprintf(fd, " intsize* = %d;\n", intsize); - fprintf(fd, " addressSize* = %d;\n", addressSize); - fprintf(fd, " alignment* = %d;\n", alignment); fprintf(fd, " objext* = '%s';\n", objext); fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); fprintf(fd, " compile* = '%s';\n", cc); - fprintf(fd, " dataModel* = '%s';\n", dataModel); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); fprintf(fd, "VAR\n"); From fb002de0dd35fd69a44d13670b21e40efaadad3c Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 19:04:26 +0100 Subject: [PATCH 053/140] Move alignment and type size code from OPC to OPT. Remove search path in bootstrap compiler. --- bootstrap/unix-44/Configuration.c | 6 +- bootstrap/unix-44/Configuration.h | 4 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 5 +- bootstrap/unix-44/OPB.h | 3 +- bootstrap/unix-44/OPC.c | 188 +++++++++--------------- bootstrap/unix-44/OPC.h | 5 +- bootstrap/unix-44/OPM.c | 7 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-44/OPT.h | 8 +- bootstrap/unix-44/OPV.c | 88 +----------- bootstrap/unix-44/OPV.h | 3 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 5 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 6 +- bootstrap/unix-48/Configuration.h | 4 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 5 +- bootstrap/unix-48/OPB.h | 3 +- bootstrap/unix-48/OPC.c | 188 +++++++++--------------- bootstrap/unix-48/OPC.h | 5 +- bootstrap/unix-48/OPM.c | 7 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-48/OPT.h | 8 +- bootstrap/unix-48/OPV.c | 88 +----------- bootstrap/unix-48/OPV.h | 3 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 5 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 6 +- bootstrap/unix-88/Configuration.h | 4 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 5 +- bootstrap/unix-88/OPB.h | 3 +- bootstrap/unix-88/OPC.c | 188 +++++++++--------------- bootstrap/unix-88/OPC.h | 5 +- bootstrap/unix-88/OPM.c | 7 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/unix-88/OPT.h | 8 +- bootstrap/unix-88/OPV.c | 88 +----------- bootstrap/unix-88/OPV.h | 3 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 5 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 6 +- bootstrap/windows-48/Configuration.h | 4 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 5 +- bootstrap/windows-48/OPB.h | 3 +- bootstrap/windows-48/OPC.c | 188 +++++++++--------------- bootstrap/windows-48/OPC.h | 5 +- bootstrap/windows-48/OPM.c | 7 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/windows-48/OPT.h | 8 +- bootstrap/windows-48/OPV.c | 88 +----------- bootstrap/windows-48/OPV.h | 3 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 5 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 6 +- bootstrap/windows-88/Configuration.h | 4 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 5 +- bootstrap/windows-88/OPB.h | 3 +- bootstrap/windows-88/OPC.c | 188 +++++++++--------------- bootstrap/windows-88/OPC.h | 5 +- bootstrap/windows-88/OPM.c | 7 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 207 ++++++++++++++++++++++----- bootstrap/windows-88/OPT.h | 8 +- bootstrap/windows-88/OPV.c | 88 +----------- bootstrap/windows-88/OPV.h | 3 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 5 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 12 +- src/compiler/OPB.Mod | 3 +- src/compiler/OPC.Mod | 46 +----- src/compiler/OPT.Mod | 98 ++++++++++++- src/compiler/OPV.Mod | 56 +------- src/compiler/Vishap.Mod | 3 +- src/tools/make/configure.c | 65 +++++---- 202 files changed, 1628 insertions(+), 1590 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 0a7ac692..ad002606 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index e2b7a3bb..0518133f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 8e7d9b8d..7405b27f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 2dacc4b8..e95203ed 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f63a7cb6..28dd23c6 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1a87761b..56d3fd40 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 0a7ac692..ad002606 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index e2b7a3bb..0518133f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c52efac6..1b69128c 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 2dacc4b8..e95203ed 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 60a7ea7a..779daa7a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index df86e814..07f53445 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 115e60f5..f9e5e585 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e7eb30f3..d7e16dab 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index a371a423..64d47c3f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 16ae9ffd..785efa1a 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 151a2d59..cfa2ab6f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f844dfa9..b6890cfe 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 931ecb18..7b566324 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 74f93e77..03366726 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d40808d2..c9ff5430 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8ef2c450..f9e7c27c 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 016d1d64..8df906c3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 32d37057..d76d7ed5 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 8c41a062..6cb415b9 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fa080b7f..dc456f77 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 7b492ced..8b55dc14 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 98974743..9a5d7c98 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 80684752..3e6db0f2 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b7c8c827..905fcb24 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 6ad4813e..3ea975a7 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 7704f005..21d62e05 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8b1f6805..9297c0a3 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 4; diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a3ab1dd3..66b821d2 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c52efac6..1b69128c 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8bb5ec32..cdb2ab50 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 8aeae1b8..21a73e4d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d62dd343..d697acd7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 60a7ea7a..779daa7a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index df86e814..07f53445 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index abdf151b..7f7f4b26 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -7,7 +7,7 @@ #include "SYSTEM.h" -export CHAR Configuration_versionLong[41]; +export CHAR Configuration_versionLong[75]; @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f51f63f2..618bc77f 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h @@ -6,7 +6,7 @@ #include "SYSTEM.h" -import CHAR Configuration_versionLong[41]; +import CHAR Configuration_versionLong[75]; import void *Configuration__init(void); diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7b492ced..8b55dc14 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index b08c93ea..d645f05c 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c30a1491..1071d452 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 13fccd9a..1a73a6ec 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 16ae9ffd..785efa1a 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 151a2d59..cfa2ab6f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tsSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index f844dfa9..b6890cfe 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 060208c6..d2d0a476 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index e09bf1b4..6c15aa17 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -10,7 +10,6 @@ #include "OPT.h" -export void (*OPB_typSize)(OPT_Struct); static int16 OPB_exp; static int64 OPB_maxExp; @@ -1917,7 +1916,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) OPB_err(110); x = OPB_NewIntConst(1); } else if (__IN(f, 0x18fe, 32) || __IN(x->typ->comp, 0x14, 32)) { - (*OPB_typSize)(x->typ); + OPT_TypSize(x->typ); x->typ->pvused = 1; x = OPB_NewIntConst(x->typ->size); } else { diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index dc0085af..8395741b 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -8,7 +8,6 @@ #include "OPT.h" -import void (*OPB_typSize)(OPT_Struct); import void OPB_Assign (OPT_Node *x, OPT_Node y); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 99353400..9104c5c4 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,10 +17,8 @@ static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; -export void OPC_Align (int32 *adr, int32 base); export void OPC_Andent (OPT_Struct typ); static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); -export int32 OPC_BaseAlignment (OPT_Struct typ); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); @@ -79,7 +77,6 @@ static void OPC_PutBase (OPT_Struct typ); static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); -export int32 OPC_SizeAlignment (int32 size); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); @@ -750,7 +747,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) { int16 i; OPT_ConstExt ext = NIL; - int16 _for__9; + int16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { @@ -762,9 +759,9 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (int16)(*obj->conval->ext)[0]; + _for__7 = (int16)(*obj->conval->ext)[0]; i = i; - while (i <= _for__9) { + while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); i += 1; } @@ -843,64 +840,11 @@ void OPC_InitTDesc (OPT_Struct typ) } } -void OPC_Align (int32 *adr, int32 base) -{ - switch (base) { - case 2: - *adr += __MASK(*adr, -2); - break; - case 4: - *adr += __MASK(-*adr, -4); - break; - case 8: - *adr += __MASK(-*adr, -8); - break; - case 16: - *adr += __MASK(-*adr, -16); - break; - default: - break; - } -} - -int32 OPC_SizeAlignment (int32 size) -{ - int32 _o_result; - int32 alignment; - if (size < OPM_Alignment) { - alignment = 1; - while (alignment < size) { - alignment = __ASHL(alignment, 1); - } - } else { - alignment = OPM_Alignment; - } - _o_result = alignment; - return _o_result; -} - -int32 OPC_BaseAlignment (OPT_Struct typ) -{ - int32 _o_result; - int32 alignment; - if (typ->form == 13) { - if (typ->comp == 4) { - alignment = __MASK(typ->align, -65536); - } else { - alignment = OPC_BaseAlignment(typ->BaseTyp); - } - } else { - alignment = OPC_SizeAlignment(typ->size); - } - _o_result = alignment; - return _o_result; -} - static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) { int32 adr; adr = off; - OPC_Align(&adr, align); + OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { gap -= (adr - off) + align; OPC_BegStat(); @@ -955,8 +899,8 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } else { adr = *off; - fldAlign = OPC_BaseAlignment(fld->typ); - OPC_Align(&adr, fldAlign); + fldAlign = OPT_BaseAlignment(fld->typ); + OPT_Align(&adr, fldAlign); gap = fld->adr - adr; if (fldAlign > *curAlign) { *curAlign = fldAlign; @@ -1205,7 +1149,7 @@ static void OPC_GenHeaderMsg (void) OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); - OPM_WriteString(Configuration_versionLong, 41); + OPM_WriteString(Configuration_versionLong, 75); OPM_Write(' '); i = 0; while (i <= 31) { @@ -1966,84 +1910,84 @@ void OPC_Constant (OPT_Const con, int16 form) } } -static struct InitKeywords__48 { +static struct InitKeywords__46 { int8 *n; - struct InitKeywords__48 *lnk; -} *InitKeywords__48_s; + struct InitKeywords__46 *lnk; +} *InitKeywords__46_s; -static void Enter__49 (CHAR *s, LONGINT s__len); +static void Enter__47 (CHAR *s, LONGINT s__len); -static void Enter__49 (CHAR *s, LONGINT s__len) +static void Enter__47 (CHAR *s, LONGINT s__len) { int16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); - OPC_hashtab[__X(h, 105)] = *InitKeywords__48_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__48_s->n, 50)], 9); - *InitKeywords__48_s->n += 1; + OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { int8 n, i; - struct InitKeywords__48 _s; + struct InitKeywords__46 _s; _s.n = &n; - _s.lnk = InitKeywords__48_s; - InitKeywords__48_s = &_s; + _s.lnk = InitKeywords__46_s; + InitKeywords__46_s = &_s; n = 0; i = 0; while (i <= 104) { OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"address", 8); - Enter__49((CHAR*)"asm", 4); - Enter__49((CHAR*)"auto", 5); - Enter__49((CHAR*)"break", 6); - Enter__49((CHAR*)"case", 5); - Enter__49((CHAR*)"char", 5); - Enter__49((CHAR*)"const", 6); - Enter__49((CHAR*)"continue", 9); - Enter__49((CHAR*)"default", 8); - Enter__49((CHAR*)"do", 3); - Enter__49((CHAR*)"double", 7); - Enter__49((CHAR*)"else", 5); - Enter__49((CHAR*)"enum", 5); - Enter__49((CHAR*)"extern", 7); - Enter__49((CHAR*)"export", 7); - Enter__49((CHAR*)"float", 6); - Enter__49((CHAR*)"for", 4); - Enter__49((CHAR*)"fortran", 8); - Enter__49((CHAR*)"goto", 5); - Enter__49((CHAR*)"if", 3); - Enter__49((CHAR*)"import", 7); - Enter__49((CHAR*)"int", 4); - Enter__49((CHAR*)"int16", 6); - Enter__49((CHAR*)"int32", 6); - Enter__49((CHAR*)"int64", 6); - Enter__49((CHAR*)"int8", 5); - Enter__49((CHAR*)"long", 5); - Enter__49((CHAR*)"register", 9); - Enter__49((CHAR*)"return", 7); - Enter__49((CHAR*)"short", 6); - Enter__49((CHAR*)"signed", 7); - Enter__49((CHAR*)"sizeof", 7); - Enter__49((CHAR*)"size_t", 7); - Enter__49((CHAR*)"static", 7); - Enter__49((CHAR*)"struct", 7); - Enter__49((CHAR*)"switch", 7); - Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uint16", 7); - Enter__49((CHAR*)"uint32", 7); - Enter__49((CHAR*)"uint64", 7); - Enter__49((CHAR*)"uint8", 6); - Enter__49((CHAR*)"union", 6); - Enter__49((CHAR*)"unsigned", 9); - Enter__49((CHAR*)"void", 5); - Enter__49((CHAR*)"volatile", 9); - Enter__49((CHAR*)"while", 6); - InitKeywords__48_s = _s.lnk; + Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"asm", 4); + Enter__47((CHAR*)"auto", 5); + Enter__47((CHAR*)"break", 6); + Enter__47((CHAR*)"case", 5); + Enter__47((CHAR*)"char", 5); + Enter__47((CHAR*)"const", 6); + Enter__47((CHAR*)"continue", 9); + Enter__47((CHAR*)"default", 8); + Enter__47((CHAR*)"do", 3); + Enter__47((CHAR*)"double", 7); + Enter__47((CHAR*)"else", 5); + Enter__47((CHAR*)"enum", 5); + Enter__47((CHAR*)"extern", 7); + Enter__47((CHAR*)"export", 7); + Enter__47((CHAR*)"float", 6); + Enter__47((CHAR*)"for", 4); + Enter__47((CHAR*)"fortran", 8); + Enter__47((CHAR*)"goto", 5); + Enter__47((CHAR*)"if", 3); + Enter__47((CHAR*)"import", 7); + Enter__47((CHAR*)"int", 4); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"long", 5); + Enter__47((CHAR*)"register", 9); + Enter__47((CHAR*)"return", 7); + Enter__47((CHAR*)"short", 6); + Enter__47((CHAR*)"signed", 7); + Enter__47((CHAR*)"sizeof", 7); + Enter__47((CHAR*)"size_t", 7); + Enter__47((CHAR*)"static", 7); + Enter__47((CHAR*)"struct", 7); + Enter__47((CHAR*)"switch", 7); + Enter__47((CHAR*)"typedef", 8); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); + Enter__47((CHAR*)"union", 6); + Enter__47((CHAR*)"unsigned", 9); + Enter__47((CHAR*)"void", 5); + Enter__47((CHAR*)"volatile", 9); + Enter__47((CHAR*)"while", 6); + InitKeywords__46_s = _s.lnk; } diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4215947f..6236cd73 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -9,9 +9,7 @@ -import void OPC_Align (int32 *adr, int32 base); import void OPC_Andent (OPT_Struct typ); -import int32 OPC_BaseAlignment (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); @@ -41,7 +39,6 @@ import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); -import int32 OPC_SizeAlignment (int32 size); import void OPC_TDescDecl (OPT_Struct typ); import void OPC_TypeDefs (OPT_Object obj, int16 vis); import void OPC_TypeOf (OPT_Object ap); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 931ecb18..7b566324 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -223,6 +223,7 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; + Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': @@ -270,7 +271,7 @@ BOOLEAN OPM_OpenPar (void) if (Platform_ArgCount == 1) { OPM_LogWLn(); OPM_LogWStr((CHAR*)"Oberon-2 compiler v", 20); - OPM_LogWStr(Configuration_versionLong, 41); + OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); @@ -1118,7 +1119,7 @@ export void *OPM__init(void) Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); + Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024); OPM_AddressSize = 8; diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 96af4022..b62666db 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 74f93e77..03366726 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e5a59f6c..ea6663ba 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0cac83bd..2b449cae 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index caef45f4..8d90d974 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin tspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d40808d2..c9ff5430 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -87,7 +87,6 @@ typedef } OPT_StrDesc; -export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -100,6 +99,7 @@ static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; static int32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; +static int32 OPT_recno; export address *OPT_ConstDesc__typ; export address *OPT_ObjDesc__typ; @@ -108,6 +108,8 @@ export address *OPT_NodeDesc__typ; export address *OPT_ImpCtxt__typ; export address *OPT_ExpCtxt__typ; +export void OPT_Align (int32 *adr, int32 base); +export int32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); @@ -136,6 +138,7 @@ static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); export void OPT_Init (OPS_Name name, SET opt); +export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -157,9 +160,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +export int32 OPT_SizeAlignment (int32 size); +export void OPT_TypSize (OPT_Struct typ); static void OPT_err (int16 n); +void OPT_InitRecno (void) +{ + OPT_recno = 0; +} + static void OPT_err (int16 n) { OPM_err(n); @@ -240,6 +250,130 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } +void OPT_Align (int32 *adr, int32 base) +{ + switch (base) { + case 2: + *adr += __MASK(*adr, -2); + break; + case 4: + *adr += __MASK(-*adr, -4); + break; + case 8: + *adr += __MASK(-*adr, -8); + break; + case 16: + *adr += __MASK(-*adr, -16); + break; + default: + break; + } +} + +int32 OPT_SizeAlignment (int32 size) +{ + int32 _o_result; + int32 alignment; + if (size < OPM_Alignment) { + alignment = 1; + while (alignment < size) { + alignment = __ASHL(alignment, 1); + } + } else { + alignment = OPM_Alignment; + } + _o_result = alignment; + return _o_result; +} + +int32 OPT_BaseAlignment (OPT_Struct typ) +{ + int32 _o_result; + int32 alignment; + if (typ->form == 13) { + if (typ->comp == 4) { + alignment = __MASK(typ->align, -65536); + } else { + alignment = OPT_BaseAlignment(typ->BaseTyp); + } + } else { + alignment = OPT_SizeAlignment(typ->size); + } + _o_result = alignment; + return _o_result; +} + +void OPT_TypSize (OPT_Struct typ) +{ + int16 f, c; + int32 offset, size, base, fbase, off0; + OPT_Object fld = NIL; + OPT_Struct btyp = NIL; + if (typ == OPT_undftyp) { + OPM_err(58); + } else if (typ->size == -1) { + f = typ->form; + c = typ->comp; + if (c == 4) { + btyp = typ->BaseTyp; + if (btyp == NIL) { + offset = 0; + base = 1; + } else { + OPT_TypSize(btyp); + offset = btyp->size - __ASHR(btyp->sysflag, 8); + base = btyp->align; + } + fld = typ->link; + while ((fld != NIL && fld->mode == 4)) { + btyp = fld->typ; + OPT_TypSize(btyp); + size = btyp->size; + fbase = OPT_BaseAlignment(btyp); + OPT_Align(&offset, fbase); + fld->adr = offset; + offset += size; + if (fbase > base) { + base = fbase; + } + fld = fld->link; + } + off0 = offset; + if (offset == 0) { + offset = 1; + } + OPT_Align(&offset, base); + if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { + OPT_recno += 1; + base += __ASHL(OPT_recno, 16); + } + typ->size = offset; + typ->align = base; + typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + } else if (c == 2) { + OPT_TypSize(typ->BaseTyp); + typ->size = typ->n * typ->BaseTyp->size; + } else if (f == 11) { + typ->size = OPM_AddressSize; + if (typ->BaseTyp == OPT_undftyp) { + OPM_Mark(128, typ->n); + } else { + OPT_TypSize(typ->BaseTyp); + } + } else if (f == 12) { + typ->size = OPM_AddressSize; + } else if (c == 3) { + btyp = typ->BaseTyp; + OPT_TypSize(btyp); + if (btyp->comp == 3) { + typ->size = btyp->size + 4; + } else { + typ->size = 8; + } + } + } +} + OPT_Const OPT_NewConst (void) { OPT_Const _o_result; @@ -552,21 +686,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__13 { +static struct FPrintStr__15 { int32 *pbfp, *pvfp; - struct FPrintStr__13 *lnk; -} *FPrintStr__13_s; + struct FPrintStr__15 *lnk; +} *FPrintStr__15_s; -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__18 (OPT_Object obj); +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__14(typ->link, adr, 0); + FPrintFlds__16(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -576,53 +710,53 @@ static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__16(btyp, fld, adr); + FPrintHdFld__18(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__15_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__15_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__15_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__15_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__16(fld->typ, fld, fld->adr + adr); + FPrintHdFld__18(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__18 (OPT_Object obj) +static void FPrintTProcs__20 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__18(obj->left); + FPrintTProcs__20(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__15_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__15_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__15_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__15_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__18(obj->right); + FPrintTProcs__20(obj->right); } } @@ -632,11 +766,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__13 _s; + struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__13_s; - FPrintStr__13_s = &_s; + _s.lnk = FPrintStr__15_s; + FPrintStr__15_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -673,11 +807,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__14(typ->link, 0, 1); + FPrintFlds__16(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__18(typ->link); + FPrintTProcs__20(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -687,7 +821,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__13_s = _s.lnk; + FPrintStr__15_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1119,7 +1253,7 @@ static void OPT_InStruct (OPT_Struct *typ) (*typ)->comp = 2; OPT_InStruct(&(*typ)->BaseTyp); (*typ)->n = OPM_SymRInt(); - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 38: (*typ)->form = 13; @@ -1130,7 +1264,7 @@ static void OPT_InStruct (OPT_Struct *typ) } else { (*typ)->n = 0; } - (*OPT_typSize)(*typ); + OPT_TypSize(*typ); break; case 39: (*typ)->form = 13; @@ -1899,6 +2033,7 @@ export void *OPT__init(void) __REGMOD("OPT", EnumPtrs); __REGCMD("Close", OPT_Close); __REGCMD("CloseScope", OPT_CloseScope); + __REGCMD("InitRecno", OPT_InitRecno); __INITYP(OPT_ConstDesc, OPT_ConstDesc, 0); __INITYP(OPT_ObjDesc, OPT_ObjDesc, 0); __INITYP(OPT_StrDesc, OPT_StrDesc, 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 0bd1f189..1a525fcb 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -66,7 +66,6 @@ typedef } OPT_StrDesc; -import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; @@ -80,6 +79,8 @@ import address *OPT_ObjDesc__typ; import address *OPT_StrDesc__typ; import address *OPT_NodeDesc__typ; +import void OPT_Align (int32 *adr, int32 base); +import int32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); @@ -92,6 +93,7 @@ import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); import void OPT_Init (OPS_Name name, SET opt); +import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); import int16 OPT_IntSize (int64 n); @@ -103,6 +105,8 @@ import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); +import int32 OPT_SizeAlignment (int32 size); +import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8ef2c450..f9e7c27c 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -17,7 +17,6 @@ typedef static int16 OPV_stamp; -static int32 OPV_recno; static OPV_ExitInfo OPV_exit; static int16 OPV_nofExitLabels; @@ -46,88 +45,15 @@ static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); -export void OPV_TypSize (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); static void OPV_design (OPT_Node n, int16 prec); static void OPV_expr (OPT_Node n, int16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); -void OPV_TypSize (OPT_Struct typ) -{ - int16 f, c; - int32 offset, size, base, fbase, off0; - OPT_Object fld = NIL; - OPT_Struct btyp = NIL; - if (typ == OPT_undftyp) { - OPM_err(58); - } else if (typ->size == -1) { - f = typ->form; - c = typ->comp; - if (c == 4) { - btyp = typ->BaseTyp; - if (btyp == NIL) { - offset = 0; - base = 1; - } else { - OPV_TypSize(btyp); - offset = btyp->size - __ASHR(btyp->sysflag, 8); - base = btyp->align; - } - fld = typ->link; - while ((fld != NIL && fld->mode == 4)) { - btyp = fld->typ; - OPV_TypSize(btyp); - size = btyp->size; - fbase = OPC_BaseAlignment(btyp); - OPC_Align(&offset, fbase); - fld->adr = offset; - offset += size; - if (fbase > base) { - base = fbase; - } - fld = fld->link; - } - off0 = offset; - if (offset == 0) { - offset = 1; - } - OPC_Align(&offset, base); - if ((typ->strobj == NIL && __MASK(typ->align, -65536) == 0)) { - OPV_recno += 1; - base += __ASHL(OPV_recno, 16); - } - typ->size = offset; - typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); - } else if (c == 2) { - OPV_TypSize(typ->BaseTyp); - typ->size = typ->n * typ->BaseTyp->size; - } else if (f == 11) { - typ->size = OPM_AddressSize; - if (typ->BaseTyp == OPT_undftyp) { - OPM_Mark(128, typ->n); - } else { - OPV_TypSize(typ->BaseTyp); - } - } else if (f == 12) { - typ->size = OPM_AddressSize; - } else if (c == 3) { - btyp = typ->BaseTyp; - OPV_TypSize(btyp); - if (btyp->comp == 3) { - typ->size = btyp->size + 4; - } else { - typ->size = 8; - } - } - } -} - void OPV_Init (void) { OPV_stamp = 0; - OPV_recno = 0; OPV_nofExitLabels = 0; } @@ -212,7 +138,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte mode = obj->mode; if ((mode == 5 && (obj->vis != 0) == exported)) { typ = obj->typ; - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); if (typ->form == 11) { typ = typ->BaseTyp; } @@ -222,7 +148,7 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte } else if (mode == 13) { OPV_GetTProcNum(obj); } else if (mode == 1) { - OPV_TypSize(obj->typ); + OPT_TypSize(obj->typ); } if (!exported) { if ((__IN(mode, 0x60, 32) && obj->mnolev > 0)) { @@ -548,7 +474,7 @@ static void OPV_design (OPT_Node n, int16 prec) OPT_Struct typ = NIL; int16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__27; + int16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; @@ -624,9 +550,9 @@ static void OPV_design (OPT_Node n, int16 prec) } x = x->left; } - _for__27 = dims; + _for__26 = dims; i = 1; - while (i <= _for__27) { + while (i <= _for__26) { OPM_Write(')'); i += 1; } @@ -1290,7 +1216,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(base->size); OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPC_BaseAlignment(base)); + OPM_WriteInt(OPT_BaseAlignment(base)); OPM_WriteString((CHAR*)", ", 3); OPM_WriteInt(nofdim); OPM_WriteString((CHAR*)", ", 3); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index c309d63c..09931dda 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h @@ -12,7 +12,6 @@ import void OPV_AdrAndSize (OPT_Object topScope); import void OPV_Init (void); import void OPV_Module (OPT_Node prog); -import void OPV_TypSize (OPT_Struct typ); import void *OPV__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 59f9cfeb..8dc2c83e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d62dd343..d697acd7 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index fe93e8be..4b72fbe3 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e7cba0d8..4a4c73b0 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 427a0cc4..f765b98f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 44c51b2a..be1e7d7f 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 8c41a062..6cb415b9 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fa080b7f..dc456f77 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index 1ec89e33..30b81ac7 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspamSf */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -35,6 +35,7 @@ void Vishap_Module (BOOLEAN *done) OPP_Module(&p, OPM_opt); if (OPM_noerr) { OPV_Init(); + OPT_InitRecno(); OPV_AdrAndSize(OPT_topScope); OPT_Export(&ext, &new); if (OPM_noerr) { @@ -165,8 +166,6 @@ export int main(int argc, char **argv) Platform_SetInterruptHandler(Vishap_Trap); Platform_SetQuitHandler(Vishap_Trap); Platform_SetBadInstructionHandler(Vishap_Trap); - OPB_typSize = OPV_TypSize; - OPT_typSize = OPV_TypSize; Vishap_Translate(); __FINI; } diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 0a40d5e9..d465624d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 759b613e..cf093ab3 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 8be0b63d..46f8ac7e 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,7 +89,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); @@ -108,7 +108,7 @@ export void *extTools__init(void) __REGMOD("extTools", 0); /* BEGIN */ Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023); + Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index bff1c62c..700e6b39 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 4f6a6c9d..8d4cbdfc 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 94f8add4..da86e98b 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */ +/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 491b28f1..c9feb82b 100644 --- a/makefile +++ b/makefile @@ -109,6 +109,14 @@ configuration: FORCE @echo Branch: $$(git rev-parse --abbrev-ref HEAD). +bootstrapconfiguration: FORCE + @$(CC) -I src/system -o a.o src/tools/make/configure.c + @./a.o bootstrap + @rm a.o + @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make + @echo Branch: $$(git rev-parse --abbrev-ref HEAD). + + reportsizes: FORCE @@ -257,7 +265,7 @@ planned-binary-change: # bootstrap: Rebuild the bootstrap directories # If the bootstrap directories are broken or only partially # built then run 'make revertbootstrap' first. -bootstrap: configuration +bootstrap: bootstrapconfiguration @make -f src/tools/make/vishap.make -s clean @make -f src/tools/make/vishap.make -s translate @make -f src/tools/make/vishap.make -s assemble @@ -270,7 +278,7 @@ bootstrap: configuration cp src/system/*.[ch] bootstrap -bootstrapunclean: +bootstrapunclean: bootstrapconfiguration rm -rf bootstrap/* make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index e1ed3aa0..8382c965 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -9,7 +9,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR - typSize*: PROCEDURE(typ: OPT.Struct); exp: INTEGER; (* side effect of log*) maxExp: SYSTEM.INT64; (* max n in ASH(1, n) on this machine *) @@ -1037,7 +1036,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF x^.class # OPT.Ntype THEN err(110); x := NewIntConst(1) ELSIF (f IN {OPT.Byte..OPT.Set, OPT.Pointer, OPT.ProcTyp}) OR (x^.typ^.comp IN {OPT.Array, OPT.Record}) THEN - typSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) + OPT.TypSize(x^.typ); x^.typ^.pvused := TRUE; x := NewIntConst(x^.typ^.size) ELSE err(111); x := NewIntConst(1) END |OPT.ccfn: (*SYSTEM.CC*) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 8059d5fb..456bcf87 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -553,46 +553,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF typ^.strobj # NIL THEN InitTProcs(typ^.strobj, typ^.link) END END InitTDesc; - PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); - BEGIN - CASE base OF - | 2: INC(adr, adr MOD 2) - | 4: INC(adr, (-adr) MOD 4) - | 8: INC(adr, (-adr) MOD 8) - | 16: INC(adr, (-adr) MOD 16) - ELSE (*1*) (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) - END - END Align; - - PROCEDURE SizeAlignment*(size: LONGINT): LONGINT; - VAR alignment: LONGINT; - BEGIN - IF size < OPM.Alignment THEN - (* Round up to next power of 2 *) - alignment := 1; WHILE alignment < size DO alignment := alignment * 2 END; - ELSE - alignment := OPM.Alignment - END; - RETURN alignment - END SizeAlignment; - - - PROCEDURE BaseAlignment*(typ: OPT.Struct): LONGINT; - VAR alignment: LONGINT; - BEGIN - IF typ.form = OPT.Comp THEN - IF typ.comp = OPT.Record THEN - alignment := typ.align MOD 10000H - ELSE - alignment := BaseAlignment(typ.BaseTyp) - END - ELSE - alignment := SizeAlignment(typ.size) - END; - RETURN alignment - END BaseAlignment; - - PROCEDURE FillGap(gap, off, align: LONGINT; VAR n, curAlign: LONGINT); (* gap: Required gap - already calculated based on alignment requirements off: Current offset - where gap begins @@ -602,7 +562,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) *) VAR adr: LONGINT; BEGIN - adr := off; Align(adr, align); + adr := off; OPT.Align(adr, align); IF (curAlign < align) & (gap - (adr - off) >= align) THEN (* preserve alignment of the enclosing struct! *) DEC(gap, (adr - off) + align); BegStat; @@ -640,8 +600,8 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSE (* mimic OPV.TypSize to detect gaps caused by private fields *) adr := off; - fldAlign := BaseAlignment(fld^.typ); - Align(adr, fldAlign); + fldAlign := OPT.BaseAlignment(fld^.typ); + OPT.Align(adr, fldAlign); gap := fld.adr - adr; IF fldAlign > curAlign THEN curAlign := fldAlign END; IF gap > 0 THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 7648fcec..bd95c80f 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -149,7 +149,6 @@ CONST FirstRef = Comp + 1; VAR - typSize*: PROCEDURE(typ: Struct); topScope*: Object; undftyp*, @@ -205,10 +204,11 @@ VAR newsf, findpc: BOOLEAN; extsf, sfpresent: BOOLEAN; symExtended, symNew: BOOLEAN; + recno: LONGINT; (* number of anonymous record types *) - +PROCEDURE InitRecno*; BEGIN recno := 0 END InitRecno; PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; @@ -250,6 +250,96 @@ BEGIN END ShorterOrLongerType; +PROCEDURE Align*(VAR adr: LONGINT; base: LONGINT); +BEGIN + CASE base OF + | 2: INC(adr, adr MOD 2) + | 4: INC(adr, (-adr) MOD 4) + | 8: INC(adr, (-adr) MOD 8) + | 16: INC(adr, (-adr) MOD 16) + ELSE (*1*) (*OPM.LogWStr("unhandled case at OPC.Align, base = "); OPM.LogWNum(base, 0); OPM.LogWLn;*) + END +END Align; + +PROCEDURE SizeAlignment*(size: LONGINT): LONGINT; + VAR alignment: LONGINT; +BEGIN + IF size < OPM.Alignment THEN + (* Round up to next power of 2 *) + alignment := 1; WHILE alignment < size DO alignment := alignment * 2 END; + ELSE + alignment := OPM.Alignment + END; + RETURN alignment +END SizeAlignment; + +PROCEDURE BaseAlignment*(typ: Struct): LONGINT; + VAR alignment: LONGINT; +BEGIN + IF typ.form = Comp THEN + IF typ.comp = Record THEN + alignment := typ.align MOD 10000H + ELSE + alignment := BaseAlignment(typ.BaseTyp) + END + ELSE + alignment := SizeAlignment(typ.size) + END; + RETURN alignment +END BaseAlignment; + +PROCEDURE TypSize*(typ: Struct); + VAR + f, c: INTEGER; + offset, size, base, fbase, off0: LONGINT; + fld: Object; btyp: Struct; +BEGIN + IF typ = undftyp THEN OPM.err(58) + ELSIF typ.size = -1 THEN + f := typ.form; + c := typ.comp; + IF c = Record THEN btyp := typ.BaseTyp; + IF btyp = NIL THEN offset := 0; base := 1; + ELSE TypSize(btyp); offset := btyp.size - btyp.sysflag DIV 100H; base := btyp.align; + END; + fld := typ.link; + WHILE (fld # NIL) & (fld.mode = Fld) DO + btyp := fld.typ; TypSize(btyp); + size := btyp.size; + fbase := BaseAlignment(btyp); + Align(offset, fbase); + fld.adr := offset; INC(offset, size); + IF fbase > base THEN base := fbase END; + fld := fld.link + END; + (* base is now the largest alignment of any field *) + off0 := offset; + IF offset = 0 THEN offset := 1 END; (* 1 byte filler to avoid empty struct *) + Align(offset, base); + IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END; + typ.size := offset; + typ.align := base; + (* encode the trailing gap into the symbol table to allow dense packing of extended records *) + typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) + ELSIF c = Array THEN + TypSize(typ.BaseTyp); + typ.size := typ.n * typ.BaseTyp.size; + ELSIF f = Pointer THEN + typ.size := OPM.AddressSize; + IF typ.BaseTyp = undftyp THEN OPM.Mark(128, typ.n) + ELSE TypSize(typ.BaseTyp) + END + ELSIF f = ProcTyp THEN + typ.size := OPM.AddressSize; + ELSIF c = DynArr THEN + btyp := typ.BaseTyp; TypSize(btyp); + IF btyp.comp = DynArr THEN typ.size := btyp.size + 4 (* describes dim not size *) + ELSE typ.size := 8 + END + END + END +END TypSize; + PROCEDURE NewConst*(): Const; VAR const: Const; @@ -766,14 +856,14 @@ BEGIN typ^.n := 0; InStruct(typ^.BaseTyp) | Sarr: typ^.form := Comp; typ^.comp := Array; InStruct(typ^.BaseTyp); typ^.n := OPM.SymRInt(); - typSize(typ) (* no bounds address !! *) + TypSize(typ) (* no bounds address !! *) | Sdarr: typ^.form := Comp; typ^.comp := DynArr; InStruct(typ^.BaseTyp); IF typ^.BaseTyp^.comp = DynArr THEN typ^.n := typ^.BaseTyp^.n + 1 ELSE typ^.n := 0 END; - typSize(typ) + TypSize(typ) | Srec: typ^.form := Comp; typ^.comp := Record; InStruct(typ^.BaseTyp); IF typ^.BaseTyp = notyp THEN typ^.BaseTyp := NIL END; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 04da5f09..dafedf3d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -47,62 +47,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR stamp: INTEGER; (* unique number for nested objects *) - recno: LONGINT; (* number of anonymous record types *) exit: ExitInfo; (* to check if EXIT is simply a break *) nofExitLabels: INTEGER; - PROCEDURE TypSize*(typ: OPT.Struct); - VAR f, c: INTEGER; offset, size, base, fbase, off0: LONGINT; - fld: OPT.Object; btyp: OPT.Struct; - BEGIN - IF typ = OPT.undftyp THEN OPM.err(58) - ELSIF typ^.size = -1 THEN - f := typ^.form; c := typ^.comp; - IF c = OPT.Record THEN btyp := typ^.BaseTyp; - IF btyp = NIL THEN offset := 0; base := 1; - ELSE TypSize(btyp); offset := btyp^.size - btyp^.sysflag DIV 100H; base := btyp^.align; - END; - fld := typ^.link; - WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO - btyp := fld^.typ; TypSize(btyp); - size := btyp^.size; fbase := OPC.BaseAlignment(btyp); - OPC.Align(offset, fbase); - fld^.adr := offset; INC(offset, size); - IF fbase > base THEN base := fbase END ; - fld := fld^.link - END; - (* base is now the largest alignment of any field *) - off0 := offset; - IF offset = 0 THEN offset := 1 END ; (* 1 byte filler to avoid empty struct *) - OPC.Align(offset, base); - IF (typ^.strobj = NIL) & (typ^.align MOD 10000H = 0) THEN INC(recno); INC(base, recno * 10000H) END ; - typ^.size := offset; typ^.align := base; - (* encode the trailing gap into the symbol table to allow dense packing of extended records *) - typ^.sysflag := typ^.sysflag MOD 100H + SHORT((offset - off0)*100H) - ELSIF c = OPT.Array THEN - TypSize(typ^.BaseTyp); - typ^.size := typ^.n * typ^.BaseTyp^.size; - ELSIF f = OPT.Pointer THEN - typ^.size := OPM.AddressSize; - IF typ^.BaseTyp = OPT.undftyp THEN OPM.Mark(128, typ^.n) - ELSE TypSize(typ^.BaseTyp) - END - ELSIF f = OPT.ProcTyp THEN - typ^.size := OPM.AddressSize; - ELSIF c = OPT.DynArr THEN - btyp := typ^.BaseTyp; TypSize(btyp); - IF btyp^.comp = OPT.DynArr THEN typ^.size := btyp^.size + 4 (* describes dim not size *) - ELSE typ^.size := 8 - END - END - END - END TypSize; - PROCEDURE Init*; BEGIN - stamp := 0; recno := 0; nofExitLabels := 0; + stamp := 0; nofExitLabels := 0; END Init; PROCEDURE ^Traverse (obj, outerScope: OPT.Object; exported: BOOLEAN); @@ -150,11 +102,11 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 obj^.linkadr := UndefinedType; mode := obj^.mode; IF (mode = OPT.Typ) & ((obj^.vis # OPT.internal) = exported) THEN - typ := obj^.typ; TypSize(obj^.typ); + typ := obj^.typ; OPT.TypSize(obj^.typ); IF typ^.form = OPT.Pointer THEN typ := typ^.BaseTyp END ; IF typ^.comp = OPT.Record THEN TraverseRecord(typ) END ELSIF mode = OPT.TProc THEN GetTProcNum(obj) - ELSIF mode = OPT.Var THEN TypSize(obj^.typ) + ELSIF mode = OPT.Var THEN OPT.TypSize(obj^.typ) END ; IF ~exported THEN (* do this only once *) IF (mode IN {OPT.LProc, OPT.Typ}) & (obj^.mnolev > 0) THEN Stamp(obj^.name) END ; @@ -769,7 +721,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 ELSE OPM.WriteString("NIL") END ; OPM.WriteString(", "); OPM.WriteInt(base.size); - OPM.WriteString(", "); OPM.WriteInt(OPC.BaseAlignment(base)); (* element alignment *) + OPM.WriteString(", "); OPM.WriteInt(OPT.BaseAlignment(base)); (* element alignment *) OPM.WriteString(", "); OPM.WriteInt(nofdim); (* total number of dimensions = number of additional parameters *) OPM.WriteString(", "); OPM.WriteInt(nofdyn); (* number of dynamic dimensions *) WHILE typ # base DO diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index a898c9a4..12dc0a93 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -15,6 +15,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPP.Module(p, OPM.opt); IF OPM.noerr THEN OPV.Init; + OPT.InitRecno; OPV.AdrAndSize(OPT.topScope); OPT.Export(ext, new); IF OPM.noerr THEN @@ -129,7 +130,5 @@ BEGIN Platform.SetInterruptHandler(Trap); Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); - OPB.typSize := OPV.TypSize; - OPT.typSize := OPV.TypSize; Translate END Vishap. diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 936c71bb..3cc542d4 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -69,6 +69,7 @@ int addressSize = 0; int intsize = 0; int bsd = 0; int termux = 0; +int bootstrap = 0; // 1 iff generating a bootstrap compiler. @@ -161,28 +162,32 @@ void determineCCompiler() { void determineInstallDirectory() { - char *env = getenv("INSTALLDIR"); - if (env) { - strncpy(installdir, env, sizeof(installdir)); + if (bootstrap) { + installdir[0] = 0; } else { - #if defined(_MSC_VER) || defined(__MINGW32__) - if (sizeof (void*) == 8) { - snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles"), oname); - } else { - snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles(x86)"), oname); - } - #if defined(__MINGW32__) - int i; for(i=0; installdir[i]; i++) if (installdir[i] == '\\') installdir[i] = '/'; + char *env = getenv("INSTALLDIR"); + if (env) { + strncpy(installdir, env, sizeof(installdir)); + } else { + #if defined(_MSC_VER) || defined(__MINGW32__) + if (sizeof (void*) == 8) { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles"), oname); + } else { + snprintf(installdir, sizeof(installdir), "%s\\%s", getenv("ProgramFiles(x86)"), oname); + } + #if defined(__MINGW32__) + int i; for(i=0; installdir[i]; i++) if (installdir[i] == '\\') installdir[i] = '/'; + #endif + #else + if (bsd) { + snprintf(installdir, sizeof(installdir), "/usr/local/share/%s", oname); + } else if (termux) { + snprintf(installdir, sizeof(installdir), "/data/data/com.termux/files/opt/%s", oname); + } else { + snprintf(installdir, sizeof(installdir), "/opt/%s", oname); + } #endif - #else - if (bsd) { - snprintf(installdir, sizeof(installdir), "/usr/local/share/%s", oname); - } else if (termux) { - snprintf(installdir, sizeof(installdir), "/data/data/com.termux/files/opt/%s", oname); - } else { - snprintf(installdir, sizeof(installdir), "/opt/%s", oname); - } - #endif + } } } @@ -431,8 +436,12 @@ int main(int argc, char *argv[]) oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); if (argc>1) { - ReportSizesAndAlignments(); - exit(0); + if (strncasecmp(argv[1], "rep", 3) == 0) { + ReportSizesAndAlignments(); + exit(0); + } else { + bootstrap = 1; + } } getcwd(cwd, sizeof(cwd)); @@ -447,9 +456,15 @@ int main(int argc, char *argv[]) testSystemDotH(); - snprintf(versionstring, sizeof(versionstring), - "%s [%s] for %s %s on %s", - version, builddate, compiler, dataModel, os); + if (bootstrap) { + snprintf(versionstring, sizeof(versionstring), + "%s [%s]. Bootstrapping compiler for address size %d, alignment %d.", + version, builddate, addressSize, alignment); + } else { + snprintf(versionstring, sizeof(versionstring), + "%s [%s] for %s %s on %s", + version, builddate, compiler, dataModel, os); + } writeConfigurationMod(); writeMakeParameters(); From d683df3e72d6bacf92d7c020e4016b4587ec7614 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 23 Sep 2016 19:34:18 +0100 Subject: [PATCH 054/140] Fix browser command following TypSize move. --- bootstrap/unix-44/OPM.c | 1 - bootstrap/unix-48/OPM.c | 1 - bootstrap/unix-88/OPM.c | 1 - bootstrap/windows-48/OPM.c | 1 - bootstrap/windows-88/OPM.c | 1 - src/tools/browser/BrowserCmd.Mod | 2 +- 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 7b566324..18e25b0f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9297c0a3..abb5a584 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 7b566324..18e25b0f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -223,7 +223,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; i += 2; - Files_SetSearchPath((CHAR*)"", 1); } break; case 'B': diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 564b29b3..28573293 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -267,5 +267,5 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END ShowDef; BEGIN - OPT.typSize := OPV.TypSize; Texts.OpenWriter(W); ShowDef + Texts.OpenWriter(W); ShowDef END BrowserCmd. From 8ab4057a10d97b5e51e7b0130db8386d4fb8322a Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 24 Sep 2016 12:13:26 +0100 Subject: [PATCH 055/140] Make address strobj be equiv int type and remove param checking hack. --- src/compiler/OPB.Mod | 9 ++++----- src/compiler/Vishap.Mod | 4 ++++ src/tools/make/configure.c | 11 ++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 8382c965..260280e5 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1380,11 +1380,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) THEN - IF (fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1)) THEN (* OK *) - ELSIF (ap.typ = OPT.adrtyp) & (fp.typ = OPT.IntType(ap.typ.size)) THEN (* OK (ADDRESS is changed to INTnn in symbol file) *) - ELSE err(123) - END + ELSIF (ap^.typ # fp^.typ) + & ~( (fp^.typ^.form = OPT.Byte) + & (ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) + & (ap.typ.size = 1)) THEN err(123) ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 12dc0a93..0b1e4830 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -51,11 +51,15 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE PropagateElementaryTypeSizes; + VAR adrinttyp: OPT.Struct; BEGIN OPT.sysptrtyp.size := OPM.AddressSize; OPT.adrtyp.size := OPM.AddressSize; OPT.settyp.size := OPM.SetSize; + adrinttyp := OPT.IntType(OPM.AddressSize); + OPT.adrtyp.strobj := adrinttyp.strobj; + OPT.sinttyp := OPT.IntType(OPM.ShortintSize); OPT.inttyp := OPT.IntType(OPM.IntegerSize); OPT.linttyp := OPT.IntType(OPM.LongintSize); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 3cc542d4..5e6e518b 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,26 +126,27 @@ void determineOS() { #endif } +#define optimize " -O1" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l %s", oname); #if defined(__MINGW32__) compiler = "mingw"; if (sizeof (void*) == 4) { - cc = "i686-w64-mingw32-gcc -g -O1"; + cc = "i686-w64-mingw32-gcc -g" optimize; } else { - cc = "x86_64-w64-mingw32-gcc -g -O1"; + cc = "x86_64-w64-mingw32-gcc -g" optimize; } #elif defined(__clang__) compiler = "clang"; - cc = "clang -fPIC -g -O1"; + cc = "clang -fPIC -g" optimize; #elif defined(__GNUC__) compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -O1"; + cc = "gcc -g" optimize; } else { - cc = "gcc -fPIC -g -O1"; + cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; From 41bf2c037d2a0b2e35cde73fb40a74965b2a6b15 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:26:04 +0100 Subject: [PATCH 056/140] Separate install subdirs for diff size models. Lots of tidying and renaming. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 8 +- bootstrap/unix-44/Files.h | 3 +- bootstrap/unix-44/Heap.c | 244 +++++++------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 10 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 32 +- bootstrap/unix-44/Platform.h | 19 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 171 ---------- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 8 +- bootstrap/unix-48/Files.h | 3 +- bootstrap/unix-48/Heap.c | 244 +++++++------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 10 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 32 +- bootstrap/unix-48/Platform.h | 19 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 171 ---------- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 8 +- bootstrap/unix-88/Files.h | 3 +- bootstrap/unix-88/Heap.c | 244 +++++++------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 10 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 32 +- bootstrap/unix-88/Platform.h | 19 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 171 ---------- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 8 +- bootstrap/windows-48/Files.h | 3 +- bootstrap/windows-48/Heap.c | 244 +++++++------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 10 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 30 +- bootstrap/windows-48/Platform.h | 16 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 171 ---------- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 8 +- bootstrap/windows-88/Files.h | 3 +- bootstrap/windows-88/Heap.c | 244 +++++++------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 10 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 30 +- bootstrap/windows-88/Platform.h | 16 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 171 ---------- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 126 +++---- src/compiler/{Vishap.Mod => Compiler.Mod} | 26 +- src/compiler/OPB.Mod | 10 +- src/compiler/OPC.Mod | 14 +- src/compiler/{OPM.cmdln.Mod => OPM.Mod} | 306 +++++++---------- src/compiler/OPT.Mod | 8 +- src/compiler/OPV.Mod | 18 +- src/compiler/extTools.Mod | 41 +-- src/system/Files.Mod | 5 - src/system/Platformunix.Mod | 6 +- src/tools/make/configure.c | 2 - src/tools/make/oberon.mk | 379 ++++++++++++++++++++++ src/tools/make/vishap.make | 379 ---------------------- 208 files changed, 1559 insertions(+), 2556 deletions(-) delete mode 100644 bootstrap/unix-44/Vishap.c delete mode 100644 bootstrap/unix-48/Vishap.c delete mode 100644 bootstrap/unix-88/Vishap.c delete mode 100644 bootstrap/windows-48/Vishap.c delete mode 100644 bootstrap/windows-88/Vishap.c rename src/compiler/{Vishap.Mod => Compiler.Mod} (82%) rename src/compiler/{OPM.cmdln.Mod => OPM.Mod} (78%) create mode 100644 src/tools/make/oberon.mk delete mode 100644 src/tools/make/vishap.make diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7405b27f..c1b4cb67 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 28dd23c6..9d981ce0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 56d3fd40..1faae4d6 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-44/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ad002606..6f5eb201 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 0518133f..c75a1073 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e95203ed..ef0c0dbe 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; - address written; + int32 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d76d7ed5..986a65ef 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index f9e5e585..5bf17489 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d7e16dab..5b82978c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 64d47c3f..75495244 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8df906c3..5bad2591 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -64,15 +64,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -218,19 +218,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -517,7 +517,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -547,10 +547,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; - address written; + int64 written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d76d7ed5..2402b996 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,7 +7,8 @@ typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + int32 _prvt0; + char _prvt1[8]; } Platform_FileIdentity; typedef @@ -18,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,15 +49,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/unix-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9a5d7c98..7c1ea1bd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3e6db0f2..a7de696c 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -40,7 +40,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 905fcb24..945fbff7 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int32 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int32 Heap_freeList[10]; +static int32 Heap_bigBlocks; +export int32 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int32 Heap_heap, Heap_heapend; +export int32 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int32 q); +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int32 size); +export SYSTEM_PTR Heap_NEWREC (int32 tag); +static int32 Heap_NewChunk (int32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int32 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int32); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int32 Heap_NewChunk (int32 blksz) { - address _o_result; - address chnk; + int32 _o_result; + int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), address); - __PUT(chnk + 12, chnk + 16, address); - __PUT(chnk + 16, blksz, address); - __PUT(chnk + 20, -4, address); - __PUT(chnk + 24, Heap_bigBlocks, address); + __PUT(chnk + 4, chnk + (12 + blksz), int32); + __PUT(chnk + 12, chnk + 16, int32); + __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 20, -4, int32); + __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int32 blksz) { - address size, chnk, j, next; + int32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int32); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int32); + __PUT(j, chnk, int32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, address); + __GET(chnk + 4, Heap_heapend, int32); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int32 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 4, t, address); + __GET(adr + 4, t, int32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, address); + __GET(adr + 12, adr, int32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, address); - __PUT(end + 8, -4, address); - __PUT(end, end + 4, address); + __PUT(end + 4, blksz, int32); + __PUT(end + 8, -4, int32); + __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, address); + __PUT(adr + 4, restsize, int32); } else { - __GET(adr + 12, next, address); + __GET(adr + 12, next, int32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, address); + __PUT(prev + 12, next, int32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, address); - __PUT(adr + 12, Heap_freeList[di], address); + __PUT(adr + 4, restsize, int32); + __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 4, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 12, 0, address); + __PUT(i, 0, int32); + __PUT(i + 4, 0, int32); + __PUT(i + 8, 0, int32); + __PUT(i + 12, 0, int32); i += 16; } - __PUT(adr + 12, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 4, 0, address); - __PUT(adr + 8, 0, address); + __PUT(adr + 12, 0, int32); + __PUT(adr, tag, int32); + __PUT(adr + 4, 0, int32); + __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int32 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 12; - __PUT(tag - 4, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 4, -4, address); - __PUT((address)(address)new - 4, tag, address); + tag = ((int32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, int32); + __PUT(tag, blksz, int32); + __PUT(tag + 4, -4, int32); + __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int32 q) { - address p, tag, offset, fld, n, tagbits; + int32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, address); + __GET(q - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, address); + __PUT(q - 4, tagbits + 1, int32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, address); + __PUT(q - 4, (tag + offset) + 1, int32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, address); + __GET(q - 4, tag, int32); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int32); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int32); if (n != 0) { - __GET(n - 4, tagbits, address); + __GET(n - 4, tagbits, int32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, address); - __PUT(q - 4, tag + 1, address); + __PUT(n - 4, tagbits + 1, int32); + __PUT(q - 4, tag + 1, int32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int32)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, address); + __GET(chnk + 4, end, int32); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int32); + __GET(tag, size, int32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, address); - __PUT(start + 4, freesize, address); - __PUT(start + 8, -4, address); + __PUT(start, start + 4, int32); + __PUT(start + 4, freesize, int32); + __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], address); + __PUT(start + 12, Heap_freeList[i], int32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, address); + __PUT(start + 12, Heap_bigBlocks, int32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) { - address i, j, x; + int32 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) { - address l, r, x; + int32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, address); + __GET(chnk + 4, lim1, int32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int32); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int32); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, address); + __GET(n->obj - 4, tag, int32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 4, Heap_heapend, int32); + __PUT(Heap_heap, 0, int32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3ea975a7..eccb5d85 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int32 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int32 size); +import SYSTEM_PTR Heap_NEWREC (int32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 21d62e05..a87d0732 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index abb5a584..7234f518 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 66b821d2..1e5c6674 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 1b69128c..0a1f8f54 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index cdb2ab50..a70a40bf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 21a73e4d..51a62ed7 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int32 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int32 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int32 Platform_OSAllocate (int32 size); +export void Platform_OSFree (int32 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int32 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int32 Platform_OSAllocate (int32 size) { - address _o_result; + int32 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int32 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int32 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d697acd7..fff5ea74 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int32 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int32 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int32 Platform_OSAllocate (int32 size); +import void Platform_OSFree (int32 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 779daa7a..ab510cdb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 07f53445..64e78861 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-48/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 7f7f4b26..28528f64 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 618bc77f..d9030dbe 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 8b55dc14..11937ee4 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index d645f05c..4eb27c8b 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1071d452..7d407820 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -83,7 +83,6 @@ export int32 Files_Pos (Files_Rider *r, address *r__typ); export void Files_Purge (Files_File f); export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); @@ -673,11 +672,6 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len) -{ - Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1); -} - Files_File Files_Base (Files_Rider *r, address *r__typ) { Files_File _o_result; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1a73a6ec..1391c541 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -42,7 +42,6 @@ import int32 Files_Pos (Files_Rider *r, address *r__typ); import void Files_Purge (Files_File f); import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadByte (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 785efa1a..ca208a31 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 @@ -39,7 +39,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - address obj; + int64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -56,19 +56,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - address types; + int64 types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static address Heap_freeList[10]; -static address Heap_bigBlocks; -export address Heap_allocated; +static int64 Heap_freeList[10]; +static int64 Heap_bigBlocks; +export int64 Heap_allocated; static BOOLEAN Heap_firstTry; -static address Heap_heap, Heap_heapend; -export address Heap_heapsize; +static int64 Heap_heap, Heap_heapend; +export int64 Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -80,27 +80,27 @@ export address *Heap_FinDesc__typ; export address *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (address blksz); +static void Heap_ExtendHeap (int64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (address n, address *a, LONGINT a__len); +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (address q); -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); +static void Heap_Mark (int64 q); +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (address size); -export SYSTEM_PTR Heap_NEWREC (address tag); -static address Heap_NewChunk (address blksz); +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (int64 size); +export SYSTEM_PTR Heap_NEWREC (int64 tag); +static int64 Heap_NewChunk (int64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, address typ); +export void Heap_REGTYP (Heap_Module m, int64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (address l, address r, address *a, LONGINT a__len); +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -158,9 +158,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, address typ) +void Heap_REGTYP (Heap_Module m, int64 typ) { - __PUT(typ, m->types, address); + __PUT(typ, m->types, int64); m->types = typ; } @@ -169,17 +169,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static address Heap_NewChunk (address blksz) +static int64 Heap_NewChunk (int64 blksz) { - address _o_result; - address chnk; + int64 _o_result; + int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), address); - __PUT(chnk + 24, chnk + 32, address); - __PUT(chnk + 32, blksz, address); - __PUT(chnk + 40, -8, address); - __PUT(chnk + 48, Heap_bigBlocks, address); + __PUT(chnk + 8, chnk + (24 + blksz), int64); + __PUT(chnk + 24, chnk + 32, int64); + __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 40, -8, int64); + __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -187,9 +187,9 @@ static address Heap_NewChunk (address blksz) return _o_result; } -static void Heap_ExtendHeap (address blksz) +static void Heap_ExtendHeap (int64 blksz) { - address size, chnk, j, next; + int64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -198,31 +198,31 @@ static void Heap_ExtendHeap (address blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, address); + __PUT(chnk, Heap_heap, int64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, address); + __GET(j, next, int64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, address); + __GET(j, next, int64); } - __PUT(chnk, next, address); - __PUT(j, chnk, address); + __PUT(chnk, next, int64); + __PUT(j, chnk, int64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, address); + __GET(chnk + 8, Heap_heapend, int64); } } } -SYSTEM_PTR Heap_NEWREC (address tag) +SYSTEM_PTR Heap_NEWREC (int64 tag) { SYSTEM_PTR _o_result; - address i, i0, di, blksz, restsize, t, adr, end, next, prev; + int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, address); + __GET(tag, blksz, int64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -233,17 +233,17 @@ SYSTEM_PTR Heap_NEWREC (address tag) } } if (i < 9) { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; } @@ -274,31 +274,31 @@ SYSTEM_PTR Heap_NEWREC (address tag) return _o_result; } } - __GET(adr + 8, t, address); + __GET(adr + 8, t, int64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, address); + __GET(adr + 24, adr, int64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, address); - __PUT(end + 16, -8, address); - __PUT(end, end + 8, address); + __PUT(end + 8, blksz, int64); + __PUT(end + 16, -8, int64); + __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, address); + __PUT(adr + 8, restsize, int64); } else { - __GET(adr + 24, next, address); + __GET(adr + 24, next, int64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, address); + __PUT(prev + 24, next, int64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, address); - __PUT(adr + 24, Heap_freeList[di], address); + __PUT(adr + 8, restsize, int64); + __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } } @@ -307,72 +307,72 @@ SYSTEM_PTR Heap_NEWREC (address tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, address); - __PUT(i + 8, 0, address); - __PUT(i + 16, 0, address); - __PUT(i + 24, 0, address); + __PUT(i, 0, int64); + __PUT(i + 8, 0, int64); + __PUT(i + 16, 0, int64); + __PUT(i + 24, 0, int64); i += 32; } - __PUT(adr + 24, 0, address); - __PUT(adr, tag, address); - __PUT(adr + 8, 0, address); - __PUT(adr + 16, 0, address); + __PUT(adr + 24, 0, int64); + __PUT(adr, tag, int64); + __PUT(adr + 8, 0, int64); + __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (address size) +SYSTEM_PTR Heap_NEWBLK (int64 size) { SYSTEM_PTR _o_result; - address blksz, tag; + int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((address)(address)new + blksz) - 24; - __PUT(tag - 8, 0, address); - __PUT(tag, blksz, address); - __PUT(tag + 8, -8, address); - __PUT((address)(address)new - 8, tag, address); + tag = ((int64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, int64); + __PUT(tag, blksz, int64); + __PUT(tag + 8, -8, int64); + __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (address q) +static void Heap_Mark (int64 q) { - address p, tag, offset, fld, n, tagbits; + int64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, address); + __GET(q - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, address); + __PUT(q - 8, tagbits + 1, int64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, address); + __GET(tag, offset, int64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, address); + __PUT(q - 8, (tag + offset) + 1, int64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, address); + __GET(q - 8, tag, int64); tag -= 1; - __GET(tag, offset, address); + __GET(tag, offset, int64); fld = q + offset; - __GET(fld, p, address); + __GET(fld, p, int64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, address); + __GET(fld, n, int64); if (n != 0) { - __GET(n - 8, tagbits, address); + __GET(n - 8, tagbits, int64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, address); - __PUT(q - 8, tag + 1, address); + __PUT(n - 8, tagbits + 1, int64); + __PUT(q - 8, tag + 1, int64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -388,12 +388,12 @@ static void Heap_Mark (address q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((address)(address)p); + Heap_Mark((int64)(address)p); } static void Heap_Scan (void) { - address chnk, adr, end, start, tag, i, size, freesize; + int64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -405,58 +405,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, address); + __GET(chnk + 8, end, int64); while (adr < end) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, address); - __GET(tag, size, address); + __PUT(adr, tag, int64); + __GET(tag, size, int64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, address); - __PUT(start + 8, freesize, address); - __PUT(start + 16, -8, address); + __PUT(start, start + 8, int64); + __PUT(start + 8, freesize, int64); + __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], address); + __PUT(start + 24, Heap_freeList[i], int64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, address); + __PUT(start + 24, Heap_bigBlocks, int64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } -static void Heap_Sift (address l, address r, address *a, LONGINT a__len) +static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) { - address i, j, x; + int64 i, j, x; j = l; x = a[j]; for (;;) { @@ -473,9 +473,9 @@ static void Heap_Sift (address l, address r, address *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (address n, address *a, LONGINT a__len) +static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) { - address l, r, x; + int64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -491,25 +491,25 @@ static void Heap_HeapSort (address n, address *a, LONGINT a__len) } } -static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) +static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) { - address chnk, adr, tag, next, lim, lim1, i, ptr, size; + int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, address); + __GET(chnk + 8, lim1, int64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, address); + __GET(adr, tag, int64); if (__ODD(tag)) { - __GET(tag - 1, size, address); + __GET(tag - 1, size, int64); adr += size; } else { - __GET(tag, size, address); + __GET(tag, size, int64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -524,17 +524,17 @@ static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, address); + __GET(chnk, chnk, int64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - address tag; + int64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, address); + __GET(n->obj - 8, tag, int64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -580,10 +580,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) +static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - address inc, nofcand, sp, p, stack0; + int64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -600,7 +600,7 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, address); + __GET(sp, p, int64); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == (int64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -622,8 +622,8 @@ static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - address cand[10000]; + int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -703,7 +703,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (address)(address)obj; + f->obj = (int64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -713,8 +713,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, address); - __PUT(Heap_heap, 0, address); + __GET(Heap_heap + 8, Heap_heapend, int64); + __PUT(Heap_heap, 0, int64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cfa2ab6f..3fcd0b28 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import address Heap_allocated, Heap_heapsize; +import int64 Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import address *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (address size); -import SYSTEM_PTR Heap_NEWREC (address tag); +import SYSTEM_PTR Heap_NEWBLK (int64 size); +import SYSTEM_PTR Heap_NEWREC (int64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, address typ); +import void Heap_REGTYP (Heap_Module m, int64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index b6890cfe..e3ff56bd 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index d2d0a476..93e2105b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 6c15aa17..d211135a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -2449,12 +2449,8 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 11)) { - } else if (ap->typ != fp->typ) { - if ((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x1e, 32) && ap->typ->size == 1)))) { - } else if ((ap->typ == OPT_adrtyp && fp->typ == OPT_IntType(ap->typ->size))) { - } else { - OPB_err(123); - } + } else if ((ap->typ != fp->typ && !((((fp->typ->form == 1 && __IN(ap->typ->form, 0x1e, 32))) && ap->typ->size == 1)))) { + OPB_err(123); } else if ((fp->typ->form == 11 && ap->class == 5)) { OPB_err(123); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8395741b..97860bfc 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9104c5c4..e4c0eb06 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6236cd73..3325aded 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 18e25b0f..4710b95f 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b62666db..e249edd5 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 03366726..f6a8dfc5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ea6663ba..3b9acd86 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 2b449cae..ee182741 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 8d90d974..1514d9eb 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c9ff5430..ad18ebdb 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 1a525fcb..d4f953ba 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f9e7c27c..09f3d249 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09931dda..0a9135f5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8dc2c83e..c0accb85 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -13,7 +13,7 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - address (*Platform_ArgVecPtr)[1]; + int64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; @@ -31,12 +31,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export address Platform_MainStackFrame; +export int64 Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export address Platform_ArgVector; +export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -66,15 +66,15 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, address argvadr); +export void Platform_Init (int16 argc, int64 argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export address Platform_OSAllocate (address size); -export void Platform_OSFree (address address); +export int64 Platform_OSAllocate (int64 size); +export void Platform_OSFree (int64 address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -92,7 +92,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 limit); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, address p, int32 l); +export int16 Platform_Write (int32 h, int64 p, int32 l); static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -230,19 +230,19 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -address Platform_OSAllocate (address size) +int64 Platform_OSAllocate (int64 size) { - address _o_result; + int64 _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (address address) +void Platform_OSFree (int64 address) { Platform_free(address); } -void Platform_Init (int16 argc, address argvadr) +void Platform_Init (int16 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; @@ -543,7 +543,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, address p, int32 l, int32 *n) +int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { int16 _o_result; int16 result; @@ -579,7 +579,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, address p, int32 l) +int16 Platform_Write (int32 h, int64 p, int32 l) { int16 _o_result; if (Platform_writefile(h, p, l) == 0) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d697acd7..dcdb5e82 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import address Platform_MainStackFrame; +import int64 Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import address Platform_ArgVector; +import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,15 +50,15 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, address argvadr); +import void Platform_Init (int16 argc, int64 argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import address Platform_OSAllocate (address size); -import void Platform_OSFree (address address); +import int64 Platform_OSAllocate (int64 size); +import void Platform_OSFree (int64 address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, address p, int32 l, int32 *n); +import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 limit); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, address p, int32 l); +import int16 Platform_Write (int32 h, int64 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4b72fbe3..e75d35ff 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 4a4c73b0..8a42b39b 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index f765b98f..9f9562db 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index be1e7d7f..da213d81 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6cb415b9..2590cb27 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index dc456f77..7800b252 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c deleted file mode 100644 index 30b81ac7..00000000 --- a/bootstrap/windows-88/Vishap.c +++ /dev/null @@ -1,171 +0,0 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ - -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Configuration.h" -#include "Heap.h" -#include "OPB.h" -#include "OPC.h" -#include "OPM.h" -#include "OPP.h" -#include "OPT.h" -#include "OPV.h" -#include "Platform.h" -#include "Strings.h" -#include "extTools.h" -#include "vt100.h" - - -static CHAR Vishap_mname[256]; - - -export void Vishap_Module (BOOLEAN *done); -static void Vishap_PropagateElementaryTypeSizes (void); -export void Vishap_Translate (void); -static void Vishap_Trap (int16 sig); - - -void Vishap_Module (BOOLEAN *done) -{ - BOOLEAN ext, new; - OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); - if (OPM_noerr) { - OPV_Init(); - OPT_InitRecno(); - OPV_AdrAndSize(OPT_topScope); - OPT_Export(&ext, &new); - if (OPM_noerr) { - OPM_OpenFiles((void*)OPT_SelfName, 256); - OPC_Init(); - OPV_Module(p); - if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { - OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - } else { - if (new) { - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); - } - OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); - } - OPM_RegisterNewSym(); - } else if (ext) { - OPM_LogWStr((CHAR*)" Extended symbol file.", 24); - OPM_RegisterNewSym(); - } - } - } else { - OPM_DeleteNewSym(); - } - } - } - OPM_CloseFiles(); - OPT_Close(); - OPM_LogWLn(); - *done = OPM_noerr; -} - -static void Vishap_PropagateElementaryTypeSizes (void) -{ - OPT_sysptrtyp->size = OPM_AddressSize; - OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; - OPT_sinttyp = OPT_IntType(OPM_ShortintSize); - OPT_inttyp = OPT_IntType(OPM_IntegerSize); - OPT_linttyp = OPT_IntType(OPM_LongintSize); - OPT_sintobj->typ = OPT_sinttyp; - OPT_intobj->typ = OPT_inttyp; - OPT_lintobj->typ = OPT_linttyp; -} - -void Vishap_Translate (void) -{ - BOOLEAN done; - CHAR modulesobj[2048]; - modulesobj[0] = 0x00; - if (OPM_OpenPar()) { - for (;;) { - OPM_Init(&done, (void*)Vishap_mname, 256); - if (!done) { - return; - } - OPM_InitOptions(); - Vishap_PropagateElementaryTypeSizes(); - Heap_GC(0); - Vishap_Module(&done); - if (!done) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Module compilation failed.", 27); - OPM_LogWLn(); - Platform_Exit(1); - } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - } else { - if (!__IN(10, OPM_opt, 32)) { - extTools_Assemble(OPM_modName, 32); - Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); - Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); - Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); - } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); - } - } - } - } - } -} - -static void Vishap_Trap (int16 sig) -{ - Heap_FINALL(); - if (sig == 3) { - Platform_Exit(0); - } else { - if ((sig == 4 && Platform_HaltCode == -15)) { - OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35); - OPM_LogWLn(); - } - Platform_Exit(2); - } -} - - -export int main(int argc, char **argv) -{ - __INIT(argc, argv); - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Heap); - __MODULE_IMPORT(OPB); - __MODULE_IMPORT(OPC); - __MODULE_IMPORT(OPM); - __MODULE_IMPORT(OPP); - __MODULE_IMPORT(OPT); - __MODULE_IMPORT(OPV); - __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); - __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); - __REGMAIN("Vishap", 0); - __REGCMD("Translate", Vishap_Translate); -/* BEGIN */ - Platform_SetInterruptHandler(Vishap_Trap); - Platform_SetQuitHandler(Vishap_Trap); - Platform_SetBadInstructionHandler(Vishap_Trap); - Vishap_Translate(); - __FINI; -} diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d465624d..34e6fae3 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index cf093ab3..ce275b8c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 46f8ac7e..fd7974da 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 700e6b39..f87adfac 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 8d4cbdfc..ca56f466 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index da86e98b..f5b8588f 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/23]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index c9feb82b..893e59bc 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ # Vishap Oberon master makefile. # # Makes sure configuration parameters are up to date and then hands off -# to src/tools/make/vishap.make. +# to src/tools/make/oberon.mk. @@ -134,124 +134,104 @@ reportsizes: FORCE # clean - clean out the bulid directory clean: configuration - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s clean # full: Full build of compiler and libarary. full: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean + @make -f src/tools/make/oberon.mk -s installable + @-make -f src/tools/make/oberon.mk -s uninstall + @make -f src/tools/make/oberon.mk -s clean # Make bootstrap compiler from source suitable for current data model @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource + @make -f src/tools/make/oberon.mk -s compilerfromsavedsource MODEL=2 # Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library MODEL=2 @printf "\n\n--- Library build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s sourcechanges - @make -f src/tools/make/vishap.make -s install + @make -f src/tools/make/oberon.mk -s sourcechanges + @make -f src/tools/make/oberon.mk -s install MODEL=2 @printf "\n\n--- Confidence tests started ---\n\n" - @make -f src/tools/make/vishap.make -s confidence - @make -f src/tools/make/vishap.make -s showpath - - -# short - like make full, but omitting most libraries -# Convenient for testing changes to the compilersource but not a shippable result -short: configuration - @make -f src/tools/make/vishap.make -s installable - @-make -f src/tools/make/vishap.make -s uninstall - @make -f src/tools/make/vishap.make -s clean -# Make bootstrap compiler from source suitable for current data model - @printf "\n\n--- Compiler build started ---\n\n" - @make -f src/tools/make/vishap.make -s compilerfromsavedsource -# Use bootstrap compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble -# Use latest compiler to make compiler binary from latest compiler sources - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @printf "\n\n--- Compiler build successfull ---\n\n" - @make -f src/tools/make/vishap.make -s v4 - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s confidence MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 assemble: - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # compile: compiler only, without cleaning compiler: configuration - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 # Report changes to compiler source relative to bootstrap compiler sourcechanges: - @make -f src/tools/make/vishap.make -s sourcechanges + @make -f src/tools/make/oberon.mk -s sourcechanges # browsercmd: build the 'showdef' command browsercmd: configuration - @make -f src/tools/make/vishap.make -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd # library: build all directories under src/library library: configuration - @make -f src/tools/make/vishap.make -s library + @make -f src/tools/make/oberon.mk -s library # Individual library components v4: configuration - @make -f src/tools/make/vishap.make -s v4 + @make -f src/tools/make/oberon.mk -s v4 ooc2: configuration - @make -f src/tools/make/vishap.make -s ooc2 + @make -f src/tools/make/oberon.mk -s ooc2 ooc: configuration - @make -f src/tools/make/vishap.make -s ooc + @make -f src/tools/make/oberon.mk -s ooc ulm: configuration - @make -f src/tools/make/vishap.make -s ulm + @make -f src/tools/make/oberon.mk -s ulm pow32: configuration - @make -f src/tools/make/vishap.make -s pow32 + @make -f src/tools/make/oberon.mk -s pow32 misc: configuration - @make -f src/tools/make/vishap.make -s misc + @make -f src/tools/make/oberon.mk -s misc s3: configuration - @make -f src/tools/make/vishap.make -s s3 + @make -f src/tools/make/oberon.mk -s s3 # install: Copy built files to install directory install: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s install - @make -f src/tools/make/vishap.make -s showpath + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s install MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath MODEL=2 uninstall: configuration - @make -f src/tools/make/vishap.make -s installable - @make -f src/tools/make/vishap.make -s uninstall + @make -f src/tools/make/oberon.mk -s installable + @make -f src/tools/make/oberon.mk -s uninstall # confidence: Run a set of confidence tests confidence: configuration - @make -f src/tools/make/vishap.make -s confidence + @make -f src/tools/make/oberon.mk -s confidence planned-binary-change: @date >src/test/confidence/planned-binary-change @@ -266,25 +246,25 @@ planned-binary-change: # If the bootstrap directories are broken or only partially # built then run 'make revertbootstrap' first. bootstrap: bootstrapconfiguration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap bootstrapunclean: bootstrapconfiguration rm -rf bootstrap/* - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym - make -f src/tools/make/vishap.make -s translate MODEL=-O2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym + make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym cp src/system/*.[ch] bootstrap @@ -304,10 +284,10 @@ revertbootstrap: # coordinator: Start the test machine coordinator coordinator: configuration - @make -f src/tools/make/vishap.make -s clean - @make -f src/tools/make/vishap.make -s translate - @make -f src/tools/make/vishap.make -s assemble - @make -f src/tools/make/vishap.make -s testtools + @make -f src/tools/make/oberon.mk -s clean + @make -f src/tools/make/oberon.mk -s translate + @make -f src/tools/make/oberon.mk -s assemble + @make -f src/tools/make/oberon.mk -s testtools @rm -f "build/*.log" cd build && ../testcoordinator.exe @@ -316,7 +296,7 @@ coordinator: configuration # auto: machine specific build server auto: configuration - @make -f src/tools/make/vishap.make -s auto + @make -f src/tools/make/oberon.mk -s auto diff --git a/src/compiler/Vishap.Mod b/src/compiler/Compiler.Mod similarity index 82% rename from src/compiler/Vishap.Mod rename to src/compiler/Compiler.Mod index 0b1e4830..f27fd578 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Compiler.Mod @@ -1,4 +1,4 @@ -MODULE Vishap; (* J. Templ 3.2.95 *) +MODULE Compiler; (* J. Templ 3.2.95 *) IMPORT SYSTEM, Heap, Platform, Configuration, @@ -12,7 +12,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) PROCEDURE Module*(VAR done: BOOLEAN); VAR ext, new: BOOLEAN; p: OPT.Node; BEGIN - OPP.Module(p, OPM.opt); + OPP.Module(p, OPM.Options); IF OPM.noerr THEN OPV.Init; OPT.InitRecno; @@ -23,16 +23,16 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPC.Init; OPV.Module(p); IF OPM.noerr THEN - IF (OPM.mainprog IN OPM.opt) & (OPM.modName # "SYSTEM") THEN + IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); @@ -95,12 +95,12 @@ MODULE Vishap; (* J. Templ 3.2.95 *) END; (* 'assemble' (i.e. c compile) .c to object or executable. *) - IF ~(OPM.dontasm IN OPM.opt) THEN - IF OPM.dontlink IN OPM.opt THEN + IF ~(OPM.dontasm IN OPM.Options) THEN + IF OPM.dontlink IN OPM.Options THEN (* If not linking, just assemble each module. *) extTools.Assemble(OPM.modName) ELSE - IF ~(OPM.mainprog IN OPM.opt) THEN + IF ~(OPM.mainprog IN OPM.Options) THEN (* Assemble non main program and add object name to link list *) extTools.Assemble(OPM.modName); Strings.Append(" ", modulesobj); @@ -108,7 +108,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Strings.Append(Configuration.objext, modulesobj) ELSE (* Assemble and link main program *) - extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.opt, modulesobj) + extTools.LinkMain(OPM.modName, OPM.mainlinkstat IN OPM.Options, modulesobj) END END END @@ -123,7 +123,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) Platform.Exit(0) ELSE IF (sig = 4) & (Platform.HaltCode = -15) THEN - OPM.LogWStr(" --- Vishap Oberon: internal error"); + OPM.LogWStr(" --- Oberon compiler internal error"); OPM.LogWLn END ; Platform.Exit(2) @@ -135,4 +135,4 @@ BEGIN Platform.SetQuitHandler(Trap); Platform.SetBadInstructionHandler(Trap); Translate -END Vishap. +END Compiler. diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 260280e5..547f2521 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -829,16 +829,18 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g: INTEGER; (* expression (source) form *) p, q: OPT.Struct; BEGIN - IF OPM.verbose IN OPM.opt THEN + y := ynode^.typ; f := x^.form; g := y^.form; + (* + IF OPM.verbose IN OPM.Options THEN OPM.LogWLn; OPM.LogWStr("PROCEDURE CheckAssign"); OPM.LogWLn; END; - y := ynode^.typ; f := x^.form; g := y^.form; - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN OPM.LogWStr("y.form = "); OPM.LogWNum(y.form, 0); OPM.LogWLn; OPM.LogWStr("f = "); OPM.LogWNum(f, 0); OPM.LogWLn; OPM.LogWStr("g = "); OPM.LogWNum(g, 0); OPM.LogWLn; OPM.LogWStr("ynode.typ.syze = "); OPM.LogWNum(ynode.typ.size, 0); OPM.LogWLn; END; + *) IF (ynode^.class = OPT.Ntype) OR (ynode^.class = OPT.Nproc) & (f # OPT.ProcTyp) THEN err(126) END ; CASE f OF OPT.Undef, @@ -1328,7 +1330,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN - IF OPM.verbose IN OPM.opt THEN err(-301) END + IF OPM.verbose IN OPM.Options THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN IF ftyp^.comp = OPT.DynArr THEN DynArrParCheck(ftyp, atyp, fvarpar) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 456bcf87..4f4839c5 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -660,7 +660,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) EndStat; BegStat; OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); base := NIL - ELSIF (OPM.ptrinit IN OPM.opt) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN + ELSIF (OPM.ptrinit IN OPM.Options) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") END END ; @@ -779,7 +779,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("/* "); OPM.WriteString(Configuration.name); OPM.Write(" "); OPM.WriteString(Configuration.versionLong); OPM.Write (" "); (* noch *) FOR i := 0 TO MAX(SET) DO - IF i IN OPM.glbopt THEN + IF i IN OPM.Options THEN CASE i OF (* c.f. ScanOptions in OPM *) | OPM.inxchk: OPM.Write("x") | OPM.ranchk: OPM.Write("r") @@ -902,22 +902,22 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE EnterBody*; BEGIN OPM.WriteLn; OPM.WriteString(Export); - IF OPM.mainprog IN OPM.opt THEN + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("int main(int argc, char **argv)"); OPM.WriteLn; ELSE OPM.WriteString("void *"); OPM.WriteString(OPM.modName); OPM.WriteString(BodyNameExt); OPM.WriteLn; END ; BegBlk; BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__INIT(argc, argv)") ELSE OPM.WriteString("__DEFMOD") END ; EndStat; - IF (OPM.mainprog IN OPM.opt) & demoVersion THEN BegStat; + IF (OPM.mainprog IN OPM.Options) & demoVersion THEN BegStat; OPM.WriteString('/*don`t do it!*/ printf("DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\n")'); EndStat END ; InitImports(OPT.topScope^.right); BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString('__REGMAIN("') ELSE OPM.WriteString('__REGMOD("') END ; OPM.WriteString(OPM.modName); IF GlbPtrs THEN OPM.WriteString('", EnumPtrs)') ELSE OPM.WriteString('", 0)') END ; EndStat; @@ -927,7 +927,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE ExitBody*; BEGIN BegStat; - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI;") ELSE OPM.WriteString("__ENDMOD;") END ; OPM.WriteLn; EndBlk END ExitBody; diff --git a/src/compiler/OPM.cmdln.Mod b/src/compiler/OPM.Mod similarity index 78% rename from src/compiler/OPM.cmdln.Mod rename to src/compiler/OPM.Mod index e954ea63..f7a171aa 100644 --- a/src/compiler/OPM.cmdln.Mod +++ b/src/compiler/OPM.Mod @@ -24,7 +24,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) notcoloroutput* = 16; (* turn off color output *) forcenewsym* = 17; (* force new symbol file *) verbose* = 18; (* verbose *) - defopt* = {inxchk, typchk, ptrinit, assert}; (* default options *) nilval* = 0; @@ -87,10 +86,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - (* Parameter selectable sizes *) - AddressSize*, Alignment*, - SetSize*, - ShortintSize*, IntegerSize*, LongintSize*: INTEGER; + GlobalModel, Model*: CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) + GlobalAddressSize, AddressSize*: INTEGER; + GlobalAlignment, Alignment*: INTEGER; + GlobalOptions*, Options*: SET; + + ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -105,7 +106,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) pc*, entno*: INTEGER; (* entry number *) modName*: ARRAY 32 OF CHAR; objname*: ARRAY 64 OF CHAR; - opt*, glbopt*: SET; ErrorLineStartPos, ErrorLineLimitPos, ErrorLineNumber: LONGINT; (* Limit = start of next line *) @@ -120,8 +120,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) S: INTEGER; - OBERON: ARRAY 1024 OF CHAR; - MODULES: ARRAY 1024 OF CHAR; + ResourceDir*: ARRAY 1024 OF CHAR; (* ------------------------- Log Output ------------------------- *) @@ -134,12 +133,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) + (* Integer size support *) + + PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; + VAR result: SYSTEM.INT64; + BEGIN + result := 1; + result := SYSTEM.LSH(result, bytecount*8-1); + RETURN result - 1; + END SignedMaximum; + + PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; + BEGIN RETURN -SignedMaximum(bytecount) - 1 + END SignedMinimum; + + + (* Unchecked conversion of any size integer to INTEGER or LONGINT *) + PROCEDURE Longint* (n: SYSTEM.INT64): LONGINT; BEGIN RETURN SYSTEM.VAL(LONGINT, n) END Longint; PROCEDURE Integer* (n: SYSTEM.INT64): INTEGER; BEGIN RETURN SYSTEM.VAL(INTEGER, n) END Integer; - (* ------------------------- parameter handling -------------------------*) - PROCEDURE ScanOptions(s: ARRAY OF CHAR; VAR opt: SET); + + + (* --------------- Initialisation and parameter handling ---------------*) + + PROCEDURE ScanOptions(s: ARRAY OF CHAR); VAR i: INTEGER; BEGIN i := 1; (* skip - *) @@ -147,34 +166,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) CASE s[i] OF (* Run time safety *) - | "p": opt := opt / {ptrinit} (* Initialise pointers to NIL. *) - | "a": opt := opt / {assert} (* Halt on assertion failures. *) - | "r": opt := opt / {ranchk} (* Halt on range check failures. *) - | "t": opt := opt / {typchk} (* Halt on type guad failure. *) - | "x": opt := opt / {inxchk} (* Halt on index out of range. *) + | "p": Options := Options / {ptrinit} (* Initialise pointers to NIL. *) + | "a": Options := Options / {assert} (* Halt on assertion failures. *) + | "r": Options := Options / {ranchk} (* Halt on range check failures. *) + | "t": Options := Options / {typchk} (* Halt on type guad failure. *) + | "x": Options := Options / {inxchk} (* Halt on index out of range. *) (* Symbol file management *) - | "e": opt := opt / {extsf} (* Allow extension of old symbol file. *) - | "s": opt := opt / {newsf} (* Allow generation of new symbol file. *) - | "F": opt := opt / {forcenewsym} (* Force generation of new symbol file. *) + | "e": Options := Options / {extsf} (* Allow extension of old symbol file. *) + | "s": Options := Options / {newsf} (* Allow generation of new symbol file. *) + | "F": Options := Options / {forcenewsym} (* Force generation of new symbol file. *) (* C compiler and linker control *) - | "m": opt := opt / {mainprog} (* This module is main. Link dynamically. *) - | "M": opt := opt / {mainlinkstat} (* This module is main. Link statically. *) - | "S": opt := opt / {dontasm} (* Don't call C compiler *) - | "c": opt := opt / {dontlink} (* Don't link. *) + | "m": Options := Options / {mainprog} (* This module is main. Link dynamically. *) + | "M": Options := Options / {mainlinkstat} (* This module is main. Link statically. *) + | "S": Options := Options / {dontasm} (* Don't call C compiler *) + | "c": Options := Options / {dontlink} (* Don't link. *) (* Miscellaneous *) - | "f": opt := opt / {notcoloroutput} (* Disable vt100 control characters in status output. *) - | "V": opt := opt / {verbose} + | "f": Options := Options / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "V": Options := Options / {verbose} (* Elementary type size model *) | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE - CASE s[i+1] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 (* Original Oberon / Oberon 2 *) - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Vishap 64 bit *) - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 (* Component Pascal *) - ELSE LogWStr("Unrecognised size model character following -O."); LogWLn + Model := s[i+1]; + IF (Model # '2') & (Model # 'C') & (Model # 'V') THEN + LogWStr("Unrecognised size model character following -O."); LogWLn END; INC(i) END @@ -212,26 +229,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ScanOptions; - PROCEDURE ^GetProperties; - - - (* Undocumented options used by the build system: - - Todo - this is obsoleted by the -A and -O options. Remove when the build system - has been updated. - - The following parameter overrides the integer size, pointer size and alignment - settings compiled into the binary. They are used when bootstrapping to generate - the C source for a compiler with different sizes to the current compiler. - - -Bnnn Where each n is a single digit specifying the integer size, pointer size - and alignment in bytes. - - An alignment of n means that types smaller than n align to their - own size, types larger than n align to n bytes. - - LONGINT size will be set to twice the integer size. - *) + PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s"; PROCEDURE OpenPar*(): BOOLEAN; (* prepare for a sequence of translations *) VAR s: ARRAY 256 OF CHAR; @@ -286,43 +284,82 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr("Repeating an option toggles its value."); LogWLn; RETURN FALSE ELSE + (* Set options to initial defaults *) + AddressSize := SIZE(SYSTEM.ADDRESS); (* This compilers address size *) + GetAlignment(Alignment); (* This compilers alignment *) + Model := '2'; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) + Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) + + (* Pick up global option changes from start of command line *) S:=1; s:=""; Platform.GetArg(S, s); - - glbopt := defopt; - WHILE s[0] = OptionChar DO - ScanOptions(s, glbopt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; + (* Record global option settings for this command line *) + GlobalAddressSize := AddressSize; + GlobalAlignment := Alignment; + GlobalModel := Model; + GlobalOptions := Options; + RETURN TRUE END; END OpenPar; - PROCEDURE InitOptions*; (* get the options for one translation *) - VAR s: ARRAY 256 OF CHAR; + PROCEDURE VerboseListSizes; BEGIN - opt := glbopt; + LogWLn; + LogWStr("Type Size"); LogWLn; + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; + LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWLn; + LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; + END VerboseListSizes; + + + PROCEDURE InitOptions*; (* get the options for one translation *) + VAR s: ARRAY 256 OF CHAR; searchpath, modules: ARRAY 1024 OF CHAR; + MODULES: ARRAY 1024 OF CHAR; + + BEGIN + Options := GlobalOptions; Model:=GlobalModel; Alignment := GlobalAlignment; AddressSize := GlobalAddressSize; + s:=""; Platform.GetArg(S, s); WHILE s[0] = OptionChar DO - ScanOptions(s, opt); + ScanOptions(s); INC(S); s:=""; Platform.GetArg(S, s) END; - (* - dontAsm := dontasm IN opt; - dontLink := dontlink IN opt; - mainProg := mainprog IN opt; - mainLinkStat := mainlinkstat IN opt; - notColorOutput := notcoloroutput IN opt; - forceNewSym := forcenewsym IN opt; - Verbose := verbose IN opt; - *) + IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; - IF mainlinkstat IN opt THEN INCL(glbopt, mainprog); INCL(opt, mainprog) END; + MaxIndex := SignedMaximum(AddressSize); + CASE Model OF + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + END; + MaxSet := SetSize * 8 - 1; - GetProperties; + IF verbose IN Options THEN VerboseListSizes END; + + ResourceDir := Configuration.installdir; + Strings.Append("/ ", ResourceDir); + ResourceDir[Strings.Length(ResourceDir)-1] := Model; + + modules := ""; Platform.GetEnv("MODULES", modules); + searchpath := "."; Platform.GetEnv("OBERON", searchpath); + Strings.Append(";.;", searchpath); + Strings.Append(modules, searchpath); + Strings.Append(";", searchpath); + Strings.Append(ResourceDir, searchpath); + Strings.Append("/sym;", searchpath); + Files.SetSearchPath(searchpath); END InitOptions; @@ -391,13 +428,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Red) END; LogWStr(" err "); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; ELSE - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -470,9 +507,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Green) END; LogW("^"); - IF ~(notcoloroutput IN opt) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; Files.Close(f); END ShowLine; @@ -548,93 +585,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) - (* ------------------------- initialization ------------------------- *) - - PROCEDURE GetProperty(VAR S: Texts.Scanner; name: ARRAY OF CHAR; VAR size, align: INTEGER); - BEGIN - IF (S.class = Texts.Name) & (S.s = name) THEN Texts.Scan(S); - IF S.class = Texts.Int THEN size := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END ; - IF S.class = Texts.Int THEN align := SHORT(S.i); Texts.Scan(S) ELSE Mark(-157, -1) END - ELSE Mark(-157, -1) - END - END GetProperty; - - - PROCEDURE minusop(i: LONGINT): LONGINT; - BEGIN - RETURN -i; - END minusop; - - - PROCEDURE power0(i, j : LONGINT) : LONGINT; (* we would like to calculate exact Min Max values in GetProperties, not hardcode em, noch *) - VAR k : LONGINT; - p : LONGINT; - BEGIN - k := 1; - p := i; - REPEAT - p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0; - - - PROCEDURE VerboseListSizes; - BEGIN - LogWLn; - LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; - LogWLn; - LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; - END VerboseListSizes; - - - - - (* Integer size support *) - - PROCEDURE SignedMaximum*(bytecount: LONGINT): SYSTEM.INT64; - VAR result: SYSTEM.INT64; - BEGIN - result := 1; - result := SYSTEM.LSH(result, bytecount*8-1); - RETURN result - 1; - END SignedMaximum; - - PROCEDURE SignedMinimum*(bytecount: LONGINT): SYSTEM.INT64; - BEGIN RETURN -SignedMaximum(bytecount) - 1 - END SignedMinimum; - - - - - - - - PROCEDURE GetProperties(); - (* VAR base: LONGINT; *) - BEGIN - (* Fixed and Configuration.Mod based sizes have been initialised in - the module startup code, and maybe overridden by the -Bnnn bootstrap - parameter *) - - MaxReal := 3.40282346D38; (* REAL is 4 bytes *) - MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes *) - (*should be 1.7976931348623157D308 *) - - MinReal := -MaxReal; - MinLReal := -MaxLReal; - MaxSet := SetSize * 8 - 1; - MaxIndex := SignedMaximum(AddressSize); - - IF verbose IN opt THEN VerboseListSizes END; - END GetProperties; - (* ------------------------- Read Symbol File ------------------------- *) @@ -711,7 +661,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE RegisterNewSym*; BEGIN - IF (modName # "SYSTEM") OR (mainprog IN opt) THEN Files.Register(newSFile) END + IF (modName # "SYSTEM") OR (mainprog IN Options) THEN Files.Register(newSFile) END END RegisterNewSym; PROCEDURE DeleteNewSym*; @@ -837,8 +787,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF noerr THEN LogWStr(" "); LogWNum(Files.Pos(R[BodyFile]), 0); LogWStr(" chars.") END; IF noerr THEN IF modName = "SYSTEM" THEN - IF ~(mainprog IN opt) THEN Files.Register(BFile) END - ELSIF ~(mainprog IN opt) THEN + IF ~(mainprog IN Options) THEN Files.Register(BFile) END + ELSIF ~(mainprog IN Options) THEN Append(R[HeaderInclude], HFile); Files.Register(HIFile); Files.Register(BFile) ELSE @@ -854,29 +804,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) -PROCEDURE -GetAlignment(VAR a: INTEGER) "struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s"; - BEGIN + MaxReal := 3.40282346D38; (* REAL is 4 bytes *) + MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) + MinReal := -MaxReal; + MinLReal := -MaxLReal; + Texts.OpenWriter(W); - - MODULES := ""; Platform.GetEnv("MODULES", MODULES); - - OBERON := "."; Platform.GetEnv("OBERON", OBERON); - Strings.Append(";.;", OBERON); - Strings.Append(MODULES, OBERON); - Strings.Append(";", OBERON); - Strings.Append(Configuration.installdir, OBERON); - Strings.Append("/sym;", OBERON); - - Files.SetSearchPath(OBERON); - - (* Default address size and alignment are those of this compiler *) - AddressSize := SIZE(SYSTEM.ADDRESS); - GetAlignment(Alignment); - - (* Default type size model is that of the original Oberon-2 implementation (-O2) *) - ShortintSize := 1; - IntegerSize := 2; - LongintSize := 4; - SetSize := 4 END OPM. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index bd95c80f..ad3afe73 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1234,7 +1234,7 @@ END Import; i := 1; WHILE i < maxImps DO expCtxt.locmno[i] := -1; INC(i) END; OutObj(topScope^.right); ext := sfpresent & symExtended; - new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.opt); + new := ~sfpresent OR symNew OR (OPM.forcenewsym IN OPM.Options); IF OPM.noerr & sfpresent & (impCtxt.reffp # expCtxt.reffp) THEN new := TRUE; IF ~extsf THEN err(155) END @@ -1296,8 +1296,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, 1, bytetyp); - EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) - EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) + EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); @@ -1322,7 +1322,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); - EnterTyp("SET", Set, -1, settyp); (* Size set in Vishap.PropagateElementaryTypeSize *) + EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dafedf3d..34d1ef34 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -162,7 +162,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.Nindex, OPT.Nproc, OPT.Ncall: RETURN 10 - | OPT.Nguard: IF OPM.typchk IN OPM.opt THEN RETURN 10 ELSE RETURN 9 (*cast*) END + | OPT.Nguard: IF OPM.typchk IN OPM.Options THEN RETURN 10 ELSE RETURN 9 (*cast*) END | OPT.Nvarpar: IF comp IN {OPT.Array, OPT.DynArr} THEN RETURN 10 ELSE RETURN 9 END (* arrays don't need deref *) | OPT.Nderef: RETURN 9 | OPT.Nmop: CASE subclass OF @@ -243,7 +243,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("__SETOF("); Entier(n, MinPrec); OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) ELSIF to = OPT.Int THEN - IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN + IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) @@ -251,7 +251,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 SizeCast(n.typ.size, newtype.size); Entier(n, 9) END ELSIF to = OPT.Char THEN - IF OPM.ranchk IN OPM.opt THEN OPM.WriteString("__CHR"); + IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.Write(CloseParen) ELSE OPM.WriteString("(CHAR)"); Entier(n, 9) @@ -280,7 +280,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Index(n, d: OPT.Node; prec, dim: INTEGER); BEGIN - IF ~(OPM.inxchk IN OPM.opt) + IF ~(OPM.inxchk IN OPM.Options) OR (n^.right^.class = OPT.Nconst) & ((n^.right^.conval^.intval = 0) OR (n^.left^.typ^.comp # OPT.DynArr)) THEN expr(n^.right, prec) ELSE @@ -342,7 +342,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write(CloseBracket) END | OPT.Nguard: typ := n^.typ; obj := n^.left^.obj; - IF OPM.typchk IN OPM.opt THEN + IF OPM.typchk IN OPM.Options THEN IF typ^.comp = OPT.Record THEN OPM.WriteString(GuardRecFunc); IF obj^.mnolev # OPM.level THEN (*intermediate level var-par record*) OPM.WriteStringVar(obj^.scope^.name); OPM.WriteString("__curr->"); OPC.Ident(obj) @@ -363,7 +363,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.Write("("); OPC.Ident(typ^.strobj); OPM.Write(")"); expr(n^.left, designPrec) END END - | OPT.Neguard: IF OPM.typchk IN OPM.opt THEN + | OPT.Neguard: IF OPM.typchk IN OPM.Options THEN IF n^.left^.class = OPT.Nvarpar THEN OPM.WriteString("__GUARDEQR("); OPC.CompleteIdent(n^.left^.obj); OPM.WriteString(Comma); TypeOf(n^.left); ELSE OPM.WriteString("__GUARDEQP("); expr(n^.left^.left, MinPrec) @@ -844,7 +844,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END ; ActualPar(n^.right, n^.obj) | OPT.Nifelse: IF n^.subcl # OPT.assertfn THEN IfStat(n, FALSE, outerProc) - ELSIF OPM.assert IN OPM.opt THEN + ELSIF OPM.assert IN OPM.Options THEN OPM.WriteString("__ASSERT("); expr(n^.left^.left^.left, MinPrec); OPM.WriteString(Comma); OPM.WriteInt(n^.left^.right^.right^.conval^.intval); OPM.Write(CloseParen); OPC.EndStat END @@ -867,7 +867,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("goto exit__"); OPM.WriteInt(exit.label) END | OPT.Nreturn: IF OPM.level = 0 THEN - IF OPM.mainprog IN OPM.opt THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE IF n^.left # NIL THEN (* Make local copy of result before ExitProc deletes dynamic vars *) @@ -895,7 +895,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE Module*(prog: OPT.Node); BEGIN - IF ~(OPM.mainprog IN OPM.opt) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; + IF ~(OPM.mainprog IN OPM.Options) THEN OPC.GenHdr(prog^.right); OPC.GenHdrIncludes END ; OPC.GenBdy(prog^.right); stat(prog, NIL) END Module; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 22752d9b..b4f6ca95 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -2,13 +2,13 @@ MODULE extTools; IMPORT Strings, Console, Configuration, Platform, OPM; -VAR compilationOptions, CFLAGS: ARRAY 1023 OF CHAR; +VAR CFLAGS: ARRAY 1023 OF CHAR; PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN - IF OPM.verbose IN OPM.opt THEN + IF OPM.verbose IN OPM.Options THEN Console.String(title); Console.String(cmd); Console.Ln END; r := Platform.System(cmd); @@ -29,16 +29,27 @@ BEGIN END execute; +PROCEDURE InitialiseCompilerCommand(VAR s: ARRAY OF CHAR); +BEGIN + COPY(Configuration.compile, s); + Strings.Append(' -I "', s); + Strings.Append(OPM.ResourceDir, s); + Strings.Append('/include" ', s); + Platform.GetEnv("CFLAGS", CFLAGS); + Strings.Append (CFLAGS, s); + Strings.Append (" ", s); +END InitialiseCompilerCommand; + + PROCEDURE Assemble*(moduleName: ARRAY OF CHAR); VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(compilationOptions, cmd); - Strings.Append("-c ", cmd); - Strings.Append(moduleName, cmd); - Strings.Append(".c", cmd); - execute("Assemble: ", cmd); + InitialiseCompilerCommand(cmd); + Strings.Append("-c ", cmd); + Strings.Append(moduleName, cmd); + Strings.Append(".c", cmd); + execute("Assemble: ", cmd); END Assemble; @@ -46,9 +57,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition VAR cmd: ARRAY 1023 OF CHAR; BEGIN - cmd := Configuration.compile; - Strings.Append(" ", cmd); - Strings.Append(compilationOptions, cmd); + InitialiseCompilerCommand(cmd); Strings.Append(moduleName, cmd); Strings.Append(".c ", cmd); Strings.Append(additionalopts, cmd); @@ -58,7 +67,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(Configuration.installdir, cmd); + Strings.Append(OPM.ResourceDir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); @@ -66,11 +75,5 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition END LinkMain; -BEGIN - Strings.Append(' -I "', compilationOptions); - Strings.Append(Configuration.installdir, compilationOptions); - Strings.Append('/include" ', compilationOptions); - Platform.GetEnv("CFLAGS", CFLAGS); - Strings.Append (CFLAGS, compilationOptions); - Strings.Append (" ", compilationOptions); END extTools. +, \ No newline at end of file diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 388b3a95..76732ebc 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -433,11 +433,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files r.res := 0; r.eof := FALSE END ReadBytes; - PROCEDURE ReadByte* (VAR r : Rider; VAR x : ARRAY OF SYSTEM.BYTE); - BEGIN - ReadBytes(r, x, 1); - END ReadByte; - PROCEDURE Base* (VAR r: Rider): File; BEGIN RETURN r.buf.f END Base; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 2a908c99..2db3669c 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -14,9 +14,9 @@ TYPE FileHandle* = LONGINT; FileIdentity* = RECORD - volume*: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - index*: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - mtime*: LONGINT; (* File modification time, value is system dependent *) + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime: LONGINT; (* File modification time, value is system dependent *) END; EnvPtr = POINTER TO ARRAY 1024 OF CHAR; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 5e6e518b..b8d261dd 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -384,8 +384,6 @@ void writeMakeParameters() { fprintf(fd, "VERSION=%s\n", version); fprintf(fd, "ONAME=%s\n", oname); fprintf(fd, "DATAMODEL=%s\n", dataModel); - fprintf(fd, "INTSIZE=%d\n", intsize); - fprintf(fd, "MODEL=-O%c\n", intsize == 2 ? '2' : 'V'); fprintf(fd, "ADRSIZE=%d\n", addressSize); fprintf(fd, "ALIGNMENT=%d\n", alignment); fprintf(fd, "INSTALLDIR=%s\n", installdir); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk new file mode 100644 index 00000000..baf784c0 --- /dev/null +++ b/src/tools/make/oberon.mk @@ -0,0 +1,379 @@ +# DO NOT RUN THIS MAKEFILE DIRECTLY. +# +# Always use the makefile in the root of the enlistment. This makefile +# depends on up to date configuration files generated by the root makefile. + + + + +# Be independent of any CFLAGS settings in the calling environment +CFLAGS = + +# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. +ROOTDIR = $(CURDIR)$(.CURDIR) + +# Configuration.Make is created by src/tools/make/configure.c, which is run on +# *every* build by the makefile in the enlistment root. +include ./Configuration.Make + +FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) +BUILDDIR = build/$(FLAVOUR) +OBECOMP = $(ONAME)$(BINEXT) + + + +# Default make target - explain usage +usage: + @echo "" + @echo Do not run this makefile directly, always run the makefile in + @echo the root of the enlistment. + + + + +clean: + @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" + rm -rf $(BUILDDIR) + rm -f $(OBECOMP) + + + + +# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory + +assemble: + @printf "\nmake assemble - compiling Oberon compiler c source:\n" + @printf " VERSION: %s\n" "$(VERSION)" + @printf " BRANCH: %s\n" "$(BRANCH)" + @printf " Target characteristics:\n" + @printf " PLATFORM: %s\n" "$(PLATFORM)" + @printf " OS: %s\n" "$(OS)" + @printf " BUILDDIR: %s\n" "$(BUILDDIR)" + @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" + @printf " Oberon characteristics:\n" + @printf " MODEL: %s\n" "$(MODEL)" + @printf " ADRSIZE: %s\n" "$(ADRSIZE)" + @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" + @printf " C compiler:\n" + @printf " COMPILER: %s\n" "$(COMPILER)" + @printf " COMPILE: %s\n" "$(COMPILE)" + @printf " DATAMODEL: %s\n" "$(DATAMODEL)" + + cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c + cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c + cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c + + cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ + SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + OPC.o OPV.o OPB.o OPP.o + + cp src/system/*.[ch] $(BUILDDIR) + @printf "$(OBECOMP) created.\n" + + + + +compilerfromsavedsource: + @echo Populating clean build directory from bootstrap C sources $(PLATFORM)-$(ADRSIZE)$(ALIGNMENT). + @mkdir -p $(BUILDDIR) + @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) + @cp bootstrap/*.[ch] $(BUILDDIR) + @make -f src/tools/make/oberon.mk -s assemble + @cp bootstrap/*.[ch] $(BUILDDIR) + + + + +translate: +# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, +# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. + + if [ ! -e $(OBECOMP) ]; then make -f src/tools/make/oberon.mk -s compilerfromsavedsource; fi + + @printf "\nmake translate - translating compiler source from Oberon to C:\n" + @printf " PLATFORM: %s\n" $(PLATFORM) + @printf " MODEL: %s\n" $(MODEL) + @printf " ADRSIZE: %s\n" $(ADRSIZE) + @printf " ALIGNMENT: %s\n" $(ALIGNMENT) + @mkdir -p $(BUILDDIR) + @rm -f $(BUILDDIR)/*.sym + + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Console.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + + @printf "$(BUILDDIR) filled with compiler C source.\n" + + + + +browsercmd: + @printf "\nMaking symbol browser\n" + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + OPC.o + + + + +FORCE: + +# installable: Check for access to the installation directory + +installable: + @rm -rf "S(INSTALLDIR)/test-access-qqq" + @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi + @rm -rf "S(INSTALLDIR)/test-access-qqq" + + + + +# install: Use only after a successful full build. Installs the compiler +# and libraries in /opt/$(ONAME). +# May require root access. +install: + @printf "\nInstalling into \"$(INSTALLDIR)\"\n" + @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" + @mkdir -p "$(INSTALLDIR)/bin" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" + @mkdir -p "$(INSTALLDIR)/$(MODEL)/lib" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/$(MODEL)/lib/" + @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + +# showpath: Describe how to set the PATH variable +showpath: + @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" + @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" + @printf "\n" + + + + +uninstall: + @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" + rm -rf "$(INSTALLDIR)" + rm -f /etc/ld.so.conf/lib$(ONAME) + if which ldconfig >/dev/null 2>&1; then ldconfig; fi + + + + +v4: + @printf "\nMaking v4 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Sets.Mod + +ooc2: + @printf "\nMaking ooc2 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Real0.Mod + + +TODO: Comment disabled lines contain use of VAL that reads beyond source variable + +ooc: + @printf "\nMaking ooc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod + +oocX11: + @printf "\nMaking oocX11 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXYplane.Mod + +ulm: + @printf "\nMaking ulm library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + +pow32: + @printf "\nMaking pow library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/pow/powStrings.Mod + +misc: + @printf "\nMaking misc library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod + +s3: + @printf "\nMaking s3 library\n" + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod +# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + +librarybinary: + @printf "\nMaking lib$(ONAME)\n" + +# Remove objects that should not be part of the library + rm -f $(BUILDDIR)/Compiler.o + +# Note: remining compiler files are retained in the library allowing the building +# of utilities like BrowserCmd.Mod (aka showdef). + +# Make static library + ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + +# Make shared library + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + + + + +library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary + + + + +sourcechanges: + @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) + + + + +RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" + +confidence: + @printf "\n\n--- Confidence tests ---\n\n" + cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/intsyntax; $(RUNTEST) + cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/lola; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) + if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi + @printf "\n\n--- Confidence tests passed ---\n\n" diff --git a/src/tools/make/vishap.make b/src/tools/make/vishap.make deleted file mode 100644 index b863944a..00000000 --- a/src/tools/make/vishap.make +++ /dev/null @@ -1,379 +0,0 @@ -# DO NOT RUN THIS MAKEFILE DIRECTLY. -# -# Always use the makefile in the root of the enlistment. This makefile -# depends on up to date configuration files generated by the root makefile. - - - - -# Be independent of any CFLAGS settings in the calling environment -CFLAGS = - -# Gnu make has the make initial directory in CURDIR, BSD make has it in .CURDIR. -ROOTDIR = $(CURDIR)$(.CURDIR) - -# Configuration.Make is created by src/tools/make/configure.c, which is run on -# *every* build by the makefile in the enlistment root. -include ./Configuration.Make - -FLAVOUR = $(OS).$(DATAMODEL).$(COMPILER) -BUILDDIR = build/$(FLAVOUR) -VISHAP = $(ONAME)$(BINEXT) - -MODEL=-O2 # Override model - build everything as S8,I16,L32. - - - -# Default make target - explain usage -usage: - @echo "" - @echo Do not run this makefile directly, always run the makefile in - @echo the root of the enlistment. - - - - -clean: - @printf "\n\n--- Cleaning branch $(BRANCH) $(OS) $(COMPILER) $(DATAMODEL) ---\n\n" - rm -rf $(BUILDDIR) - rm -f $(VISHAP) - - - - -# Assemble: Generate the Vishap Oberon compiler binary by compiling the C sources in the build directory - -assemble: - @printf "\nmake assemble - compiling Oberon compiler c source:\n" - @printf " VERSION: %s\n" "$(VERSION)" - @printf " BRANCH: %s\n" "$(BRANCH)" - @printf " Target characteristics:\n" - @printf " PLATFORM: %s\n" "$(PLATFORM)" - @printf " OS: %s\n" "$(OS)" - @printf " BUILDDIR: %s\n" "$(BUILDDIR)" - @printf " INSTALLDIR: %s\n" "$(INSTALLDIR)" - @printf " Oberon characteristics:\n" - @printf " INTSIZE: %s\n" "$(INTSIZE)" - @printf " ADRSIZE: %s\n" "$(ADRSIZE)" - @printf " ALIGNMENT: %s\n" "$(ALIGNMENT)" - @printf " C compiler:\n" - @printf " COMPILER: %s\n" "$(COMPILER)" - @printf " COMPILE: %s\n" "$(COMPILE)" - @printf " DATAMODEL: %s\n" "$(DATAMODEL)" - - cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c - cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c - cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c - - cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Vishap.c -o $(ROOTDIR)/$(VISHAP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ - Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ - OPC.o OPV.o OPB.o OPP.o - - cp src/system/*.[ch] $(BUILDDIR) - @printf "$(VISHAP) created.\n" - - - - -compilerfromsavedsource: - @echo Populating clean build directory from bootstrap C sources. - @mkdir -p $(BUILDDIR) - @cp bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT)/* $(BUILDDIR) - @cp bootstrap/*.[ch] $(BUILDDIR) - @make -f src/tools/make/vishap.make -s assemble - @cp bootstrap/*.[ch] $(BUILDDIR) - - - - -translate: -# Make sure we have an oberon compiler binary: if we built one earlier we'll use it, -# otherwise use one of the pre-prepared sets of C sources in the bootstrap directory. - - if [ ! -e $(VISHAP) ]; then make -f src/tools/make/vishap.make -s compilerfromsavedsource; fi - - @printf "\nmake translate - translating compiler source from Oberon to C:\n" - @printf " PLATFORM: %s\n" $(PLATFORM) - @printf " INTSIZE: %s\n" $(INTSIZE) - @printf " MODEL: %s\n" $(MODEL) - @printf " ADRSIZE: %s\n" $(ADRSIZE) - @printf " ALIGNMENT: %s\n" $(ALIGNMENT) - @mkdir -p $(BUILDDIR) - @rm -f $(BUILDDIR)/*.sym - - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/library/misc/vt100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/errors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPM.cmdln.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) $(MODEL) ../../src/compiler/Vishap.Mod - - @printf "$(BUILDDIR) filled with compiler C source.\n" - - - - -browsercmd: - @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -fSm $(MODEL) ../../src/tools/browser/BrowserCmd.Mod - @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ - Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ - OPC.o - - - - -FORCE: - -# installable: Check for access to the installation directory - -installable: - @rm -rf "S(INSTALLDIR)/test-access-qqq" - @if ! mkdir -p "$(INSTALLDIR)/test-access-qqq";then echo "\\n\\n Cannot write to install directory.\\n Please use sudo or run as root/administrator.\\n\\n"; exit 1;fi - @rm -rf "S(INSTALLDIR)/test-access-qqq" - - - - -# install: Use only after a successful full build. Installs the compiler -# and libraries in /opt/$(ONAME). -# May require root access. -install: - @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)" - @mkdir -p "$(INSTALLDIR)/bin" "$(INSTALLDIR)/include" "$(INSTALLDIR)/sym" "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/sym/" - @cp $(VISHAP) "$(INSTALLDIR)/bin/$(VISHAP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME).* "$(INSTALLDIR)/lib/" - @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi - - -# showpath: Describe how to set the PATH variable -showpath: - @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" - @printf "export PATH=\"$(INSTALLDIR)/bin:\$$PATH\"\n" - @printf "\n" - - - - -uninstall: - @printf "\nUninstalling from \"$(INSTALLDIR)\"\n" - rm -rf "$(INSTALLDIR)" - rm -f /etc/ld.so.conf/lib$(ONAME) - if which ldconfig >/dev/null 2>&1; then ldconfig; fi - - - - -v4: - @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/v4/Sets.Mod - -ooc2: - @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc2/ooc2Real0.Mod - - -TODO: Comment disabled lines contain use of VAL that reads beyond source variable - -ooc: - @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod - -oocX11: - @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/oocX11/oocXYplane.Mod - -ulm: - @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/ulm/ulmIntOperations.Mod - -pow32: - @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/pow/powStrings.Mod - -misc: - @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/misc/MultiArrayRiders.Mod - -s3: - @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(VISHAP) -Ffs $(MODEL) ../../src/library/s3/ethStrings.Mod - -librarybinary: - @printf "\nMaking lib$(ONAME)\n" - -# Remove objects that should not be part of the library - rm -f $(BUILDDIR)/vishap.o - -# Note: remining compiler files are retained in the library allowing the building -# of utilities like BrowserCmd.Mod (aka showdef). - -# Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o - -# Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o - - - - -library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary - - - - -sourcechanges: - @cd $(BUILDDIR) && sh $(ROOTDIR)/src/tools/make/sourcechanges.sh $(ROOTDIR)/bootstrap/$(PLATFORM)-$(ADRSIZE)$(ALIGNMENT) - - - - -RUNTEST = COMPILER=$(COMPILER) OBECOMP=$(VISHAP) FLAVOUR=$(FLAVOUR) BRANCH=$(BRANCH) sh ./test.sh "$(INSTALLDIR)" - -confidence: - @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/hello; $(RUNTEST) - cd src/test/confidence/intsyntax; $(RUNTEST) - cd src/test/confidence/language; $(RUNTEST) - cd src/test/confidence/texts; $(RUNTEST) - cd src/test/confidence/library; $(RUNTEST) - cd src/test/confidence/lola; $(RUNTEST) - cd src/test/confidence/arrayassignment; $(RUNTEST) - if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi - @printf "\n\n--- Confidence tests passed ---\n\n" From 4bc697f49da652c38b43af2198cb6f03ea3bd613 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:36:00 +0100 Subject: [PATCH 057/140] Add files missed on last commit. --- bootstrap/unix-44/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/unix-48/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/unix-88/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/windows-48/Compiler.c | 174 ++++++++++++++++++++++++++++++++ bootstrap/windows-88/Compiler.c | 174 ++++++++++++++++++++++++++++++++ 5 files changed, 870 insertions(+) create mode 100644 bootstrap/unix-44/Compiler.c create mode 100644 bootstrap/unix-48/Compiler.c create mode 100644 bootstrap/unix-88/Compiler.c create mode 100644 bootstrap/windows-48/Compiler.c create mode 100644 bootstrap/windows-88/Compiler.c diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-44/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-48/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/unix-88/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/windows-48/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c new file mode 100644 index 00000000..6444021c --- /dev/null +++ b/bootstrap/windows-88/Compiler.c @@ -0,0 +1,174 @@ +/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ + +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Configuration.h" +#include "Heap.h" +#include "OPB.h" +#include "OPC.h" +#include "OPM.h" +#include "OPP.h" +#include "OPT.h" +#include "OPV.h" +#include "Platform.h" +#include "Strings.h" +#include "extTools.h" +#include "vt100.h" + + +static CHAR Compiler_mname[256]; + + +export void Compiler_Module (BOOLEAN *done); +static void Compiler_PropagateElementaryTypeSizes (void); +export void Compiler_Translate (void); +static void Compiler_Trap (int16 sig); + + +void Compiler_Module (BOOLEAN *done) +{ + BOOLEAN ext, new; + OPT_Node p = NIL; + OPP_Module(&p, OPM_opt); + if (OPM_noerr) { + OPV_Init(); + OPT_InitRecno(); + OPV_AdrAndSize(OPT_topScope); + OPT_Export(&ext, &new); + if (OPM_noerr) { + OPM_OpenFiles((void*)OPT_SelfName, 256); + OPC_Init(); + OPV_Module(p); + if (OPM_noerr) { + if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + OPM_DeleteNewSym(); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" Main program.", 16); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + } else { + if (new) { + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"32m", 4); + } + OPM_LogWStr((CHAR*)" New symbol file.", 19); + if (!__IN(16, OPM_opt, 32)) { + vt100_SetAttr((CHAR*)"0m", 3); + } + OPM_RegisterNewSym(); + } else if (ext) { + OPM_LogWStr((CHAR*)" Extended symbol file.", 24); + OPM_RegisterNewSym(); + } + } + } else { + OPM_DeleteNewSym(); + } + } + } + OPM_CloseFiles(); + OPT_Close(); + OPM_LogWLn(); + *done = OPM_noerr; +} + +static void Compiler_PropagateElementaryTypeSizes (void) +{ + OPT_Struct adrinttyp = NIL; + OPT_sysptrtyp->size = OPM_AddressSize; + OPT_adrtyp->size = OPM_AddressSize; + OPT_settyp->size = OPM_SetSize; + adrinttyp = OPT_IntType(OPM_AddressSize); + OPT_adrtyp->strobj = adrinttyp->strobj; + OPT_sinttyp = OPT_IntType(OPM_ShortintSize); + OPT_inttyp = OPT_IntType(OPM_IntegerSize); + OPT_linttyp = OPT_IntType(OPM_LongintSize); + OPT_sintobj->typ = OPT_sinttyp; + OPT_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; +} + +void Compiler_Translate (void) +{ + BOOLEAN done; + CHAR modulesobj[2048]; + modulesobj[0] = 0x00; + if (OPM_OpenPar()) { + for (;;) { + OPM_Init(&done, (void*)Compiler_mname, 256); + if (!done) { + return; + } + OPM_InitOptions(); + Compiler_PropagateElementaryTypeSizes(); + Heap_GC(0); + Compiler_Module(&done); + if (!done) { + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Module compilation failed.", 27); + OPM_LogWLn(); + Platform_Exit(1); + } + if (!__IN(13, OPM_opt, 32)) { + if (__IN(14, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + } else { + if (!__IN(10, OPM_opt, 32)) { + extTools_Assemble(OPM_modName, 32); + Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); + Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); + Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); + } else { + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + } + } + } + } + } +} + +static void Compiler_Trap (int16 sig) +{ + Heap_FINALL(); + if (sig == 3) { + Platform_Exit(0); + } else { + if ((sig == 4 && Platform_HaltCode == -15)) { + OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); + OPM_LogWLn(); + } + Platform_Exit(2); + } +} + + +export int main(int argc, char **argv) +{ + __INIT(argc, argv); + __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Heap); + __MODULE_IMPORT(OPB); + __MODULE_IMPORT(OPC); + __MODULE_IMPORT(OPM); + __MODULE_IMPORT(OPP); + __MODULE_IMPORT(OPT); + __MODULE_IMPORT(OPV); + __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); + __MODULE_IMPORT(extTools); + __MODULE_IMPORT(vt100); + __REGMAIN("Compiler", 0); + __REGCMD("Translate", Compiler_Translate); +/* BEGIN */ + Platform_SetInterruptHandler(Compiler_Trap); + Platform_SetQuitHandler(Compiler_Trap); + Platform_SetBadInstructionHandler(Compiler_Trap); + Compiler_Translate(); + __FINI; +} From a6f0088299f3edae28bf86eb67998e074b27a899 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 15:50:24 +0100 Subject: [PATCH 058/140] Trigger build --- src/test/confidence/planned-binary-change | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 5a45ccfe..0a38b805 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -20 Sep 2016 16:42:29 +25 Sep 2016 15:50:01 From ef0a447a68b98e9b15002bf60215b13ff934d82f Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 25 Sep 2016 16:32:44 +0100 Subject: [PATCH 059/140] Fix shared library naming, and getcwd warning. --- src/compiler/OPM.Mod | 14 +++++++------- src/compiler/extTools.Mod | 4 ++-- src/system/Platformunix.Mod | 8 ++++---- src/tools/make/oberon.mk | 16 ++++++++-------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f7a171aa..c0f59250 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -86,7 +86,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR SourceFileName : ARRAY 256 OF CHAR; - GlobalModel, Model*: CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) + GlobalModel, Model*: ARRAY 10 OF CHAR; (* 2: S8/I16/L32, C: S16/I32/L64, V:S8/I32/L64 *) GlobalAddressSize, AddressSize*: INTEGER; GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; @@ -189,8 +189,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Elementary type size model *) | "O": IF i+1 >= Strings.Length(s) THEN LogWStr("-O option requires following size model character."); LogWLn ELSE - Model := s[i+1]; - IF (Model # '2') & (Model # 'C') & (Model # 'V') THEN + Model[0] := s[i+1]; Model[1] := 0X; + IF (Model[0] # '2') & (Model[0] # 'C') & (Model[0] # 'V') THEN LogWStr("Unrecognised size model character following -O."); LogWLn END; INC(i) @@ -287,7 +287,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* Set options to initial defaults *) AddressSize := SIZE(SYSTEM.ADDRESS); (* This compilers address size *) GetAlignment(Alignment); (* This compilers alignment *) - Model := '2'; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) + Model := "2"; (* Size model of common Oberon-2 implementations: S8/I16/L32 *) Options := {inxchk, typchk, ptrinit, assert}; (* Default options *) (* Pick up global option changes from start of command line *) @@ -338,7 +338,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF mainlinkstat IN Options THEN INCL(Options, mainprog) END; MaxIndex := SignedMaximum(AddressSize); - CASE Model OF + CASE Model[0] OF |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 @@ -349,8 +349,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF verbose IN Options THEN VerboseListSizes END; ResourceDir := Configuration.installdir; - Strings.Append("/ ", ResourceDir); - ResourceDir[Strings.Length(ResourceDir)-1] := Model; + Strings.Append("/", ResourceDir); + Strings.Append(Model, ResourceDir); modules := ""; Platform.GetEnv("MODULES", modules); searchpath := "."; Platform.GetEnv("OBERON", searchpath); diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index b4f6ca95..f158fd60 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -67,10 +67,10 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.objflag, cmd); Strings.Append(moduleName, cmd); Strings.Append(Configuration.linkflags, cmd); - Strings.Append(OPM.ResourceDir, cmd); + Strings.Append(Configuration.installdir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); - + Strings.Append(OPM.Model, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 2db3669c..1ef21940 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -437,13 +437,13 @@ END Unlink; PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; -PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR) "getcwd((char*)cwd, cwd__len)"; +PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; VAR r: INTEGER; BEGIN - r := chdir(n); getcwd(CWD); - IF r < 0 THEN RETURN err() ELSE RETURN 0 END + IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 + ELSE RETURN err() END END Chdir; @@ -536,8 +536,8 @@ BEGIN HaltCode := -128; HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); - CWD := ""; getcwd(CWD); PID := getpid(); + IF getcwd(CWD) = NIL THEN CWD := "" END; SeekSet := seekset(); SeekCur := seekcur(); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index baf784c0..1d3fd191 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -157,14 +157,14 @@ install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" @mkdir -p "$(INSTALLDIR)/bin" + @mkdir -p "$(INSTALLDIR)/lib" @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/lib" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" - @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/$(MODEL)/lib/" + @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" + @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi @@ -345,10 +345,10 @@ librarybinary: # of utilities like BrowserCmd.Mod (aka showdef). # Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME).a" $(BUILDDIR)/*.o + ar rcs "$(BUILDDIR)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/*.o # Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME).so *.o + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o From 9ffafc59b4002ab55c7bafc1aa8639916004b185 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 26 Sep 2016 19:01:59 +0100 Subject: [PATCH 060/140] Reenable library files, fix LONGREAL constants and type casts. --- bootstrap/unix-44/Compiler.c | 22 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 2 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 23 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 16 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 332 +- bootstrap/unix-44/OPM.h | 9 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 4 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 20 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 24 +- bootstrap/unix-44/Platform.h | 3 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 32 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 22 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 2 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 23 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 16 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 332 +- bootstrap/unix-48/OPM.h | 9 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 4 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 20 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 24 +- bootstrap/unix-48/Platform.h | 3 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 32 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 22 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 2 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 23 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 16 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 332 +- bootstrap/unix-88/OPM.h | 9 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 4 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 20 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 24 +- bootstrap/unix-88/Platform.h | 3 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 32 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 22 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 2 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 23 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 16 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 332 +- bootstrap/windows-48/OPM.h | 9 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 4 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 20 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 11 +- bootstrap/windows-48/Platform.h | 3 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 32 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 22 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 2 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 23 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 16 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 332 +- bootstrap/windows-88/OPM.h | 9 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 4 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 20 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 11 +- bootstrap/windows-88/Platform.h | 3 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 32 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 20 +- src/library/ooc/oocLRealMath.Mod | 290 +- src/library/ooc/oocLowReal.Mod | 4 +- src/library/s3/ethReals.Mod | 138 +- src/library/ulm/ulmCipherOps.Mod | 106 +- src/library/ulm/ulmCiphers.Mod | 28 +- src/library/ulm/ulmDisciplines.Mod | 238 +- src/library/ulm/ulmErrors.Mod | 281 +- src/library/ulm/ulmEvents.Mod | 346 +- src/library/ulm/ulmForwarders.Mod | 434 +- src/library/ulm/ulmIO.Mod | 4 +- src/library/ulm/ulmIndirectDisciplines.Mod | 62 +- src/library/ulm/ulmIntOperations.Mod | 144 +- src/library/ulm/ulmNetIO.Mod | 1040 ++--- src/library/ulm/ulmOperations.Mod | 428 +- src/library/ulm/ulmPersistentDisciplines.Mod | 709 +-- src/library/ulm/ulmPersistentObjects.Mod | 1995 ++++----- src/library/ulm/ulmRandomGenerators.Mod | 764 ++-- src/library/ulm/ulmRelatedEvents.Mod | 773 ++-- src/library/ulm/ulmResources.Mod | 16 +- src/library/ulm/ulmScales.Mod | 822 ++-- src/library/ulm/ulmServices.Mod | 950 ++-- src/library/ulm/ulmStreamDisciplines.Mod | 455 +- src/library/ulm/ulmStreams.Mod | 4110 +++++++++--------- src/library/ulm/ulmSysIO.Mod | 79 +- src/library/ulm/ulmSysTypes.Mod | 12 +- src/library/ulm/ulmTCrypt.Mod | 3300 +++++++------- src/library/ulm/ulmTimeConditions.Mod | 742 ++-- src/library/ulm/ulmTimers.Mod | 592 +-- src/library/ulm/ulmTimes.Mod | 727 ++-- src/library/ulm/ulmTypes.Mod | 11 +- src/system/Platformunix.Mod | 8 +- src/system/Platformwindows.Mod | 4 + src/tools/make/oberon.mk | 104 +- 229 files changed, 11147 insertions(+), 11288 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 6f5eb201..4800d53c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c75a1073..55e5fa16 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c1b4cb67..7efc4cc4 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index ef0c0dbe..18c66534 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 986a65ef..158cb341 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9d981ce0..efc9fd98 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 1faae4d6..e402259d 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 6f5eb201..4800d53c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c75a1073..55e5fa16 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 0a1f8f54..3f54ed72 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index ef0c0dbe..18c66534 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 986a65ef..158cb341 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ab510cdb..28f099a4 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 64e78861..0afd65f7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 5bf17489..c2089f05 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 5b82978c..efa49511 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 75495244..5aebf125 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ca208a31..71ad15a1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 3fcd0b28..0cd62e2b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e3ff56bd..0e05b5aa 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 4710b95f..297ade25 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 8; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index f6a8dfc5..c9986e20 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index ad18ebdb..b0a12a18 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 09f3d249..07fa214f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5bad2591..26dc3ce5 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -65,6 +65,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int64 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -115,6 +116,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() ECONNABORTED #define Platform_ECONNREFUSED() ECONNREFUSED #define Platform_EHOSTUNREACH() EHOSTUNREACH +#define Platform_EINTR() EINTR #define Platform_EMFILE() EMFILE #define Platform_ENETUNREACH() ENETUNREACH #define Platform_ENFILE() ENFILE @@ -218,6 +220,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int64 Platform_OSAllocate (int64 size) { int64 _o_result; @@ -618,13 +627,11 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) { int16 _o_result; int16 r; - r = Platform_chdir(n, n__len); - Platform_getcwd((void*)Platform_CWD, 256); - if (r < 0) { - _o_result = Platform_err(); + if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { + _o_result = 0; return _o_result; } else { - _o_result = 0; + _o_result = Platform_err(); return _o_result; } __RETCHK; @@ -784,9 +791,10 @@ export void *Platform__init(void) Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); - Platform_CWD[0] = 0x00; - Platform_getcwd((void*)Platform_CWD, 256); Platform_PID = Platform_getpid(); + if (Platform_getcwd((void*)Platform_CWD, 256) == NIL) { + Platform_CWD[0] = 0x00; + } Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2402b996..c9b53f3c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -50,6 +50,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int64 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 2590cb27..a71cf72a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7800b252..47f1e428 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 11937ee4..7d63057e 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7c1ea1bd..ef927317 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a7de696c..8d274283 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 945fbff7..1f66b283 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index eccb5d85..9e9400e1 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index a87d0732..f165488e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7234f518..534a5c0d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 4; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 4; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1e5c6674..010efab1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 0a1f8f54..3f54ed72 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a70a40bf..ff99f665 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 51a62ed7..41a1da42 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -67,6 +67,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int32 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -104,6 +105,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() WSAECONNABORTED #define Platform_ECONNREFUSED() WSAECONNREFUSED #define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_EINTR() WSAEINTR #define Platform_ENETUNREACH() WSAENETUNREACH #define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED #define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND @@ -230,6 +232,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int32 Platform_OSAllocate (int32 size) { int32 _o_result; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index fff5ea74..7917d958 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -51,6 +51,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int32 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ab510cdb..28f099a4 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 64e78861..0afd65f7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 6444021c..1b3b14f1 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define INTEGER int16 #define LONGINT int32 @@ -32,7 +32,7 @@ void Compiler_Module (BOOLEAN *done) { BOOLEAN ext, new; OPT_Node p = NIL; - OPP_Module(&p, OPM_opt); + OPP_Module(&p, OPM_Options); if (OPM_noerr) { OPV_Init(); OPT_InitRecno(); @@ -43,22 +43,22 @@ void Compiler_Module (BOOLEAN *done) OPC_Init(); OPV_Module(p); if (OPM_noerr) { - if ((__IN(10, OPM_opt, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { + if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); @@ -115,17 +115,17 @@ void Compiler_Translate (void) OPM_LogWLn(); Platform_Exit(1); } - if (!__IN(13, OPM_opt, 32)) { - if (__IN(14, OPM_opt, 32)) { + if (!__IN(13, OPM_Options, 32)) { + if (__IN(14, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); } else { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { extTools_Assemble(OPM_modName, 32); Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048); Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048); Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048); } else { - extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_opt, 32), modulesobj, 2048); + extTools_LinkMain((void*)OPM_modName, 32, __IN(15, OPM_Options, 32), modulesobj, 2048); } } } diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 28528f64..85c8cf89 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index d9030dbe..a365d693 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 11937ee4..7d63057e 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 4eb27c8b..08f4e38e 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7d407820..72ef67df 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 1391c541..668d8ebf 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ca208a31..71ad15a1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 3fcd0b28..0cd62e2b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e3ff56bd..0e05b5aa 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 93e2105b..a2ceebdf 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d211135a..e370e621 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1541,28 +1541,9 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPT_Struct y = NIL; int16 f, g; OPT_Struct p = NIL, q = NIL; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22); - OPM_LogWLn(); - } y = ynode->typ; f = x->form; g = y->form; - if (__IN(18, OPM_opt, 32)) { - OPM_LogWStr((CHAR*)"y.form = ", 10); - OPM_LogWNum(y->form, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"f = ", 5); - OPM_LogWNum(f, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"g = ", 5); - OPM_LogWNum(g, 0); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18); - OPM_LogWNum(ynode->typ->size, 0); - OPM_LogWLn(); - } if (ynode->class == 8 || (ynode->class == 9 && f != 12)) { OPB_err(126); } @@ -2367,7 +2348,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { if (!__IN(f, 0x0c, 32) || !((__IN(atyp->form, 0x1e, 32) && atyp->size == 1))) { - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { OPB_err(-301); } } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 97860bfc..8c0fd594 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e4c0eb06..4c9ae495 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -989,7 +989,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; - } else if ((((((__IN(5, OPM_opt, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { + } else if ((((((__IN(5, OPM_Options, 32) && vis == 0)) && obj->mnolev > 0)) && obj->typ->form == 11)) { OPM_WriteString((CHAR*)" = NIL", 7); } } @@ -1153,7 +1153,7 @@ static void OPC_GenHeaderMsg (void) OPM_Write(' '); i = 0; while (i <= 31) { - if (__IN(i, OPM_glbopt, 32)) { + if (__IN(i, OPM_Options, 32)) { switch (i) { case 0: OPM_Write('x'); @@ -1355,7 +1355,7 @@ void OPC_EnterBody (void) { OPM_WriteLn(); OPM_WriteString((CHAR*)"export ", 8); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"int main(int argc, char **argv)", 32); OPM_WriteLn(); } else { @@ -1366,20 +1366,20 @@ void OPC_EnterBody (void) } OPC_BegBlk(); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__INIT(argc, argv)", 19); } else { OPM_WriteString((CHAR*)"__DEFMOD", 9); } OPC_EndStat(); - if ((__IN(10, OPM_opt, 32) && 0)) { + if ((__IN(10, OPM_Options, 32) && 0)) { OPC_BegStat(); OPM_WriteString((CHAR*)"/*don`t do it!*/ printf(\"DEMO VERSION: DO NOT USE THIS PROGRAM FOR ANY COMMERCIAL PURPOSE\\n\")", 94); OPC_EndStat(); } OPC_InitImports(OPT_topScope->right); OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__REGMAIN(\"", 12); } else { OPM_WriteString((CHAR*)"__REGMOD(\"", 11); @@ -1399,7 +1399,7 @@ void OPC_EnterBody (void) void OPC_ExitBody (void) { OPC_BegStat(); - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI;", 8); } else { OPM_WriteString((CHAR*)"__ENDMOD;", 10); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 3325aded..e681f43d 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 4710b95f..297ade25 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -19,7 +19,14 @@ typedef static CHAR OPM_SourceFileName[256]; -export int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +static CHAR OPM_GlobalModel[10]; +export CHAR OPM_Model[10]; +static int16 OPM_GlobalAddressSize; +export int16 OPM_AddressSize; +static int16 OPM_GlobalAlignment; +export int16 OPM_Alignment; +export SET OPM_GlobalOptions, OPM_Options; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -27,7 +34,6 @@ export int32 OPM_curpos, OPM_errpos, OPM_breakpc; export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -export SET OPM_opt, OPM_glbopt; static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; @@ -36,8 +42,7 @@ static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; static int16 OPM_S; -static CHAR OPM_OBERON[1024]; -static CHAR OPM_MODULES[1024]; +export CHAR OPM_ResourceDir[1024]; static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); @@ -50,8 +55,6 @@ export void OPM_FPrintReal (int32 *fp, REAL real); export void OPM_FPrintSet (int32 *fp, SET set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); -static void OPM_GetProperties (void); -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export int16 OPM_Integer (int64 n); @@ -68,7 +71,7 @@ export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt); +static void OPM_ScanOptions (CHAR *s, LONGINT s__len); static void OPM_ShowLine (int64 pos); export int64 OPM_SignedMaximum (int32 bytecount); export int64 OPM_SignedMinimum (int32 bytecount); @@ -93,10 +96,8 @@ export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); export void OPM_err (int16 n); -static int32 OPM_minusop (int32 i); -static int32 OPM_power0 (int32 i, int32 j); -#define OPM_GetAlignment(a) struct {char c; long long l;} s; *a = (char*)&s.l - (char*)&s +#define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s void OPM_LogW (CHAR ch) { @@ -120,6 +121,23 @@ void OPM_LogWLn (void) Console_Ln(); } +int64 OPM_SignedMaximum (int32 bytecount) +{ + int64 _o_result; + int64 result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); + _o_result = result - 1; + return _o_result; +} + +int64 OPM_SignedMinimum (int32 bytecount) +{ + int64 _o_result; + _o_result = -OPM_SignedMaximum(bytecount) - 1; + return _o_result; +} + int32 OPM_Longint (int64 n) { int32 _o_result; @@ -134,7 +152,7 @@ int16 OPM_Integer (int64 n) return _o_result; } -static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) +static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { int16 i; __DUP(s, s__len, CHAR); @@ -142,75 +160,57 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) while (s[__X(i, s__len)] != 0x00) { switch (s[__X(i, s__len)]) { case 'p': - *opt = *opt ^ 0x20; + OPM_Options = OPM_Options ^ 0x20; break; case 'a': - *opt = *opt ^ 0x80; + OPM_Options = OPM_Options ^ 0x80; break; case 'r': - *opt = *opt ^ 0x04; + OPM_Options = OPM_Options ^ 0x04; break; case 't': - *opt = *opt ^ 0x08; + OPM_Options = OPM_Options ^ 0x08; break; case 'x': - *opt = *opt ^ 0x01; + OPM_Options = OPM_Options ^ 0x01; break; case 'e': - *opt = *opt ^ 0x0200; + OPM_Options = OPM_Options ^ 0x0200; break; case 's': - *opt = *opt ^ 0x10; + OPM_Options = OPM_Options ^ 0x10; break; case 'F': - *opt = *opt ^ 0x020000; + OPM_Options = OPM_Options ^ 0x020000; break; case 'm': - *opt = *opt ^ 0x0400; + OPM_Options = OPM_Options ^ 0x0400; break; case 'M': - *opt = *opt ^ 0x8000; + OPM_Options = OPM_Options ^ 0x8000; break; case 'S': - *opt = *opt ^ 0x2000; + OPM_Options = OPM_Options ^ 0x2000; break; case 'c': - *opt = *opt ^ 0x4000; + OPM_Options = OPM_Options ^ 0x4000; break; case 'f': - *opt = *opt ^ 0x010000; + OPM_Options = OPM_Options ^ 0x010000; break; case 'V': - *opt = *opt ^ 0x040000; + OPM_Options = OPM_Options ^ 0x040000; break; case 'O': if (i + 1 >= Strings_Length(s, s__len)) { OPM_LogWStr((CHAR*)"-O option requires following size model character.", 51); OPM_LogWLn(); } else { - switch (s[__X(i + 1, s__len)]) { - case '2': - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; - break; - case 'V': - OPM_ShortintSize = 1; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - case 'C': - OPM_ShortintSize = 2; - OPM_IntegerSize = 4; - OPM_LongintSize = 8; - OPM_SetSize = 8; - break; - default: - OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); - OPM_LogWLn(); - break; + OPM_Model[0] = s[__X(i + 1, s__len)]; + OPM_Model[1] = 0x00; + if ((((OPM_Model[0] != '2' && OPM_Model[0] != 'C')) && OPM_Model[0] != 'V')) { + OPM_LogWStr((CHAR*)"Unrecognised size model character following -O.", 48); + OPM_LogWLn(); } i += 1; } @@ -358,39 +358,119 @@ BOOLEAN OPM_OpenPar (void) _o_result = 0; return _o_result; } else { + OPM_AddressSize = 8; + OPM_GetAlignment(&OPM_Alignment); + __MOVE("2", OPM_Model, 2); + OPM_Options = 0xa9; OPM_S = 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); - OPM_glbopt = 0xa9; while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_glbopt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } + OPM_GlobalAddressSize = OPM_AddressSize; + OPM_GlobalAlignment = OPM_Alignment; + __COPY(OPM_Model, OPM_GlobalModel, 10); + OPM_GlobalOptions = OPM_Options; _o_result = 1; return _o_result; } __RETCHK; } +static void OPM_VerboseListSizes (void) +{ + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Type Size", 15); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SHORTINT ", 12); + OPM_LogWNum(OPM_ShortintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"INTEGER ", 12); + OPM_LogWNum(OPM_IntegerSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"LONGINT ", 12); + OPM_LogWNum(OPM_LongintSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"SET ", 12); + OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"ADDRESS ", 12); + OPM_LogWNum(OPM_AddressSize, 4); + OPM_LogWLn(); + OPM_LogWLn(); + OPM_LogWStr((CHAR*)"Alignment: ", 12); + OPM_LogWNum(OPM_Alignment, 4); + OPM_LogWLn(); +} + void OPM_InitOptions (void) { CHAR s[256]; - OPM_opt = OPM_glbopt; + CHAR searchpath[1024], modules[1024]; + CHAR MODULES[1024]; + OPM_Options = OPM_GlobalOptions; + __COPY(OPM_GlobalModel, OPM_Model, 10); + OPM_Alignment = OPM_GlobalAlignment; + OPM_AddressSize = OPM_GlobalAddressSize; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); while (s[0] == '-') { - OPM_ScanOptions(s, 256, &OPM_opt); + OPM_ScanOptions(s, 256); OPM_S += 1; s[0] = 0x00; Platform_GetArg(OPM_S, (void*)s, 256); } - if (__IN(15, OPM_opt, 32)) { - OPM_glbopt |= __SETOF(10,32); - OPM_opt |= __SETOF(10,32); + if (__IN(15, OPM_Options, 32)) { + OPM_Options |= __SETOF(10,32); } - OPM_GetProperties(); + OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); + switch (OPM_Model[0]) { + case '2': + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + case 'C': + OPM_ShortintSize = 2; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + case 'V': + OPM_ShortintSize = 1; + OPM_IntegerSize = 4; + OPM_LongintSize = 8; + OPM_SetSize = 8; + break; + default: + OPM_ShortintSize = 1; + OPM_IntegerSize = 2; + OPM_LongintSize = 4; + OPM_SetSize = 4; + break; + } + OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; + if (__IN(18, OPM_Options, 32)) { + OPM_VerboseListSizes(); + } + OPM_ResourceDir[0] = 0x00; + Strings_Append((CHAR*)"/", 2, (void*)OPM_ResourceDir, 1024); + Strings_Append(OPM_Model, 10, (void*)OPM_ResourceDir, 1024); + modules[0] = 0x00; + Platform_GetEnv((CHAR*)"MODULES", 8, (void*)modules, 1024); + __MOVE(".", searchpath, 2); + Platform_GetEnv((CHAR*)"OBERON", 7, (void*)searchpath, 1024); + Strings_Append((CHAR*)";.;", 4, (void*)searchpath, 1024); + Strings_Append(modules, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)";", 2, (void*)searchpath, 1024); + Strings_Append(OPM_ResourceDir, 1024, (void*)searchpath, 1024); + Strings_Append((CHAR*)"/sym;", 6, (void*)searchpath, 1024); + Files_SetSearchPath(searchpath, 1024); } void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) @@ -474,20 +554,20 @@ static void OPM_LogErrMsg (int16 n) int16 i; CHAR buf[1024]; if (n >= 0) { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } else { - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } } @@ -560,11 +640,11 @@ static void OPM_ShowLine (int64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); - if (!__IN(16, OPM_opt, 32)) { + if (!__IN(16, OPM_Options, 32)) { vt100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); @@ -654,106 +734,6 @@ void OPM_FPrintLReal (int32 *fp, LONGREAL lr) OPM_FPrint(&*fp, h); } -static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align) -{ - __DUP(name, name__len, CHAR); - if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { - Texts_Scan(&*S, S__typ); - if ((*S).class == 3) { - *size = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - if ((*S).class == 3) { - *align = (int16)(*S).i; - Texts_Scan(&*S, S__typ); - } else { - OPM_Mark(-157, -1); - } - } else { - OPM_Mark(-157, -1); - } - __DEL(name); -} - -static int32 OPM_minusop (int32 i) -{ - int32 _o_result; - _o_result = -i; - return _o_result; -} - -static int32 OPM_power0 (int32 i, int32 j) -{ - int32 _o_result; - int32 k, p; - k = 1; - p = i; - do { - p = p * i; - k += 1; - } while (!(k == j)); - _o_result = p; - return _o_result; -} - -static void OPM_VerboseListSizes (void) -{ - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Type Size", 17); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SHORTINT ", 14); - OPM_LogWNum(OPM_ShortintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"INTEGER ", 14); - OPM_LogWNum(OPM_IntegerSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"LONGINT ", 14); - OPM_LogWNum(OPM_LongintSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"SET ", 14); - OPM_LogWNum(OPM_SetSize, 4); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"ADDRESS ", 14); - OPM_LogWNum(OPM_AddressSize, 4); - OPM_LogWLn(); - OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Alignment: ", 12); - OPM_LogWNum(OPM_Alignment, 4); - OPM_LogWLn(); -} - -int64 OPM_SignedMaximum (int32 bytecount) -{ - int64 _o_result; - int64 result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; -} - -int64 OPM_SignedMinimum (int32 bytecount) -{ - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; -} - -static void OPM_GetProperties (void) -{ - OPM_MaxReal = 3.40282346000000e+038; - OPM_MaxLReal = 1.79769296342094e+308; - OPM_MinReal = -OPM_MaxReal; - OPM_MinLReal = -OPM_MaxLReal; - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; - OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize); - if (__IN(18, OPM_opt, 32)) { - OPM_VerboseListSizes(); - } -} - void OPM_SymRCh (CHAR *ch) { Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); @@ -848,7 +828,7 @@ void OPM_SymWLReal (LONGREAL lr) void OPM_RegisterNewSym (void) { - if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) { + if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_Options, 32)) { Files_Register(OPM_newSFile); } } @@ -1047,10 +1027,10 @@ void OPM_CloseFiles (void) } if (OPM_noerr) { if (__STRCMP(OPM_modName, "SYSTEM") == 0) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { Files_Register(OPM_BFile); } - } else if (!__IN(10, OPM_opt, 32)) { + } else if (!__IN(10, OPM_Options, 32)) { OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile); Files_Register(OPM_HIFile); Files_Register(OPM_BFile); @@ -1110,22 +1090,10 @@ export void *OPM__init(void) __REGCMD("RegisterNewSym", OPM_RegisterNewSym); __REGCMD("WriteLn", OPM_WriteLn); /* BEGIN */ + OPM_MaxReal = 3.40282346000000e+038; + OPM_MaxLReal = 1.79769296342094e+308; + OPM_MinReal = -OPM_MaxReal; + OPM_MinLReal = -OPM_MaxLReal; Texts_OpenWriter(&OPM_W, Texts_Writer__typ); - OPM_MODULES[0] = 0x00; - Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024); - __MOVE(".", OPM_OBERON, 2); - Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024); - Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"", 1, (void*)OPM_OBERON, 1024); - Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); - Files_SetSearchPath(OPM_OBERON, 1024); - OPM_AddressSize = 8; - OPM_GetAlignment(&OPM_Alignment); - OPM_ShortintSize = 1; - OPM_IntegerSize = 2; - OPM_LongintSize = 4; - OPM_SetSize = 4; __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e249edd5..933ef1b5 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -6,7 +6,10 @@ #include "SYSTEM.h" -import int16 OPM_AddressSize, OPM_Alignment, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet; +import CHAR OPM_Model[10]; +import int16 OPM_AddressSize, OPM_Alignment; +import SET OPM_GlobalOptions, OPM_Options; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; @@ -14,7 +17,7 @@ import int32 OPM_curpos, OPM_errpos, OPM_breakpc; import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; -import SET OPM_opt, OPM_glbopt; +import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index f6a8dfc5..c9986e20 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3b9acd86..373d8daa 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index ee182741..f8ed61bf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1514d9eb..1f02668b 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index ad18ebdb..b0a12a18 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -1867,7 +1867,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } OPT_OutObj(OPT_topScope->right); *ext = (OPT_sfpresent && OPT_symExtended); - *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_opt, 32); + *new = (!OPT_sfpresent || OPT_symNew) || __IN(17, OPM_Options, 32); if ((((OPM_noerr && OPT_sfpresent)) && OPT_impCtxt.reffp != OPT_expCtxt.reffp)) { *new = 1; if (!OPT_extsf) { diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d4f953ba..202c8278 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 09f3d249..07fa214f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -211,7 +211,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp return _o_result; break; case 5: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { _o_result = 10; return _o_result; } else { @@ -397,7 +397,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPM_WriteInt(__ASHL(newtype->size, 3)); OPM_Write(')'); } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_opt, 32))) { + if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -412,7 +412,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) OPV_Entier(n, 9); } } else if (to == 3) { - if (__IN(2, OPM_opt, 32)) { + if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); if (OPV_SideEffects(n)) { OPM_Write('F'); @@ -453,7 +453,7 @@ static void OPV_TypeOf (OPT_Node n) static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) { - if (!__IN(0, OPM_opt, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { + if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); } else { if (OPV_SideEffects(n->right)) { @@ -575,7 +575,7 @@ static void OPV_design (OPT_Node n, int16 prec) case 5: typ = n->typ; obj = n->left->obj; - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); if ((int16)obj->mnolev != OPM_level) { @@ -614,7 +614,7 @@ static void OPV_design (OPT_Node n, int16 prec) } break; case 6: - if (__IN(3, OPM_opt, 32)) { + if (__IN(3, OPM_Options, 32)) { if (n->left->class == 1) { OPM_WriteString((CHAR*)"__GUARDEQR(", 12); OPC_CompleteIdent(n->left->obj); @@ -1442,7 +1442,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) case 20: if (n->subcl != 32) { OPV_IfStat(n, 0, outerProc); - } else if (__IN(7, OPM_opt, 32)) { + } else if (__IN(7, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__ASSERT(", 10); OPV_expr(n->left->left->left, -1); OPM_WriteString((CHAR*)", ", 3); @@ -1508,7 +1508,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) break; case 26: if (OPM_level == 0) { - if (__IN(10, OPM_opt, 32)) { + if (__IN(10, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__FINI", 7); } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); @@ -1553,7 +1553,7 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) void OPV_Module (OPT_Node prog) { - if (!__IN(10, OPM_opt, 32)) { + if (!__IN(10, OPM_Options, 32)) { OPC_GenHdr(prog->right); OPC_GenHdrIncludes(); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0a9135f5..a44fb5b5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c0accb85..95dd629a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -67,6 +67,7 @@ export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); export void Platform_Init (int16 argc, int64 argvadr); +export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); @@ -104,6 +105,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ECONNABORTED() WSAECONNABORTED #define Platform_ECONNREFUSED() WSAECONNREFUSED #define Platform_EHOSTUNREACH() WSAEHOSTUNREACH +#define Platform_EINTR() WSAEINTR #define Platform_ENETUNREACH() WSAENETUNREACH #define Platform_ERRORACCESSDENIED() ERROR_ACCESS_DENIED #define Platform_ERRORFILENOTFOUND() ERROR_FILE_NOT_FOUND @@ -230,6 +232,13 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } +BOOLEAN Platform_Interrupted (int16 e) +{ + BOOLEAN _o_result; + _o_result = e == Platform_EINTR(); + return _o_result; +} + int64 Platform_OSAllocate (int64 size) { int64 _o_result; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index dcdb5e82..b99b4747 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -51,6 +51,7 @@ import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, addres import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); import void Platform_Init (int16 argc, int64 argvadr); +import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e75d35ff..57e22100 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 8a42b39b..f3404dda 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 9f9562db..bcf3cb9b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index da213d81..9418692a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 2590cb27..a71cf72a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7800b252..47f1e428 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 34e6fae3..ba890a17 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index ce275b8c..d8124792 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fd7974da..76fdc084 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -12,10 +12,11 @@ #include "Strings.h" -static CHAR extTools_compilationOptions[1023], extTools_CFLAGS[1023]; +static CHAR extTools_CFLAGS[1023]; export void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len); +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len); export void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN statically, CHAR *additionalopts, LONGINT additionalopts__len); static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len); @@ -25,7 +26,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN int16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); - if (__IN(18, OPM_opt, 32)) { + if (__IN(18, OPM_Options, 32)) { Console_String(title, title__len); Console_String(cmd, cmd__len); Console_Ln(); @@ -60,12 +61,22 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DEL(cmd); } +static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) +{ + __COPY("gcc -g -O1", s, s__len); + Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); + Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); + Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); + Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); + Strings_Append(extTools_CFLAGS, 1023, (void*)s, s__len); + Strings_Append((CHAR*)" ", 2, (void*)s, s__len); +} + void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len) { CHAR cmd[1023]; __DUP(moduleName, moduleName__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023); @@ -77,9 +88,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati { CHAR cmd[1023]; __DUP(additionalopts, additionalopts__len, CHAR); - __MOVE("gcc -g -O1", cmd, 11); - Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023); - Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023); + extTools_InitialiseCompilerCommand((void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); @@ -92,6 +101,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } @@ -107,11 +117,5 @@ export void *extTools__init(void) __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); /* BEGIN */ - Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"", 1, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023); - Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023); - Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023); - Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023); __ENDMOD; } diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index f87adfac..bb5be954 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index ca56f466..c44586d2 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index f5b8588f..c9a01a7c 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index 893e59bc..df72a78b 100644 --- a/makefile +++ b/makefile @@ -190,29 +190,29 @@ browsercmd: configuration # library: build all directories under src/library library: configuration - @make -f src/tools/make/oberon.mk -s library + @make -f src/tools/make/oberon.mk -s library MODEL=2 # Individual library components v4: configuration - @make -f src/tools/make/oberon.mk -s v4 + @make -f src/tools/make/oberon.mk -s v4 MODEL=2 ooc2: configuration - @make -f src/tools/make/oberon.mk -s ooc2 + @make -f src/tools/make/oberon.mk -s ooc2 MODEL=2 ooc: configuration - @make -f src/tools/make/oberon.mk -s ooc + @make -f src/tools/make/oberon.mk -s ooc MODEL=2 ulm: configuration - @make -f src/tools/make/oberon.mk -s ulm + @make -f src/tools/make/oberon.mk -s ulm MODEL=2 pow32: configuration - @make -f src/tools/make/oberon.mk -s pow32 + @make -f src/tools/make/oberon.mk -s pow32 MODEL=2 misc: configuration - @make -f src/tools/make/oberon.mk -s misc + @make -f src/tools/make/oberon.mk -s misc MODEL=2 s3: configuration - @make -f src/tools/make/oberon.mk -s s3 + @make -f src/tools/make/oberon.mk -s s3 MODEL=2 @@ -247,8 +247,8 @@ planned-binary-change: # built then run 'make revertbootstrap' first. bootstrap: bootstrapconfiguration @make -f src/tools/make/oberon.mk -s clean - @make -f src/tools/make/oberon.mk -s translate - @make -f src/tools/make/oberon.mk -s assemble + @make -f src/tools/make/oberon.mk -s translate MODEL=2 + @make -f src/tools/make/oberon.mk -s assemble MODEL=2 rm -rf bootstrap/* make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=4 PLATFORM=unix BUILDDIR=bootstrap/unix-44 && rm bootstrap/unix-44/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-48 && rm bootstrap/unix-48/*.sym diff --git a/src/library/ooc/oocLRealMath.Mod b/src/library/ooc/oocLRealMath.Mod index 3da0cf96..552f8c20 100644 --- a/src/library/ooc/oocLRealMath.Mod +++ b/src/library/ooc/oocLRealMath.Mod @@ -1,42 +1,42 @@ MODULE oocLRealMath; (* - LRealMath - Target independent mathematical functions for LONGREAL + LRealMath - Target independent mathematical functions for LONGREAL (IEEE double-precision) numbers. - + Numerical approximations are taken from "Software Manual for the Elementary Functions" by Cody & Waite and "Computer Approximations" - by Hart et al. - + by Hart et al. + Copyright (C) 1996-1998 Michael Griebling - + This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as + it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *) -IMPORT l := oocLowLReal, m := oocRealMath; - +IMPORT l := oocLowLReal, m := oocRealMath, SYSTEM; + CONST pi* = 3.1415926535897932384626433832795028841972D0; exp1* = 2.7182818284590452353602874713526624977572D0; - ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) - + ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) + (* internally-used constants *) huge=l.large; (* largest number this package accepts *) - miny=l.small; (* smallest number this package accepts *) + miny=l.small; (* smallest number this package accepts *) sqrtHalf=0.70710678118654752440D0; Limit=1.0536712D-8; (* 2**(-MantBits/2) *) eps=5.5511151D-17; (* 2**(-MantBits-1) *) @@ -44,30 +44,30 @@ CONST piByTwo=1.57079632679489661923D0; lnv=0.6931610107421875D0; (* should be exact *) vbytwo=0.13830277879601902638D-4; (* used in sinh/cosh *) - ln2Inv=1.44269504088896340735992468100189213D0; - + ln2Inv=1.44269504088896340735992468100189213D0; + (* error/exception codes *) - NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; - IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; - IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; + NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; + IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; + IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; IllegalHypInvTrig*=m.IllegalHypInvTrig; LossOfAccuracy*=m.LossOfAccuracy; - + VAR a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) - a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) - em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) LnInfinity: LONGREAL; (* natural log of infinity *) LnSmall: LONGREAL; (* natural log of very small number *) SqrtInfinity: LONGREAL; (* square root of infinity *) TanhMax: LONGREAL; (* maximum Tanh value *) t: LONGREAL; (* internal variables *) - + (* internally used support routines *) PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; CONST ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) - c1=3.1416015625D0; + c1=3.1416015625D0; c2=-8.908910206761537356617D-6; r1=-0.16666666666666665052D+0; r2= 0.83333333333331650314D-2; @@ -77,24 +77,24 @@ PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; r6= 0.16058936490371589114D-9; r7=-0.76429178068910467734D-12; r8= 0.27204790957888846175D-14; - VAR - n: LONGINT; xn, f, x1, g: LONGREAL; + VAR + n: LONGINT; xn, f, x1, g: LONGREAL; BEGIN IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; - + (* determine the reduced number *) n:=ENTIER(y*piInv+HALF); xn:=n; IF ODD(n) THEN sign:=-sign END; x:=ABS(x); IF x#y THEN xn:=xn-HALF END; - + (* fractional part of reduced number *) x1:=ENTIER(x); f:=((x1-xn*c1)+(x-x1))-xn*c2; - + (* Pre: |f| <= pi/2 *) IF ABS(f)= 0 *) - CONST + CONST P0=0.41731; P1=0.59016; - VAR - xMant, yEst, z: LONGREAL; xExp: INTEGER; + VAR + xMant, yEst, z: LONGREAL; xExp: INTEGER; BEGIN (* optimize zeros and check for illegal negative roots *) IF x=ZERO THEN RETURN ZERO END; IF x=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) END; xn:=n; g:=(x-xn*c1)-xn*c2; - + (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; RETURN l.scale(HALF+p/(q-p), n+1) END exp; - + PROCEDURE ln*(x: LONGREAL): LONGREAL; (* Returns the natural logarithm of x for x > 0 *) CONST @@ -175,27 +175,27 @@ PROCEDURE ln*(x: LONGREAL): LONGREAL; BEGIN (* ensure illegal inputs are trapped and handled *) IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; - + (* reduce the range of the input *) f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) END; - + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); - + (* scale the output *) - xn:=n; + xn:=n; RETURN (xn*c2+r)+xn*c1 END ln; - + (* The angle in all trigonometric functions is measured in radians *) - + PROCEDURE sin* (x: LONGREAL): LONGREAL; BEGIN - IF x 0 *) - CONST - P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; - P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; - K=0.44269504088896340736D0; - Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; + CONST + P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; + P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; + K=0.44269504088896340736D0; + Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; Q7=0.14928852680595608186D-4; OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) - VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; + VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END END; - + (* extract the exponent of base to m and clear exponent of base in g *) g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; - + (* determine p table offset with an unrolled binary search *) p:=1; IF g<=a1[9] THEN p:=9 END; IF g<=a1[p+4] THEN INC(p, 4) END; IF g<=a1[p+2] THEN INC(p, 2) END; - + (* compute scaled z so that |z| <= 0.044 *) z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; - + v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + (* generate w with extra precision calculations *) y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; @@ -283,14 +283,14 @@ BEGIN IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; - z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; + z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; RETURN l.scale(z, SHORT(mp)) END power; - + PROCEDURE round*(x: LONGREAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN @@ -298,7 +298,7 @@ BEGIN ELSE RETURN ENTIER(x+HALF) END END round; - + PROCEDURE IsRMathException*(): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. @@ -307,15 +307,15 @@ BEGIN RETURN FALSE END IsRMathException; - -(* + +(* Following routines are provided as extensions to the ISO standard. They are either used as the basis of other functions or provide - useful functions which are not part of the ISO standard. + useful functions which are not part of the ISO standard. *) PROCEDURE log* (x, base: LONGREAL): LONGREAL; -(* log(x,base) is the logarithm of x base b. All positive arguments are +(* log(x,base) is the logarithm of x base b. All positive arguments are allowed but base > 0 and base # 1. *) BEGIN (* log(x, base) = log2(x) / log2(base) *) @@ -324,9 +324,9 @@ BEGIN END END log; -PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; +PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; (* ipower(x, base) returns the x to the integer power base where base*Log2(x) < Log2(Max) *) - VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; + VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; BEGIN @@ -336,17 +336,17 @@ PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; BEGIN (* handle all possible error conditions *) IF base=0 THEN RETURN ONE (* x**0 = 1 *) - ELSIF ABS(x)0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) ELSIF Exp<-y THEN RETURN ZERO - END; - - (* compute x**base using an optimised algorithm from Knuth, slightly + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; LOOP @@ -355,19 +355,19 @@ BEGIN x:=x*x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END -END ipower; +END ipower; PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) -END sincos; +END sincos; PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; -(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the denominator xd is zero, then the numerator xn must not be zero. All arguments are legal except xn = xd = 0. *) - CONST + CONST P0=0.216062307897242551884D+3; P1=0.3226620700132512059245D+3; P2=0.13270239816397674701D+3; P3=0.1288838303415727934D+2; Q0=0.2160623078972426128957D+3; Q1=0.3946828393122829592162D+3; @@ -387,15 +387,15 @@ BEGIN IF ABS(xn)>ABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 ELSE z:=ABS(xn/xd); Quadrant:=0 END; - + (* further reduce range to within 0 to 2-sqrt(3) *) IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; - + (* approximation from "Computer Approximations" table ARCTN 5075 *) IF ABS(z)1 THEN atan:=-atan END; CASE Quadrant OF @@ -405,20 +405,20 @@ BEGIN | ELSE (* angle is correct *) END END; - + (* map negative xds into the correct quadrant *) IF xdLnInfinity THEN (* handle exp overflows *) y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); IF x>ZERO THEN RETURN huge ELSE RETURN -huge END ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) END ELSE f:=exp(y); f:=(f-ONE/f)*HALF END; - - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END END sinh; - + PROCEDURE cosh* (x: LONGREAL): LONGREAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large - that exp(|x|) overflows. *) + that exp(|x|) overflows. *) VAR y, f: LONGREAL; BEGIN y:=ABS(x); IF y>LnInfinity THEN (* handle exp overflows *) y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); IF x>ZERO THEN RETURN huge ELSE RETURN -huge END ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) END ELSE f:=exp(y); RETURN (f+ONE/f)*HALF END END cosh; - + PROCEDURE tanh* (x: LONGREAL): LONGREAL; (* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) - CONST - P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; + CONST + P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; - ln3over2=0.54930614433405484570D0; + ln3over2=0.54930614433405484570D0; BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) VAR f, t: LONGREAL; BEGIN f:=ABS(x); @@ -487,7 +487,7 @@ BEGIN END arcsinh; PROCEDURE arccosh* (x: LONGREAL): LONGREAL; -(* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than +(* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN IF x*) - a1[ 1]:=ONE; - a1[ 2]:=ToLONGREAL(3FEEA4AFH, 0A2A490DAH); - a1[ 3]:=ToLONGREAL(3FED5818H, 0DCFBA487H); - a1[ 4]:=ToLONGREAL(3FEC199BH, 0DD85529CH); - a1[ 5]:=ToLONGREAL(3FEAE89FH, 0995AD3ADH); - a1[ 6]:=ToLONGREAL(3FE9C491H, 082A3F090H); - a1[ 7]:=ToLONGREAL(3FE8ACE5H, 0422AA0DBH); - a1[ 8]:=ToLONGREAL(3FE7A114H, 073EB0186H); - a1[ 9]:=ToLONGREAL(3FE6A09EH, 0667F3BCCH); - a1[10]:=ToLONGREAL(3FE5AB07H, 0DD485429H); - a1[11]:=ToLONGREAL(3FE4BFDAH, 0D5362A27H); - a1[12]:=ToLONGREAL(3FE3DEA6H, 04C123422H); - a1[13]:=ToLONGREAL(3FE306FEH, 00A31B715H); - a1[14]:=ToLONGREAL(3FE2387AH, 06E756238H); - a1[15]:=ToLONGREAL(3FE172B8H, 03C7D517AH); - a1[16]:=ToLONGREAL(3FE0B558H, 06CF9890FH); - a1[17]:=HALF; + a1[ 1] := ONE; + a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); (* ToLONGREAL(3FEEA4AFH, 0A2A490DAH); *) + a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); (* ToLONGREAL(3FED5818H, 0DCFBA487H); *) + a1[ 4] := ToLONGREAL(3FEC199BDD85529CH); (* ToLONGREAL(3FEC199BH, 0DD85529CH); *) + a1[ 5] := ToLONGREAL(3FEAE89F995AD3ADH); (* ToLONGREAL(3FEAE89FH, 0995AD3ADH); *) + a1[ 6] := ToLONGREAL(3FE9C49182A3F090H); (* ToLONGREAL(3FE9C491H, 082A3F090H); *) + a1[ 7] := ToLONGREAL(3FE8ACE5422AA0DBH); (* ToLONGREAL(3FE8ACE5H, 0422AA0DBH); *) + a1[ 8] := ToLONGREAL(3FE7A11473EB0186H); (* ToLONGREAL(3FE7A114H, 073EB0186H); *) + a1[ 9] := ToLONGREAL(3FE6A09E667F3BCCH); (* ToLONGREAL(3FE6A09EH, 0667F3BCCH); *) + a1[10] := ToLONGREAL(3FE5AB07DD485429H); (* ToLONGREAL(3FE5AB07H, 0DD485429H); *) + a1[11] := ToLONGREAL(3FE4BFDAD5362A27H); (* ToLONGREAL(3FE4BFDAH, 0D5362A27H); *) + a1[12] := ToLONGREAL(3FE3DEA64C123422H); (* ToLONGREAL(3FE3DEA6H, 04C123422H); *) + a1[13] := ToLONGREAL(3FE306FE0A31B715H); (* ToLONGREAL(3FE306FEH, 00A31B715H); *) + a1[14] := ToLONGREAL(3FE2387A6E756238H); (* ToLONGREAL(3FE2387AH, 06E756238H); *) + a1[15] := ToLONGREAL(3FE172B83C7D517AH); (* ToLONGREAL(3FE172B8H, 03C7D517AH); *) + a1[16] := ToLONGREAL(3FE0B5586CF9890FH); (* ToLONGREAL(3FE0B558H, 06CF9890FH); *) + a1[17] := HALF; (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) - a2[1]:=ToLONGREAL(3C90B1EEH, 074320000H); - a2[2]:=ToLONGREAL(3C711065H, 089500000H); - a2[3]:=ToLONGREAL(3C6C7C46H, 0B0700000H); - a2[4]:=ToLONGREAL(3C9AFAA2H, 0047F0000H); - a2[5]:=ToLONGREAL(3C86324CH, 005460000H); - a2[6]:=ToLONGREAL(3C7ADA09H, 011F00000H); - a2[7]:=ToLONGREAL(3C89B07EH, 0B6C80000H); - a2[8]:=ToLONGREAL(3C88A62EH, 04ADC0000H); - + a2[1] := ToLONGREAL(3C90B1EE74320000H); (* ToLONGREAL(3C90B1EEH, 074320000H); *) + a2[2] := ToLONGREAL(3C71106589500000H); (* ToLONGREAL(3C711065H, 089500000H); *) + a2[3] := ToLONGREAL(3C6C7C46B0700000H); (* ToLONGREAL(3C6C7C46H, 0B0700000H); *) + a2[4] := ToLONGREAL(3C9AFAA2047F0000H); (* ToLONGREAL(3C9AFAA2H, 0047F0000H); *) + a2[5] := ToLONGREAL(3C86324C05460000H); (* ToLONGREAL(3C86324CH, 005460000H); *) + a2[6] := ToLONGREAL(3C7ADA0911F00000H); (* ToLONGREAL(3C7ADA09H, 011F00000H); *) + a2[7] := ToLONGREAL(3C89B07EB6C80000H); (* ToLONGREAL(3C89B07EH, 0B6C80000H); *) + a2[8] := ToLONGREAL(3C88A62E4ADC0000H); (* ToLONGREAL(3C88A62EH, 04ADC0000H); *) + (* reenable compiler warnings *) (*<* POP *>*) END oocLRealMath. diff --git a/src/library/ooc/oocLowReal.Mod b/src/library/ooc/oocLowReal.Mod index 83ae8e32..7319794f 100644 --- a/src/library/ooc/oocLowReal.Mod +++ b/src/library/ooc/oocLowReal.Mod @@ -216,7 +216,7 @@ BEGIN IF x 0) DO + IF Streams.ReadByte(in1, b1) & Streams.ReadByte(in2, b2) THEN + res := XorByte(b1, b2); + IF ~Streams.WriteByte(out, res) THEN + RETURN FALSE + END; ELSE - wholeStream := FALSE; + RETURN wholeStream END; - WHILE wholeStream OR (length > 0) DO - IF Streams.ReadByte(in1, b1) & Streams.ReadByte(in2, b2) THEN - res := XorByte(b1, b2); - IF ~Streams.WriteByte(out, res) THEN - RETURN FALSE - END; - ELSE - RETURN wholeStream - END; - DEC(length); - END; - RETURN TRUE - END XorStream; + DEC(length); + END; + RETURN TRUE + END XorStream; END ulmCipherOps. diff --git a/src/library/ulm/ulmCiphers.Mod b/src/library/ulm/ulmCiphers.Mod index bc881c83..95d66aa8 100644 --- a/src/library/ulm/ulmCiphers.Mod +++ b/src/library/ulm/ulmCiphers.Mod @@ -29,15 +29,15 @@ (* abstraction for the use of ciphers and cryptographic methods *) MODULE ulmCiphers; -IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices, +IMPORT Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, PersistentDisciplines := ulmPersistentDisciplines, Services := ulmServices, Streams := ulmStreams, Write := ulmWrite; TYPE Cipher* = POINTER TO CipherRec; -TYPE - CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +TYPE + CryptProc* = PROCEDURE (in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; TYPE Interface* = POINTER TO InterfaceRec; @@ -48,7 +48,7 @@ TYPE END; TYPE - CipherRec* = RECORD + CipherRec* = RECORD (PersistentDisciplines.ObjectRec) (* private *) if : Interface @@ -64,31 +64,31 @@ BEGIN key.if := if; END Init; -PROCEDURE Encrypt*(in: Streams.Stream; key: Cipher; - out: Streams.Stream) : BOOLEAN; +PROCEDURE Encrypt*(in: Streams.Stream; key: Cipher; + out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.encrypt(in, key, -1, out); END Encrypt; -PROCEDURE Decrypt*(in: Streams.Stream; key: Cipher; - out: Streams.Stream) : BOOLEAN; +PROCEDURE Decrypt*(in: Streams.Stream; key: Cipher; + out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.decrypt(in, key, -1, out); END Decrypt; -PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +PROCEDURE EncryptPart*(in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.encrypt(in, key, length, out); END EncryptPart; -PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher; - length: INTEGER; out: Streams.Stream) : BOOLEAN; +PROCEDURE DecryptPart*(in: Streams.Stream; key: Cipher; + length: INTEGER; out: Streams.Stream) : BOOLEAN; BEGIN RETURN key.if.decrypt(in, key, length, out); END DecryptPart; BEGIN - PersistentObjects.RegisterType(cipherType, "Ciphers.Cipher", + PersistentObjects.RegisterType(cipherType, "Ciphers.Cipher", "PersistentDisciplines.Object", NIL); END ulmCiphers. diff --git a/src/library/ulm/ulmDisciplines.Mod b/src/library/ulm/ulmDisciplines.Mod index 913f7c03..d96617a6 100644 --- a/src/library/ulm/ulmDisciplines.Mod +++ b/src/library/ulm/ulmDisciplines.Mod @@ -1,140 +1,140 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Disciplines.om,v 1.1 1994/02/22 20:07:03 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Disciplines.om,v $ - Revision 1.1 1994/02/22 20:07:03 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Disciplines.om,v 1.1 1994/02/22 20:07:03 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Disciplines.om,v $ + Revision 1.1 1994/02/22 20:07:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 5/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 5/91 + ---------------------------------------------------------------------------- *) MODULE ulmDisciplines; - (* Disciplines allows to attach additional data structures to - abstract datatypes like Streams; - these added data structures permit to parametrize operations - which are provided by other modules (e.g. Read or Write for Streams) - *) + (* Disciplines allows to attach additional data structures to + abstract datatypes like Streams; + these added data structures permit to parametrize operations + which are provided by other modules (e.g. Read or Write for Streams) + *) - IMPORT Objects := ulmObjects; + IMPORT Objects := ulmObjects; - TYPE - Identifier* = LONGINT; + TYPE + Identifier* = LONGINT; - Discipline* = POINTER TO DisciplineRec; - DisciplineRec* = - RECORD - (Objects.ObjectRec) - id*: Identifier; (* should be unique for all types of disciplines *) - END; - - DisciplineList = POINTER TO DisciplineListRec; - DisciplineListRec = - RECORD - discipline: Discipline; - id: Identifier; (* copied from discipline.id *) - next: DisciplineList; - END; - - Object* = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (Objects.ObjectRec) - (* private part *) - list: DisciplineList; (* set of disciplines *) - END; - - VAR - unique: Identifier; - - PROCEDURE Unique*() : Identifier; - (* returns a unique identifier; - this procedure should be called during initialization by - all modules defining a discipline type - *) - BEGIN - INC(unique); - RETURN unique - END Unique; - - PROCEDURE Remove*(object: Object; id: Identifier); - (* remove the discipline with the given id from object, if it exists *) - VAR - prev, dl: DisciplineList; - BEGIN - prev := NIL; - dl := object.list; - WHILE (dl # NIL) & (dl.id # id) DO - prev := dl; dl := dl.next; + Discipline* = POINTER TO DisciplineRec; + DisciplineRec* = + RECORD + (Objects.ObjectRec) + id*: Identifier; (* should be unique for all types of disciplines *) END; - IF dl # NIL THEN - IF prev = NIL THEN - object.list := dl.next; - ELSE - prev.next := dl.next; - END; - END; - END Remove; - PROCEDURE Add*(object: Object; discipline: Discipline); - (* adds a new discipline to the given object; - if already a discipline with the same identifier exist - it is deleted first - *) - VAR - dl: DisciplineList; - BEGIN - dl := object.list; - WHILE (dl # NIL) & (dl.id # discipline.id) DO - dl := dl.next; + DisciplineList = POINTER TO DisciplineListRec; + DisciplineListRec = + RECORD + discipline: Discipline; + id: Identifier; (* copied from discipline.id *) + next: DisciplineList; END; - IF dl = NIL THEN - NEW(dl); - dl.id := discipline.id; - dl.next := object.list; - object.list := dl; - END; - dl.discipline := discipline; - END Add; - PROCEDURE Seek*(object: Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - (* returns TRUE if a discipline with the given id is found *) - VAR - dl: DisciplineList; - BEGIN - dl := object.list; - WHILE (dl # NIL) & (dl.id # id) DO - dl := dl.next; + Object* = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (Objects.ObjectRec) + (* private part *) + list: DisciplineList; (* set of disciplines *) END; - IF dl # NIL THEN - discipline := dl.discipline; + + VAR + unique: Identifier; + + PROCEDURE Unique*() : Identifier; + (* returns a unique identifier; + this procedure should be called during initialization by + all modules defining a discipline type + *) + BEGIN + INC(unique); + RETURN unique + END Unique; + + PROCEDURE Remove*(object: Object; id: Identifier); + (* remove the discipline with the given id from object, if it exists *) + VAR + prev, dl: DisciplineList; + BEGIN + prev := NIL; + dl := object.list; + WHILE (dl # NIL) & (dl.id # id) DO + prev := dl; dl := dl.next; + END; + IF dl # NIL THEN + IF prev = NIL THEN + object.list := dl.next; ELSE - discipline := NIL; + prev.next := dl.next; END; - RETURN discipline # NIL - END Seek; + END; + END Remove; + + PROCEDURE Add*(object: Object; discipline: Discipline); + (* adds a new discipline to the given object; + if already a discipline with the same identifier exist + it is deleted first + *) + VAR + dl: DisciplineList; + BEGIN + dl := object.list; + WHILE (dl # NIL) & (dl.id # discipline.id) DO + dl := dl.next; + END; + IF dl = NIL THEN + NEW(dl); + dl.id := discipline.id; + dl.next := object.list; + object.list := dl; + END; + dl.discipline := discipline; + END Add; + + PROCEDURE Seek*(object: Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + (* returns TRUE if a discipline with the given id is found *) + VAR + dl: DisciplineList; + BEGIN + dl := object.list; + WHILE (dl # NIL) & (dl.id # id) DO + dl := dl.next; + END; + IF dl # NIL THEN + discipline := dl.discipline; + ELSE + discipline := NIL; + END; + RETURN discipline # NIL + END Seek; BEGIN - unique := 0; + unique := 0; END ulmDisciplines. diff --git a/src/library/ulm/ulmErrors.Mod b/src/library/ulm/ulmErrors.Mod index edb1cb6f..7336bca2 100644 --- a/src/library/ulm/ulmErrors.Mod +++ b/src/library/ulm/ulmErrors.Mod @@ -1,158 +1,161 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Errors.om,v 1.2 1994/07/18 14:16:33 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Errors.om,v $ - Revision 1.2 1994/07/18 14:16:33 borchert - unused variables of Write (ch & index) removed + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Errors.om,v 1.2 1994/07/18 14:16:33 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Errors.om,v $ + Revision 1.2 1994/07/18 14:16:33 borchert + unused variables of Write (ch & index) removed - Revision 1.1 1994/02/22 20:07:15 borchert - Initial revision + Revision 1.1 1994/02/22 20:07:15 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 11/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 11/91 + ---------------------------------------------------------------------------- *) MODULE ulmErrors; - (* translate events to errors *) + (* translate events to errors *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, RelatedEvents := ulmRelatedEvents, Streams := ulmStreams, Strings := ulmStrings, + SYS := SYSTEM; - CONST - (* Kind = (debug, message, warning, error, fatal, bug) *) - debug* = 0; - message* = 1; - warning* = 2; - error* = 3; - fatal* = 4; - bug* = 5; - nkinds* = 6; - TYPE - Kind* = SHORTINT; (* debug..bug *) - VAR - kindText*: ARRAY nkinds OF ARRAY 12 OF CHAR; + CONST + (* Kind = (debug, message, warning, error, fatal, bug) *) + debug* = 0; + message* = 1; + warning* = 2; + error* = 3; + fatal* = 4; + bug* = 5; + nkinds* = 6; + TYPE + Kind* = SHORTINT; (* debug..bug *) + VAR + kindText*: ARRAY nkinds OF ARRAY 12 OF CHAR; - TYPE - Handler* = PROCEDURE (event: Events.Event; kind: Kind); - HandlerSet* = POINTER TO HandlerSetRec; - HandlerSetRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - handlerSet: SET; (* set of installed handlers *) - handler: ARRAY nkinds OF Handler; - END; - - (* ========== write discipline ========================================= *) - TYPE - WriteProcedure* = PROCEDURE (s: Streams.Stream; event: Events.Event); - WriteDiscipline = POINTER TO WriteDisciplineRec; - WriteDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - write: WriteProcedure; - END; - VAR - writeDiscId: Disciplines.Identifier; - - (* ========== handler discipline ======================================= *) - TYPE - HandlerDiscipline = POINTER TO HandlerDisciplineRec; - HandlerDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - hs: HandlerSet; - kind: Kind; - END; - VAR - handlerDiscId: Disciplines.Identifier; - - VAR - null*: HandlerSet; (* empty handler set *) - - PROCEDURE CreateHandlerSet*(VAR hs: HandlerSet); - BEGIN - NEW(hs); hs.handlerSet := {}; - END CreateHandlerSet; - - PROCEDURE InstallHandler*(hs: HandlerSet; kind: Kind; handler: Handler); - BEGIN - hs.handler[kind] := handler; - INCL(hs.handlerSet, kind); - END InstallHandler; - - PROCEDURE AssignWriteProcedure*(eventType: Events.EventType; - write: WriteProcedure); - VAR - writeDiscipline: WriteDiscipline; - BEGIN - NEW(writeDiscipline); - writeDiscipline.id := writeDiscId; - writeDiscipline.write := write; - Disciplines.Add(eventType, writeDiscipline); - END AssignWriteProcedure; - - PROCEDURE Write*(s: Streams.Stream; event: Events.Event); - VAR - writeDiscipline: WriteDiscipline; - BEGIN - IF Disciplines.Seek(event.type, writeDiscId, SYS.VAL(Disciplines.Discipline, writeDiscipline)) THEN - writeDiscipline.write(s, event); - ELSE - IF ~Streams.WritePart(s, event.message, 0, - Strings.Len(event.message)) THEN - END; + TYPE + Handler* = PROCEDURE (event: Events.Event; kind: Kind); + HandlerSet* = POINTER TO HandlerSetRec; + HandlerSetRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + handlerSet: SET; (* set of installed handlers *) + handler: ARRAY nkinds OF Handler; END; - END Write; - PROCEDURE GeneralEventHandler(event: Events.Event); - VAR - disc: HandlerDiscipline; - BEGIN - IF Disciplines.Seek(event.type, handlerDiscId, SYS.VAL(Disciplines.Discipline, disc)) & - (disc.kind IN disc.hs.handlerSet) THEN - disc.hs.handler[disc.kind](event, disc.kind); + (* ========== write discipline ========================================= *) + TYPE + WriteProcedure* = PROCEDURE (s: Streams.Stream; event: Events.Event); + WriteDiscipline = POINTER TO WriteDisciplineRec; + WriteDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + write: WriteProcedure; END; - END GeneralEventHandler; + VAR + writeDiscId: Disciplines.Identifier; - PROCEDURE CatchEvent*(hs: HandlerSet; kind: Kind; type: Events.EventType); - VAR - handlerDiscipline: HandlerDiscipline; - BEGIN - NEW(handlerDiscipline); handlerDiscipline.id := handlerDiscId; - handlerDiscipline.hs := hs; handlerDiscipline.kind := kind; - Disciplines.Add(type, handlerDiscipline); - Events.Handler(type, GeneralEventHandler); - END CatchEvent; + (* ========== handler discipline ======================================= *) + TYPE + HandlerDiscipline = POINTER TO HandlerDisciplineRec; + HandlerDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + hs: HandlerSet; + kind: Kind; + END; + VAR + handlerDiscId: Disciplines.Identifier; + + VAR + null*: HandlerSet; (* empty handler set *) + + PROCEDURE CreateHandlerSet*(VAR hs: HandlerSet); + BEGIN + NEW(hs); hs.handlerSet := {}; + END CreateHandlerSet; + + PROCEDURE InstallHandler*(hs: HandlerSet; kind: Kind; handler: Handler); + BEGIN + hs.handler[kind] := handler; + INCL(hs.handlerSet, kind); + END InstallHandler; + + PROCEDURE AssignWriteProcedure*(eventType: Events.EventType; + write: WriteProcedure); + VAR + writeDiscipline: WriteDiscipline; + BEGIN + NEW(writeDiscipline); + writeDiscipline.id := writeDiscId; + writeDiscipline.write := write; + Disciplines.Add(eventType, writeDiscipline); + END AssignWriteProcedure; + + PROCEDURE Write*(s: Streams.Stream; event: Events.Event); + VAR + writeDiscipline: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(event.type, writeDiscId, writeDiscipline) THEN + writeDiscipline(WriteDiscipline).write(s, event); + ELSE + IF ~Streams.WritePart(s, event.message, 0, + Strings.Len(event.message)) THEN + END; + END; + END Write; + + PROCEDURE GeneralEventHandler(event: Events.Event); + VAR + disc: Disciplines.Discipline; + hdisc: HandlerDiscipline; + BEGIN + IF Disciplines.Seek(event.type, handlerDiscId, disc) THEN + hdisc := disc(HandlerDiscipline); + IF hdisc.kind IN hdisc.hs.handlerSet THEN + hdisc.hs.handler[hdisc.kind](event, hdisc.kind) + END + END; + END GeneralEventHandler; + + PROCEDURE CatchEvent*(hs: HandlerSet; kind: Kind; type: Events.EventType); + VAR + handlerDiscipline: HandlerDiscipline; + BEGIN + NEW(handlerDiscipline); handlerDiscipline.id := handlerDiscId; + handlerDiscipline.hs := hs; handlerDiscipline.kind := kind; + Disciplines.Add(type, handlerDiscipline); + Events.Handler(type, GeneralEventHandler); + END CatchEvent; BEGIN - writeDiscId := Disciplines.Unique(); - handlerDiscId := Disciplines.Unique(); - CreateHandlerSet(null); - kindText[debug] := "debug"; - kindText[message] := "message"; - kindText[warning] := "warning"; - kindText[error] := "error"; - kindText[fatal] := "fatal"; - kindText[bug] := "bug"; + writeDiscId := Disciplines.Unique(); + handlerDiscId := Disciplines.Unique(); + CreateHandlerSet(null); + kindText[debug] := "debug"; + kindText[message] := "message"; + kindText[warning] := "warning"; + kindText[error] := "error"; + kindText[fatal] := "fatal"; + kindText[bug] := "bug"; END ulmErrors. diff --git a/src/library/ulm/ulmEvents.Mod b/src/library/ulm/ulmEvents.Mod index 6016f8b0..52695762 100644 --- a/src/library/ulm/ulmEvents.Mod +++ b/src/library/ulm/ulmEvents.Mod @@ -46,88 +46,88 @@ MODULE ulmEvents; CONST (* possibilities on receipt of an event: *) - default* = 0; (* causes abortion *) - ignore* = 1; (* ignore event *) - funcs* = 2; (* call associated event handlers *) + default* = 0; (* causes abortion *) + ignore* = 1; (* ignore event *) + funcs* = 2; (* call associated event handlers *) TYPE - Reaction* = INTEGER; (* one of default, ignore, or funcs *) + Reaction* = INTEGER; (* one of default, ignore, or funcs *) Message* = ARRAY 80 OF CHAR; Event* = POINTER TO EventRec; EventRec* = - RECORD - (Objects.ObjectRec) - type*: EventType; - message*: Message; - (* private part *) - next: Event; (* queue *) - END; + RECORD + (Objects.ObjectRec) + type*: EventType; + message*: Message; + (* private part *) + next: Event; (* queue *) + END; EventHandler = PROCEDURE (event: Event); (* event managers are needed if there is any action necessary - on changing the kind of reaction + on changing the kind of reaction *) EventManager = PROCEDURE (type: EventType; reaction: Reaction); Priority = INTEGER; (* must be non-negative *) (* every event with reaction `funcs' has a handler list; - the list is in calling order which is reverse to - the order of `Handler'-calls + the list is in calling order which is reverse to + the order of `Handler'-calls *) HandlerList = POINTER TO HandlerRec; HandlerRec* = - RECORD - (Objects.ObjectRec) - handler*: EventHandler; - next*: HandlerList; - END; + RECORD + (Objects.ObjectRec) + handler*: EventHandler; + next*: HandlerList; + END; SaveList = POINTER TO SaveRec; SaveRec = - RECORD - reaction: Reaction; - handlers: HandlerList; - next: SaveList; - END; + RECORD + reaction: Reaction; + handlers: HandlerList; + next: SaveList; + END; EventTypeRec* = - RECORD - (Services.ObjectRec) - (* private components *) - handlers: HandlerList; - priority: Priority; - reaction: Reaction; - manager: EventManager; - savelist: SaveList; - END; + RECORD + (Services.ObjectRec) + (* private components *) + handlers: HandlerList; + priority: Priority; + reaction: Reaction; + manager: EventManager; + savelist: SaveList; + END; Queue = POINTER TO QueueRec; QueueRec = - RECORD - priority: INTEGER; (* queue for this priority *) - head, tail: Event; - next: Queue; (* queue with lower priority *) - END; + RECORD + priority: INTEGER; (* queue for this priority *) + head, tail: Event; + next: Queue; (* queue with lower priority *) + END; VAR eventTypeType: Services.Type; - + CONST - priotabsize = 256; (* size of a priority table *) - maxnestlevel = 1024; (* of Raise-calls (avoids endless recursion) *) + priotabsize = 256; (* size of a priority table *) + maxnestlevel = 1024; (* of Raise-calls (avoids endless recursion) *) TYPE (* in some cases coroutines uses local priority systems *) PrioritySystem* = POINTER TO PrioritySystemRec; PrioritySystemRec* = - RECORD - (Objects.ObjectRec) - (* private part *) - currentPriority: Priority; - priotab: ARRAY priotabsize OF Priority; - priotop: INTEGER; - overflow: INTEGER; (* of priority table *) - END; + RECORD + (Objects.ObjectRec) + (* private part *) + currentPriority: Priority; + priotab: ARRAY priotabsize OF Priority; + priotop: INTEGER; + overflow: INTEGER; (* of priority table *) + END; CONST priorityViolation* = 0; (* priority violation (EnterPriority *) @@ -139,10 +139,10 @@ MODULE ulmEvents; TYPE ErrorEvent* = POINTER TO ErrorEventRec; ErrorEventRec* = - RECORD - (EventRec) - errorcode*: SHORTINT; - END; + RECORD + (EventRec) + errorcode*: SHORTINT; + END; VAR errormsg*: ARRAY errorcodes OF Message; @@ -151,10 +151,10 @@ MODULE ulmEvents; VAR (* private part *) abort, log, queueHandler: EventHandler; - nestlevel: INTEGER; (* of Raise calls *) + nestlevel: INTEGER; (* of Raise calls *) queue: Queue; - lock: BOOLEAN; (* lock critical operations *) - psys: PrioritySystem; (* current priority system *) + lock: BOOLEAN; (* lock critical operations *) + psys: PrioritySystem; (* current priority system *) PROCEDURE ^ Define*(VAR type: EventType); PROCEDURE ^ SetPriority*(type: EventType; priority: Priority); @@ -164,13 +164,13 @@ MODULE ulmEvents; BEGIN Define(error); SetPriority(error, Priorities.liberrors); errormsg[priorityViolation] := - "priority violation (Events.EnterPriority)"; + "priority violation (Events.EnterPriority)"; errormsg[unbalancedExitPriority] := - "unbalanced call of Events.ExitPriority"; + "unbalanced call of Events.ExitPriority"; errormsg[unbalancedRestoreReaction] := - "unbalanced call of Events.RestoreReaction"; + "unbalanced call of Events.RestoreReaction"; errormsg[negPriority] := - "negative priority given to Events.SetPriority"; + "negative priority given to Events.SetPriority"; END InitErrorHandling; PROCEDURE Error(code: SHORTINT); @@ -187,7 +187,7 @@ MODULE ulmEvents; PROCEDURE Init*(type: EventType); VAR - stype: Services.Type; + stype: Services.Type; BEGIN Services.GetType(type, stype); ASSERT(stype # NIL); type.handlers := NIL; @@ -199,8 +199,8 @@ MODULE ulmEvents; PROCEDURE Define*(VAR type: EventType); (* definition of a new event; - an unique event number is returned; - the reaction on receipt of `type' is defined to be `default' + an unique event number is returned; + the reaction on receipt of `type' is defined to be `default' *) BEGIN NEW(type); @@ -218,9 +218,9 @@ MODULE ulmEvents; (* (re-)defines the priority of an event *) BEGIN IF priority <= 0 THEN - Error(negPriority); + Error(negPriority); ELSE - type.priority := priority; + type.priority := priority; END; END SetPriority; @@ -238,42 +238,42 @@ MODULE ulmEvents; PROCEDURE Handler*(type: EventType; handler: EventHandler); (* add `handler' to the list of handlers for event `type' *) VAR - newhandler: HandlerList; + newhandler: HandlerList; BEGIN NEW(newhandler); newhandler.handler := handler; newhandler.next := type.handlers; type.handlers := newhandler; IF type.reaction # funcs THEN - type.reaction := funcs; type.manager(type, funcs); + type.reaction := funcs; type.manager(type, funcs); END; END Handler; PROCEDURE RemoveHandlers*(type: EventType); (* remove list of handlers for event `type'; - implies default reaction (abortion) on - receipt of `type' + implies default reaction (abortion) on + receipt of `type' *) BEGIN type.handlers := NIL; IF type.reaction # default THEN - type.reaction := default; type.manager(type, default); + type.reaction := default; type.manager(type, default); END; END RemoveHandlers; PROCEDURE Ignore*(type: EventType); (* implies RemoveHandlers(type) and causes receipt - of `type' to be ignored + of `type' to be ignored *) BEGIN type.handlers := NIL; IF type.reaction # ignore THEN - type.reaction := ignore; type.manager(type, ignore); + type.reaction := ignore; type.manager(type, ignore); END; END Ignore; PROCEDURE GetHandlers*(type: EventType; handlers: HandlerList); (* returns the list of handlers in `handlers'; - the reaction of `type' must be `funcs' + the reaction of `type' must be `funcs' *) BEGIN handlers := type.handlers; @@ -281,8 +281,8 @@ MODULE ulmEvents; PROCEDURE Log*(loghandler: EventHandler); (* call `loghandler' for every event; - subsequent calls of `Log' replace the loghandler; - the loghandler is not called on default and ignore + subsequent calls of `Log' replace the loghandler; + the loghandler is not called on default and ignore *) BEGIN log := loghandler; @@ -311,8 +311,8 @@ MODULE ulmEvents; PROCEDURE QueueHandler*(handler: EventHandler); (* setup an alternative handler of events - that cannot be processed now because - of their unsufficient priority + that cannot be processed now because + of their unsufficient priority *) VAR b : BOOLEAN; (* noch *) tmphandler : EventHandler; @@ -345,93 +345,93 @@ MODULE ulmEvents; PROCEDURE WorkupQueue; VAR - ptr: Event; + ptr: Event; BEGIN WHILE (queue # NIL) & (queue.priority > psys.currentPriority) DO - IF SYS.TAS(lock) THEN RETURN END; - ptr := queue.head; queue := queue.next; - lock := FALSE; - WHILE ptr # NIL DO - CallHandlers(ptr); - ptr := ptr.next; - END; + IF SYS.TAS(lock) THEN RETURN END; + ptr := queue.head; queue := queue.next; + lock := FALSE; + WHILE ptr # NIL DO + CallHandlers(ptr); + ptr := ptr.next; + END; END; END WorkupQueue; PROCEDURE CallHandlers(event: Event); VAR - ptr: HandlerList; - oldPriority: Priority; + ptr: HandlerList; + oldPriority: Priority; BEGIN CASE event.type.reaction OF | default: abort(event); | ignore: | funcs: oldPriority := psys.currentPriority; - psys.currentPriority := event.type.priority; - log(event); - ptr := event.type.handlers; - WHILE ptr # NIL DO - ptr.handler(event); - ptr := ptr.next; - END; - psys.currentPriority := oldPriority; + psys.currentPriority := event.type.priority; + log(event); + ptr := event.type.handlers; + WHILE ptr # NIL DO + ptr.handler(event); + ptr := ptr.next; + END; + psys.currentPriority := oldPriority; ELSE (* Explicitly ignore unhandled even type reactions *) END; END CallHandlers; PROCEDURE Raise*(event: Event); (* call all event handlers (in reverse order) - associated with event.type; - abort if there are none; - some system events may abort in another way - (i.e. they do not cause the abortion handler to be called) + associated with event.type; + abort if there are none; + some system events may abort in another way + (i.e. they do not cause the abortion handler to be called) *) VAR - priority: Priority; + priority: Priority; PROCEDURE AddToQueue(event: Event); - VAR - prev, ptr: Queue; + VAR + prev, ptr: Queue; BEGIN - event.next := NIL; - ptr := queue; prev := NIL; - WHILE (ptr # NIL) & (ptr.priority > priority) DO - prev := ptr; - ptr := ptr.next; - END; - IF (ptr # NIL) & (ptr.priority = priority) THEN - ptr.tail.next := event; - ptr.tail := event; - ELSE - NEW(ptr); - ptr.priority := priority; - ptr.head := event; ptr.tail := event; - IF prev = NIL THEN - ptr.next := queue; - queue := ptr; - ELSE - ptr.next := prev.next; - prev.next := ptr; - END; - END; + event.next := NIL; + ptr := queue; prev := NIL; + WHILE (ptr # NIL) & (ptr.priority > priority) DO + prev := ptr; + ptr := ptr.next; + END; + IF (ptr # NIL) & (ptr.priority = priority) THEN + ptr.tail.next := event; + ptr.tail := event; + ELSE + NEW(ptr); + ptr.priority := priority; + ptr.head := event; ptr.tail := event; + IF prev = NIL THEN + ptr.next := queue; + queue := ptr; + ELSE + ptr.next := prev.next; + prev.next := ptr; + END; + END; END AddToQueue; BEGIN (* Raise *) INC(nestlevel); IF nestlevel >= maxnestlevel THEN - abort(event); + abort(event); ELSE - IF event.type.reaction # ignore THEN - priority := event.type.priority; - IF psys.currentPriority < priority THEN - CallHandlers(event); WorkupQueue; - ELSIF queueHandler # NIL THEN - queueHandler(event); - ELSIF ~SYS.TAS(lock) THEN - AddToQueue(event); - lock := FALSE; - END; - END; + IF event.type.reaction # ignore THEN + priority := event.type.priority; + IF psys.currentPriority < priority THEN + CallHandlers(event); WorkupQueue; + ELSIF queueHandler # NIL THEN + queueHandler(event); + ELSIF ~SYS.TAS(lock) THEN + AddToQueue(event); + lock := FALSE; + END; + END; END; DEC(nestlevel); END Raise; @@ -452,7 +452,7 @@ MODULE ulmEvents; PROCEDURE SwitchPrioritySystem*(prioritySystem: PrioritySystem); (* switch to another priority system; this is typically - done in case of task switches + done in case of task switches *) BEGIN psys := prioritySystem; @@ -460,52 +460,52 @@ MODULE ulmEvents; PROCEDURE EnterPriority*(priority: Priority); (* sets the current priority to `priority'; - it is an error to give a priority less than - the current priority (event `badpriority') + it is an error to give a priority less than + the current priority (event `badpriority') *) BEGIN IF psys.currentPriority <= priority THEN - IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN - psys.priotab[psys.priotop] := psys.currentPriority; - INC(psys.priotop); - psys.currentPriority := priority; - ELSE - INC(psys.overflow); - END; + IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN + psys.priotab[psys.priotop] := psys.currentPriority; + INC(psys.priotop); + psys.currentPriority := priority; + ELSE + INC(psys.overflow); + END; ELSE - Error(priorityViolation); - INC(psys.overflow); + Error(priorityViolation); + INC(psys.overflow); END; END EnterPriority; PROCEDURE AssertPriority*(priority: Priority); (* current priority - < priority: set the current priority to `priority' - >= priority: the current priority remains unchanged + < priority: set the current priority to `priority' + >= priority: the current priority remains unchanged *) BEGIN IF (psys.overflow = 0) & (psys.priotop < priotabsize) THEN - psys.priotab[psys.priotop] := psys.currentPriority; INC(psys.priotop); - IF psys.currentPriority < priority THEN - psys.currentPriority := priority; - END; + psys.priotab[psys.priotop] := psys.currentPriority; INC(psys.priotop); + IF psys.currentPriority < priority THEN + psys.currentPriority := priority; + END; ELSE - INC(psys.overflow); + INC(psys.overflow); END; END AssertPriority; PROCEDURE ExitPriority*; (* causes the priority before the last effective call - of SetPriority or AssertPriority to be restored + of SetPriority or AssertPriority to be restored *) BEGIN IF psys.overflow > 0 THEN - DEC(psys.overflow); + DEC(psys.overflow); ELSIF psys.priotop = 0 THEN - Error(unbalancedExitPriority); + Error(unbalancedExitPriority); ELSE - DEC(psys.priotop); psys.currentPriority := psys.priotab[psys.priotop]; - WorkupQueue; + DEC(psys.priotop); psys.currentPriority := psys.priotab[psys.priotop]; + WorkupQueue; END; END ExitPriority; @@ -517,11 +517,11 @@ MODULE ulmEvents; PROCEDURE SaveReaction*(type: EventType); (* saves current reaction until call of RestoreReaction; - the new reaction of `type' is defined to be `ignore' - but can be changed by Events.Handler or Events.RemoveHandlers + the new reaction of `type' is defined to be `ignore' + but can be changed by Events.Handler or Events.RemoveHandlers *) VAR - savelist: SaveList; + savelist: SaveList; BEGIN NEW(savelist); savelist.reaction := type.reaction; @@ -530,27 +530,27 @@ MODULE ulmEvents; type.savelist := savelist; type.handlers := NIL; IF type.reaction # ignore THEN - type.reaction := ignore; type.manager(type, ignore); + type.reaction := ignore; type.manager(type, ignore); END; END SaveReaction; PROCEDURE RestoreReaction*(type: EventType); (* restores old reaction; - must be properly nested + must be properly nested *) VAR - savelist: SaveList; + savelist: SaveList; BEGIN IF type.savelist = NIL THEN - Error(unbalancedRestoreReaction); + Error(unbalancedRestoreReaction); ELSE - savelist := type.savelist; - type.savelist := savelist.next; - type.handlers := savelist.handlers; - IF type.reaction # savelist.reaction THEN - type.reaction := savelist.reaction; - type.manager(type, savelist.reaction); - END; + savelist := type.savelist; + type.savelist := savelist.next; + type.handlers := savelist.handlers; + IF type.reaction # savelist.reaction THEN + type.reaction := savelist.reaction; + type.manager(type, savelist.reaction); + END; END; END RestoreReaction; diff --git a/src/library/ulm/ulmForwarders.Mod b/src/library/ulm/ulmForwarders.Mod index ac4fa0b8..27f68104 100644 --- a/src/library/ulm/ulmForwarders.Mod +++ b/src/library/ulm/ulmForwarders.Mod @@ -1,244 +1,252 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1995 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1995 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Forwarders.om,v 1.1 1996/01/04 16:40:57 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Forwarders.om,v $ - Revision 1.1 1996/01/04 16:40:57 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Forwarders.om,v 1.1 1996/01/04 16:40:57 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Forwarders.om,v $ + Revision 1.1 1996/01/04 16:40:57 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmForwarders; (* AFB 3/95 *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Resources := ulmResources, Services := ulmServices, SYSTEM; - (* SYSTEM is necessary to cast to Disciplines.Discipline; noch *) + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Resources := ulmResources, Services := ulmServices; - TYPE - Object* = Services.Object; - ForwardProc* = PROCEDURE (from, to: Object); + TYPE + Object* = Services.Object; + ForwardProc* = PROCEDURE (from, to: Object); - TYPE - ListOfForwarders = POINTER TO ListOfForwardersRec; - ListOfForwardersRec = - RECORD - forward: ForwardProc; - next: ListOfForwarders; - END; - ListOfDependants = POINTER TO ListOfDependantsRec; - ListOfDependantsRec = - RECORD - dependant: Object; - next: ListOfDependants; - END; - TypeDiscipline = POINTER TO TypeDisciplineRec; - TypeDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - list: ListOfForwarders; - END; - ObjectDiscipline = POINTER TO ObjectDisciplineRec; - ObjectDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - dependants: ListOfDependants; - forwarders: ListOfForwarders; - dependsOn: Object; - END; - VAR - genlist: ListOfForwarders; (* list which applies to all types *) - typeDiscID: Disciplines.Identifier; - objectDiscID: Disciplines.Identifier; - - (* === private procedures ============================================ *) - - PROCEDURE RemoveDependant(VAR list: ListOfDependants; dependant: Object); - VAR - prev, p: ListOfDependants; - BEGIN - prev := NIL; p := list; - WHILE (p # NIL) & (p.dependant # dependant) DO - prev := p; p := p.next; + TYPE + ListOfForwarders = POINTER TO ListOfForwardersRec; + ListOfForwardersRec = + RECORD + forward: ForwardProc; + next: ListOfForwarders; END; - IF p # NIL THEN - IF prev = NIL THEN - list := p.next; - ELSE - prev.next := p.next; - END; + ListOfDependants = POINTER TO ListOfDependantsRec; + ListOfDependantsRec = + RECORD + dependant: Object; + next: ListOfDependants; END; - END RemoveDependant; - - PROCEDURE TerminationHandler(event: Events.Event); - (* remove list of dependants in case of termination and - remove event.resource from the list of dependants of that - object it depends on - *) - VAR - odisc: ObjectDiscipline; - dependsOn: Object; - BEGIN - WITH event: Resources.Event DO - IF event.change = Resources.terminated THEN - IF Disciplines.Seek(event.resource, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - Disciplines.Remove(event.resource, objectDiscID); - dependsOn := odisc.dependsOn; - IF (dependsOn # NIL) & ~Resources.Terminated(dependsOn) & - Disciplines.Seek(dependsOn, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - RemoveDependant(odisc.dependants, event.resource(Object)); - END; - END; - END; + TypeDiscipline = POINTER TO TypeDisciplineRec; + TypeDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + list: ListOfForwarders; END; - END TerminationHandler; - - PROCEDURE Insert(VAR list: ListOfForwarders; forward: ForwardProc); - VAR - member: ListOfForwarders; - BEGIN - NEW(member); member.forward := forward; - member.next := list; list := member; - END Insert; - - PROCEDURE GetObjectDiscipline(object: Object; VAR odisc: ObjectDiscipline); - VAR - resourceNotification: Events.EventType; - BEGIN - IF ~Disciplines.Seek(object, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - NEW(odisc); odisc.id := objectDiscID; odisc.dependants := NIL; - odisc.forwarders := NIL; odisc.dependsOn := NIL; - (* let's state our interest in termination of `object' if - we see this object the first time - *) - Resources.TakeInterest(object, resourceNotification); - Events.Handler(resourceNotification, TerminationHandler); - Disciplines.Add(object, odisc); + ObjectDiscipline = POINTER TO ObjectDisciplineRec; + ObjectDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + dependants: ListOfDependants; + forwarders: ListOfForwarders; + dependsOn: Object; END; - END GetObjectDiscipline; + VAR + genlist: ListOfForwarders; (* list which applies to all types *) + typeDiscID: Disciplines.Identifier; + objectDiscID: Disciplines.Identifier; - (* === exported procedures =========================================== *) + (* === private procedures ============================================ *) - PROCEDURE Register*(for: ARRAY OF CHAR; forward: ForwardProc); - (* register a forwarder which is to be called for all - forward operations which affects extensions of `for'; - "" may be given for Services.Object - *) - - VAR - type: Services.Type; - tdisc: TypeDiscipline; - - BEGIN (* Register *) - IF for = "" THEN - Insert(genlist, forward); + PROCEDURE RemoveDependant(VAR list: ListOfDependants; dependant: Object); + VAR + prev, p: ListOfDependants; + BEGIN + prev := NIL; p := list; + WHILE (p # NIL) & (p.dependant # dependant) DO + prev := p; p := p.next; + END; + IF p # NIL THEN + IF prev = NIL THEN + list := p.next; ELSE - Services.SeekType(for, type); - ASSERT(type # NIL); - IF ~Disciplines.Seek(type, typeDiscID, SYSTEM.VAL(Disciplines.Discipline, tdisc)) THEN - NEW(tdisc); tdisc.id := typeDiscID; tdisc.list := NIL; - END; - Insert(tdisc.list, forward); - Disciplines.Add(type, tdisc); + prev.next := p.next; END; - END Register; + END; + END RemoveDependant; - PROCEDURE RegisterObject*(object: Object; forward: ForwardProc); - (* to be called instead of Register if specific objects - are supported only and not all extensions of a type + PROCEDURE TerminationHandler(event: Events.Event); + (* remove list of dependants in case of termination and + remove event.resource from the list of dependants of that + object it depends on + *) + VAR + odisc: Disciplines.Discipline; + dependsOn: Object; + BEGIN + WITH event: Resources.Event DO + IF event.change = Resources.terminated THEN + IF Disciplines.Seek(event.resource, objectDiscID, odisc) THEN + Disciplines.Remove(event.resource, objectDiscID); + dependsOn := odisc(ObjectDiscipline).dependsOn; + IF (dependsOn # NIL) & ~Resources.Terminated(dependsOn) & + Disciplines.Seek(dependsOn, objectDiscID, odisc) THEN + RemoveDependant(odisc(ObjectDiscipline).dependants, event.resource(Object)); + END; + END; + END; + END; + END TerminationHandler; + + PROCEDURE Insert(VAR list: ListOfForwarders; forward: ForwardProc); + VAR + member: ListOfForwarders; + BEGIN + NEW(member); member.forward := forward; + member.next := list; list := member; + END Insert; + + PROCEDURE GetObjectDiscipline(object: Object; VAR odisc: ObjectDiscipline); + VAR + disc: Disciplines.Discipline; + resourceNotification: Events.EventType; + BEGIN + IF Disciplines.Seek(object, objectDiscID, disc) THEN + odisc := disc(ObjectDiscipline) + ELSE + NEW(odisc); odisc.id := objectDiscID; odisc.dependants := NIL; + odisc.forwarders := NIL; odisc.dependsOn := NIL; + (* let's state our interest in termination of `object' if + we see this object the first time *) - VAR - odisc: ObjectDiscipline; - BEGIN - GetObjectDiscipline(object, odisc); - Insert(odisc.forwarders, forward); - END RegisterObject; + Resources.TakeInterest(object, resourceNotification); + Events.Handler(resourceNotification, TerminationHandler); + Disciplines.Add(object, odisc); + END; + END GetObjectDiscipline; - PROCEDURE Update*(object: Object; forward: ForwardProc); - (* is to be called by one of the registered forwarders if - an interface for object has been newly installed or changed - in a way which needs forward to be called for each of - the filter objects which delegate to `object' - *) - VAR - odisc: ObjectDiscipline; - client: ListOfDependants; - BEGIN - IF Disciplines.Seek(object, objectDiscID, SYSTEM.VAL(Disciplines.Discipline, odisc)) THEN (* noch *) - client := odisc.dependants; - WHILE client # NIL DO - forward(client.dependant, object); - client := client.next; - END; + (* === exported procedures =========================================== *) + + PROCEDURE Register*(for: ARRAY OF CHAR; forward: ForwardProc); + (* register a forwarder which is to be called for all + forward operations which affects extensions of `for'; + "" may be given for Services.Object + *) + + VAR + type: Services.Type; + tdisc: TypeDiscipline; + disc: Disciplines.Discipline; + + BEGIN (* Register *) + IF for = "" THEN + Insert(genlist, forward); + ELSE + Services.SeekType(for, type); + ASSERT(type # NIL); + IF Disciplines.Seek(type, typeDiscID, disc) THEN + tdisc := disc(TypeDiscipline) + ELSE + NEW(tdisc); tdisc.id := typeDiscID; tdisc.list := NIL; END; - END Update; + Insert(tdisc.list, forward); + Disciplines.Add(type, tdisc); + END; + END Register; - PROCEDURE Forward*(from, to: Object); - (* forward (as far as supported) all operations from `from' to `to' *) - VAR - type, otherType, baseType: Services.Type; - tdisc: TypeDiscipline; - odisc: ObjectDiscipline; - client: ListOfDependants; - forwarder: ListOfForwarders; + PROCEDURE RegisterObject*(object: Object; forward: ForwardProc); + (* to be called instead of Register if specific objects + are supported only and not all extensions of a type + *) + VAR + odisc: ObjectDiscipline; + BEGIN + GetObjectDiscipline(object, odisc); + Insert(odisc.forwarders, forward); + END RegisterObject; - PROCEDURE CallForwarders(list: ListOfForwarders); - BEGIN - WHILE list # NIL DO - list.forward(from, to); - list := list.next; - END; - END CallForwarders; - - BEGIN (* Forward *) - Services.GetType(from, type); - Services.GetType(to, otherType); - ASSERT((type # NIL) & (otherType # NIL)); - - IF Resources.Terminated(to) OR Resources.Terminated(from) THEN - (* forwarding operations is no longer useful *) - RETURN + PROCEDURE Update*(object: Object; forward: ForwardProc); + (* is to be called by one of the registered forwarders if + an interface for object has been newly installed or changed + in a way which needs forward to be called for each of + the filter objects which delegate to `object' + *) + VAR + odisc: ObjectDiscipline; + disc: Disciplines.Discipline; + client: ListOfDependants; + BEGIN + IF Disciplines.Seek(object, objectDiscID, disc) THEN + odisc := disc(ObjectDiscipline); + client := odisc.dependants; + WHILE client # NIL DO + forward(client.dependant, object); + client := client.next; END; - Resources.DependsOn(from, to); + END; + END Update; - (* update the list of dependants for `to' *) - GetObjectDiscipline(to, odisc); - NEW(client); client.dependant := from; - client.next := odisc.dependants; odisc.dependants := client; + PROCEDURE Forward*(from, to: Object); + (* forward (as far as supported) all operations from `from' to `to' *) + VAR + type, otherType, baseType: Services.Type; + disc: Disciplines.Discipline; + tdisc: TypeDiscipline; + odisc: ObjectDiscipline; + client: ListOfDependants; + forwarder: ListOfForwarders; - (* call object-specific forwarders *) - CallForwarders(odisc.forwarders); - - LOOP (* go through the list of base types in descending order *) - IF Disciplines.Seek(type, typeDiscID, SYSTEM.VAL(Disciplines.Discipline, tdisc)) & (* noch *) - Services.IsExtensionOf(otherType, type) THEN - CallForwarders(tdisc.list); - END; - Services.GetBaseType(type, baseType); - IF baseType = NIL THEN EXIT END; - type := baseType; + PROCEDURE CallForwarders(list: ListOfForwarders); + BEGIN + WHILE list # NIL DO + list.forward(from, to); + list := list.next; END; - CallForwarders(genlist); - END Forward; + END CallForwarders; + + BEGIN (* Forward *) + Services.GetType(from, type); + Services.GetType(to, otherType); + ASSERT((type # NIL) & (otherType # NIL)); + + IF Resources.Terminated(to) OR Resources.Terminated(from) THEN + (* forwarding operations is no longer useful *) + RETURN + END; + Resources.DependsOn(from, to); + + (* update the list of dependants for `to' *) + GetObjectDiscipline(to, odisc); + NEW(client); client.dependant := from; + client.next := odisc.dependants; odisc.dependants := client; + + (* call object-specific forwarders *) + CallForwarders(odisc.forwarders); + + LOOP (* go through the list of base types in descending order *) + IF Disciplines.Seek(type, typeDiscID, disc) & Services.IsExtensionOf(otherType, type) THEN + tdisc := disc(TypeDiscipline); + CallForwarders(tdisc.list); + END; + Services.GetBaseType(type, baseType); + IF baseType = NIL THEN EXIT END; + type := baseType; + END; + CallForwarders(genlist); + END Forward; BEGIN - genlist := NIL; - typeDiscID := Disciplines.Unique(); - objectDiscID := Disciplines.Unique(); + genlist := NIL; + typeDiscID := Disciplines.Unique(); + objectDiscID := Disciplines.Unique(); END ulmForwarders. diff --git a/src/library/ulm/ulmIO.Mod b/src/library/ulm/ulmIO.Mod index 04bc3bcb..162aa127 100644 --- a/src/library/ulm/ulmIO.Mod +++ b/src/library/ulm/ulmIO.Mod @@ -42,9 +42,7 @@ MODULE ulmIO; dig : LONGINT; NumberLen : SHORTINT; BEGIN - IF SIZE(LONGINT) = 4 THEN - NumberLen := 11 - ELSIF SIZE(LONGINT) = 8 THEN + IF SIZE(LONGINT) = 8 THEN NumberLen := 21 ELSE NumberLen := 11 (* default value, corresponds to 32 bit *) diff --git a/src/library/ulm/ulmIndirectDisciplines.Mod b/src/library/ulm/ulmIndirectDisciplines.Mod index 3118852e..22e06b14 100644 --- a/src/library/ulm/ulmIndirectDisciplines.Mod +++ b/src/library/ulm/ulmIndirectDisciplines.Mod @@ -43,23 +43,24 @@ MODULE ulmIndirectDisciplines; TYPE IndDiscipline = POINTER TO IndDisciplineRec; IndDisciplineRec = - RECORD - (DisciplineRec) - forwardTo: Object; - END; + RECORD + (DisciplineRec) + forwardTo: Object; + END; + VAR discID: Identifier; PROCEDURE Forward*(from, to: Object); VAR - disc: IndDiscipline; + disc: IndDiscipline; BEGIN IF to = NIL THEN - Disciplines.Remove(from, discID); + Disciplines.Remove(from, discID); ELSE - NEW(disc); disc.id := discID; - disc.forwardTo := to; - Disciplines.Add(from, disc); + NEW(disc); disc.id := discID; + disc.forwardTo := to; + Disciplines.Add(from, disc); END; END Forward; @@ -70,44 +71,43 @@ MODULE ulmIndirectDisciplines; PROCEDURE Add*(object: Object; discipline: Discipline); VAR - disc: IndDiscipline; + disc: Discipline; BEGIN - WHILE Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) DO - object := disc.forwardTo; + WHILE Disciplines.Seek(object, discID, disc) DO + object := disc(IndDiscipline).forwardTo; END; Disciplines.Add(object, discipline); END Add; PROCEDURE Remove*(object: Object; id: Identifier); VAR - dummy: Discipline; - disc: IndDiscipline; + dummy, disc: Discipline; BEGIN LOOP - IF Disciplines.Seek(object, id, dummy) THEN - Disciplines.Remove(object, id); - EXIT - END; - IF ~Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - EXIT - END; - object := disc.forwardTo; + IF Disciplines.Seek(object, id, dummy) THEN + Disciplines.Remove(object, id); + EXIT + END; + IF ~Disciplines.Seek(object, discID, disc) THEN + EXIT + END; + object := disc(IndDiscipline).forwardTo; END; END Remove; PROCEDURE Seek*(object: Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; + VAR discipline: Discipline) : BOOLEAN; VAR - disc: IndDiscipline; + disc: Discipline; BEGIN LOOP - IF Disciplines.Seek(object, id, discipline) THEN - RETURN TRUE - END; - IF ~Disciplines.Seek(object, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - RETURN FALSE - END; - object := disc.forwardTo; + IF Disciplines.Seek(object, id, discipline) THEN + RETURN TRUE + END; + IF ~Disciplines.Seek(object, discID, disc) THEN + RETURN FALSE + END; + object := disc(IndDiscipline).forwardTo; END; END Seek; diff --git a/src/library/ulm/ulmIntOperations.Mod b/src/library/ulm/ulmIntOperations.Mod index 33ec3161..3f1799aa 100644 --- a/src/library/ulm/ulmIntOperations.Mod +++ b/src/library/ulm/ulmIntOperations.Mod @@ -28,52 +28,53 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) - IMPORT Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Services := ulmServices, Streams := ulmStreams, Types := ulmTypes, SYSTEM; + IMPORT + Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, + Services := ulmServices, Streams := ulmStreams, + Types := ulmTypes; -(* SYSTEM added to make casts necessary to port ulm library because ulm compiler is not as strict (read it's wrong) as it had to be --noch *) - - CONST + CONST mod* = 5; pow* = 6; inc* = 7; dec* = 8; mmul* = 9; mpow* = 10; odd* = 11; shift* = 12; - TYPE + TYPE Operation* = Operations.Operation; (* Operations.add..mpow *) Operand* = POINTER TO OperandRec; TYPE - CapabilitySet* = Operations.CapabilitySet; - (* SET of [Operations.add..shift] *) + CapabilitySet* = Operations.CapabilitySet; + (* SET of [Operations.add..shift] *) IsLargeEnoughForProc* = PROCEDURE (op: Operations.Operand; - n: LONGINT): BOOLEAN; + n: LONGINT): BOOLEAN; UnsignedProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; IntToOpProc* = PROCEDURE (int32: Types.Int32; VAR op: Operations.Operand); OpToIntProc* = PROCEDURE (op: Operations.Operand; VAR int32: Types.Int32); Log2Proc* = PROCEDURE (op: Operations.Operand): LONGINT; OddProc* = PROCEDURE (op: Operations.Operand): BOOLEAN; - ShiftProc* = PROCEDURE (op: Operations.Operand; - n: INTEGER): Operations.Operand; - IntOperatorProc* = PROCEDURE(op: Operation; - op1, op2, op3: Operations.Operand; - VAR result: Operations.Operand); + ShiftProc* = PROCEDURE (op: Operations.Operand; + n: INTEGER): Operations.Operand; + IntOperatorProc* = PROCEDURE(op: Operation; + op1, op2, op3: Operations.Operand; + VAR result: Operations.Operand); Interface* = POINTER TO InterfaceRec; InterfaceRec* = RECORD - (Operations.InterfaceRec) - isLargeEnoughFor*: IsLargeEnoughForProc; - unsigned* : UnsignedProc; - intToOp* : IntToOpProc; - opToInt* : OpToIntProc; - log2* : Log2Proc; - odd* : OddProc; - shift* : ShiftProc; - intOp* : IntOperatorProc; + (Operations.InterfaceRec) + isLargeEnoughFor*: IsLargeEnoughForProc; + unsigned* : UnsignedProc; + intToOp* : IntToOpProc; + opToInt* : OpToIntProc; + log2* : Log2Proc; + odd* : OddProc; + shift* : ShiftProc; + intOp* : IntOperatorProc; END; TYPE OperandRec* = RECORD - (Operations.OperandRec); - (* private components *) - if : Interface; - caps: CapabilitySet; + (Operations.OperandRec); + (* private components *) + if : Interface; + caps: CapabilitySet; END; VAR @@ -97,7 +98,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE IsLargeEnoughFor*(op: Operations.Operand; n: LONGINT): BOOLEAN; BEGIN WITH op: Operand DO - RETURN op.if.isLargeEnoughFor(op, n) + RETURN op.if.isLargeEnoughFor(op, n) END; END IsLargeEnoughFor; @@ -105,34 +106,18 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Unsigned*(op: Operations.Operand): BOOLEAN; BEGIN WITH op: Operand DO - RETURN op.if.unsigned(op) + RETURN op.if.unsigned(op) END; END Unsigned; PROCEDURE IntToOp*(int32: Types.Int32; VAR op: Operations.Operand); (* converts int32 into operand type, and stores result in already - initialized op + initialized op *) BEGIN - (*WITH op: Operand DO*) - (* - with original ulm source we were getting: - - WITH op: Operand DO - ^ - pos 4101 err 245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable - - thus we considered changing WITH op: Operand by op(Operand) - - -- noch - - *) - (*ASSERT(op.if # NIL);*) - ASSERT(op(Operand).if # NIL); - (*op.if.intToOp(int32, op);*) - op(Operand).if.intToOp(int32, op(Operations.Operand)); - (*END;*) + ASSERT(op(Operand).if # NIL); + op(Operand).if.intToOp(int32, op); END IntToOp; @@ -140,7 +125,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) (* converts op into int32 *) BEGIN WITH op: Operand DO - op.if.opToInt(op, int32); + op.if.opToInt(op, int32); END; END OpToInt; @@ -148,7 +133,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Log2*(op: Operations.Operand): LONGINT; BEGIN WITH op: Operand DO - RETURN op.if.log2(op) + RETURN op.if.log2(op) END; END Log2; @@ -162,22 +147,22 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Odd; - PROCEDURE Op(op: Operation; op1, op2, op3: Operations.Operand; - VAR result: Operations.Operand); + PROCEDURE Op(op: Operation; op1, op2, op3: Operations.Operand; + VAR result: Operations.Operand); VAR tmpresult: Operations.Operand; BEGIN WITH op1: Operand DO - IF (op2#NIL) & (op3#NIL) THEN - ASSERT((op1.if = op2(Operand).if) & - (op2(Operand).if = op3(Operand).if)); - ELSIF (op2#NIL) THEN - ASSERT(op1.if = op2(Operand).if); - END; - ASSERT(op IN op1.caps); - op1.if.create(tmpresult); - op1.if.intOp(op, op1, op2, op3, tmpresult); - result := tmpresult; + IF (op2#NIL) & (op3#NIL) THEN + ASSERT((op1.if = op2(Operand).if) & + (op2(Operand).if = op3(Operand).if)); + ELSIF (op2#NIL) THEN + ASSERT(op1.if = op2(Operand).if); + END; + ASSERT(op IN op1.caps); + op1.if.create(tmpresult); + op1.if.intOp(op, op1, op2, op3, tmpresult); + result := tmpresult; END; END Op; @@ -197,15 +182,15 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END Shift2; - PROCEDURE Shift3*(VAR result: Operations.Operand; op1: Operations.Operand; - n : INTEGER); + PROCEDURE Shift3*(VAR result: Operations.Operand; op1: Operations.Operand; + n : INTEGER); VAR tmpresult: Operations.Operand; BEGIN WITH op1: Operand DO - op1.if.create(tmpresult); - tmpresult := Shift(op1, n); - result := tmpresult; + op1.if.create(tmpresult); + tmpresult := Shift(op1, n); + result := tmpresult; END; END Shift3; @@ -230,7 +215,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) BEGIN Op(inc,op1,NIL,NIL,result); END Inc3; - + PROCEDURE Dec*(op1: Operations.Operand): Operations.Operand; VAR @@ -252,7 +237,7 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) BEGIN Op(dec,op1,NIL,NIL,result); END Dec3; - + PROCEDURE Mod*(op1, op2: Operations.Operand): Operations.Operand; VAR @@ -278,11 +263,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE Pow*(op1, op2: Operations.Operand): Operations.Operand; VAR - result : Operand; + result: Operations.Operand; BEGIN result := NIL; - (*Op(pow, op1, op2, NIL, result);*) - Op(pow, op1, op2, NIL, SYSTEM.VAL(Operations.Operand, result)); (* -- noch *) + Op(pow, op1, op2, NIL, result); RETURN result END Pow; @@ -301,11 +285,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE MMul*(op1, op2, op3: Operations.Operand): Operations.Operand; VAR - result : Operand; + result : Operations.Operand; BEGIN result := NIL; - (*Op(mmul, op1, op2, op3, result); *) - Op(mmul, op1, op2, op3, SYSTEM.VAL(Operations.Operand, result)); (* --noch*) + Op(mmul, op1, op2, op3, result); RETURN result END MMul; @@ -316,8 +299,8 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END MMul2; - PROCEDURE MMul3*(VAR result: Operations.Operand; - op1, op2, op3: Operations.Operand); + PROCEDURE MMul3*(VAR result: Operations.Operand; + op1, op2, op3: Operations.Operand); BEGIN Op(mmul, op1, op2, op3, result); END MMul3; @@ -325,11 +308,10 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) PROCEDURE MPow*(op1, op2, op3: Operations.Operand): Operations.Operand; VAR - result : Operand; + result : Operations.Operand; BEGIN result := NIL; - (*Op(mpow, op1, op2, op3, result); *) - Op(mpow, op1, op2, op3, SYSTEM.VAL(Operations.Operand, result)); (* -- noch*) + Op(mpow, op1, op2, op3, result); RETURN result END MPow; @@ -340,8 +322,8 @@ MODULE ulmIntOperations; (* Frank B.J. Fischer *) END MPow2; - PROCEDURE MPow3*(VAR result: Operations.Operand; - op1, op2, op3: Operations.Operand); + PROCEDURE MPow3*(VAR result: Operations.Operand; + op1, op2, op3: Operations.Operand); BEGIN Op(mpow, op1, op2, op3, result); END MPow3; diff --git a/src/library/ulm/ulmNetIO.Mod b/src/library/ulm/ulmNetIO.Mod index 0d0d44a0..b9741f30 100644 --- a/src/library/ulm/ulmNetIO.Mod +++ b/src/library/ulm/ulmNetIO.Mod @@ -1,546 +1,554 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: NetIO.om,v 1.4 2004/05/21 15:19:03 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: NetIO.om,v $ - Revision 1.4 2004/05/21 15:19:03 borchert - performance improvements: - - ReadConstStringD prefers Streams.ReadPart and ConstStrings.CreateD, - if possible - (based on code by Christian Ehrhardt) - - WriteConstString uses Streams.Copy instead of a loop that uses - Streams.ReadByte and Streams.WriteByte + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: NetIO.om,v 1.4 2004/05/21 15:19:03 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: NetIO.om,v $ + Revision 1.4 2004/05/21 15:19:03 borchert + performance improvements: + - ReadConstStringD prefers Streams.ReadPart and ConstStrings.CreateD, + if possible + (based on code by Christian Ehrhardt) + - WriteConstString uses Streams.Copy instead of a loop that uses + Streams.ReadByte and Streams.WriteByte - Revision 1.3 1995/03/17 16:28:20 borchert - - SizeOf stuff removed - - support of const strings added - - support of Forwarders added + Revision 1.3 1995/03/17 16:28:20 borchert + - SizeOf stuff removed + - support of const strings added + - support of Forwarders added - Revision 1.2 1994/07/18 14:18:37 borchert - unused variables of WriteString (ch + index) removed + Revision 1.2 1994/07/18 14:18:37 borchert + unused variables of WriteString (ch + index) removed - Revision 1.1 1994/02/22 20:08:43 borchert - Initial revision + Revision 1.1 1994/02/22 20:08:43 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 6/93 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 6/93 + ---------------------------------------------------------------------------- *) MODULE ulmNetIO; - (* abstraction for the exchange of Oberon base types which - are components of persistent data structures - *) + (* abstraction for the exchange of Oberon base types which + are components of persistent data structures + *) - IMPORT ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Forwarders := ulmForwarders, Streams := ulmStreams, Strings := ulmStrings, - SYS := SYSTEM, Types := ulmTypes; + IMPORT ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Forwarders := ulmForwarders, Streams := ulmStreams, Strings := ulmStrings, + SYS := SYSTEM, Types := ulmTypes; - TYPE - Byte* = Types.Byte; + TYPE + Byte* = Types.Byte; - TYPE - ReadByteProc* = - PROCEDURE (s: Streams.Stream; VAR byte: Byte) : BOOLEAN; - ReadCharProc* = - PROCEDURE (s: Streams.Stream; VAR char: CHAR) : BOOLEAN; - ReadBooleanProc* = - PROCEDURE (s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; - ReadShortIntProc* = - PROCEDURE (s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; - ReadIntegerProc* = - PROCEDURE (s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; - ReadLongIntProc* = - PROCEDURE (s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; - ReadRealProc* = - PROCEDURE (s: Streams.Stream; VAR real: REAL) : BOOLEAN; - ReadLongRealProc* = - PROCEDURE (s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; - ReadSetProc* = - PROCEDURE (s: Streams.Stream; VAR set: SET) : BOOLEAN; - ReadStringProc* = - PROCEDURE (s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; - ReadConstStringProc* = - PROCEDURE (s: Streams.Stream; domain: ConstStrings.Domain; - VAR string: ConstStrings.String) : BOOLEAN; + TYPE + ReadByteProc* = + PROCEDURE (s: Streams.Stream; VAR byte: Byte) : BOOLEAN; + ReadCharProc* = + PROCEDURE (s: Streams.Stream; VAR char: CHAR) : BOOLEAN; + ReadBooleanProc* = + PROCEDURE (s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; + ReadShortIntProc* = + PROCEDURE (s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + ReadIntegerProc* = + PROCEDURE (s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + ReadLongIntProc* = + PROCEDURE (s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + ReadRealProc* = + PROCEDURE (s: Streams.Stream; VAR real: REAL) : BOOLEAN; + ReadLongRealProc* = + PROCEDURE (s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + ReadSetProc* = + PROCEDURE (s: Streams.Stream; VAR set: SET) : BOOLEAN; + ReadStringProc* = + PROCEDURE (s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; + ReadConstStringProc* = + PROCEDURE (s: Streams.Stream; domain: ConstStrings.Domain; + VAR string: ConstStrings.String) : BOOLEAN; - WriteByteProc* = - PROCEDURE (s: Streams.Stream; byte: Byte) : BOOLEAN; - WriteCharProc* = - PROCEDURE (s: Streams.Stream; char: CHAR) : BOOLEAN; - WriteBooleanProc* = - PROCEDURE (s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; - WriteShortIntProc* = - PROCEDURE (s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; - WriteIntegerProc* = - PROCEDURE (s: Streams.Stream; integer: INTEGER) : BOOLEAN; - WriteLongIntProc* = - PROCEDURE (s: Streams.Stream; longint: LONGINT) : BOOLEAN; - WriteRealProc* = - PROCEDURE (s: Streams.Stream; real: REAL) : BOOLEAN; - WriteLongRealProc* = - PROCEDURE (s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; - WriteSetProc* = - PROCEDURE (s: Streams.Stream; set: SET) : BOOLEAN; - WriteStringProc* = - PROCEDURE (s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; - WriteConstStringProc* = - PROCEDURE (s: Streams.Stream; - string: ConstStrings.String) : BOOLEAN; + WriteByteProc* = + PROCEDURE (s: Streams.Stream; byte: Byte) : BOOLEAN; + WriteCharProc* = + PROCEDURE (s: Streams.Stream; char: CHAR) : BOOLEAN; + WriteBooleanProc* = + PROCEDURE (s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; + WriteShortIntProc* = + PROCEDURE (s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + WriteIntegerProc* = + PROCEDURE (s: Streams.Stream; integer: INTEGER) : BOOLEAN; + WriteLongIntProc* = + PROCEDURE (s: Streams.Stream; longint: LONGINT) : BOOLEAN; + WriteRealProc* = + PROCEDURE (s: Streams.Stream; real: REAL) : BOOLEAN; + WriteLongRealProc* = + PROCEDURE (s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + WriteSetProc* = + PROCEDURE (s: Streams.Stream; set: SET) : BOOLEAN; + WriteStringProc* = + PROCEDURE (s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; + WriteConstStringProc* = + PROCEDURE (s: Streams.Stream; + string: ConstStrings.String) : BOOLEAN; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - readByte*: ReadByteProc; - readChar*: ReadCharProc; - readBoolean*: ReadBooleanProc; - readShortInt*: ReadShortIntProc; - readInteger*: ReadIntegerProc; - readLongInt*: ReadLongIntProc; - readReal*: ReadRealProc; - readLongReal*: ReadLongRealProc; - readSet*: ReadSetProc; - readString*: ReadStringProc; - readConstString*: ReadConstStringProc; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + readByte*: ReadByteProc; + readChar*: ReadCharProc; + readBoolean*: ReadBooleanProc; + readShortInt*: ReadShortIntProc; + readInteger*: ReadIntegerProc; + readLongInt*: ReadLongIntProc; + readReal*: ReadRealProc; + readLongReal*: ReadLongRealProc; + readSet*: ReadSetProc; + readString*: ReadStringProc; + readConstString*: ReadConstStringProc; - writeByte*: WriteByteProc; - writeChar*: WriteCharProc; - writeBoolean*: WriteBooleanProc; - writeShortInt*: WriteShortIntProc; - writeInteger*: WriteIntegerProc; - writeLongInt*: WriteLongIntProc; - writeReal*: WriteRealProc; - writeLongReal*: WriteLongRealProc; - writeSet*: WriteSetProc; - writeString*: WriteStringProc; - writeConstString*: WriteConstStringProc; - END; - - (* private data structures *) - TYPE - Discipline = POINTER TO DisciplineRec; - DisciplineRec = - RECORD - (Disciplines.DisciplineRec) - if: Interface; - END; - VAR - discID: Disciplines.Identifier; - - PROCEDURE Swap (VAR a : ARRAY OF SYS.BYTE); - VAR - i,j : LONGINT; - tmp : SYS.BYTE; - BEGIN - i := 0; j := LEN (a) - 1; - WHILE i < j DO - tmp := a[i]; a[i] := a[j]; a[j] := tmp; - INC (i); DEC (j); + writeByte*: WriteByteProc; + writeChar*: WriteCharProc; + writeBoolean*: WriteBooleanProc; + writeShortInt*: WriteShortIntProc; + writeInteger*: WriteIntegerProc; + writeLongInt*: WriteLongIntProc; + writeReal*: WriteRealProc; + writeLongReal*: WriteLongRealProc; + writeSet*: WriteSetProc; + writeString*: WriteStringProc; + writeConstString*: WriteConstStringProc; END; - END Swap; - PROCEDURE BitSwap (VAR a : ARRAY OF SYS.BYTE); - VAR - i,old, bit : LONGINT; - new : LONGINT; - - BEGIN - i := 0; - WHILE i < LEN (a) DO - old := ORD (SYS.VAL (CHAR, a[i])); - new := 0; bit := 080H; - WHILE old # 0 DO - IF ODD (old) THEN - INC (new, bit); - END; - bit := ASH (bit, -1);; - old := ASH (old, -1); - END; - a[i] := SYS.VAL (SYS.BYTE, new); - INC (i); + (* private data structures *) + TYPE + Discipline = POINTER TO DisciplineRec; + DisciplineRec = + RECORD + (Disciplines.DisciplineRec) + if: Interface; END; - END BitSwap; + VAR + discID: Disciplines.Identifier; - PROCEDURE ^ Forward(from, to: Forwarders.Object); + PROCEDURE Seek(s: Streams.Stream; id: Disciplines.Identifier; disc: Discipline): BOOLEAN; + VAR d: Disciplines.Discipline; result: BOOLEAN; + BEGIN + result := Disciplines.Seek(s, id, d); + IF result THEN disc := d(Discipline) ELSE disc := NIL END; + RETURN result + END Seek; - PROCEDURE AttachInterface*(s: Streams.Stream; if: Interface); - VAR - disc: Discipline; - BEGIN - IF if # NIL THEN - NEW(disc); disc.id := discID; disc.if := if; - Disciplines.Add(s, disc); + PROCEDURE Swap (VAR a : ARRAY OF SYS.BYTE); + VAR + i,j : LONGINT; + tmp : SYS.BYTE; + BEGIN + i := 0; j := LEN (a) - 1; + WHILE i < j DO + tmp := a[i]; a[i] := a[j]; a[j] := tmp; + INC (i); DEC (j); + END; + END Swap; + + PROCEDURE BitSwap (VAR a : ARRAY OF SYS.BYTE); + VAR + i,old, bit : LONGINT; + new : LONGINT; + + BEGIN + i := 0; + WHILE i < LEN (a) DO + old := ORD (SYS.VAL (CHAR, a[i])); + new := 0; bit := 080H; + WHILE old # 0 DO + IF ODD (old) THEN + INC (new, bit); + END; + bit := ASH (bit, -1);; + old := ASH (old, -1); + END; + a[i] := SYS.VAL (SYS.BYTE, new); + INC (i); + END; + END BitSwap; + + PROCEDURE ^ Forward(from, to: Forwarders.Object); + + PROCEDURE AttachInterface*(s: Streams.Stream; if: Interface); + VAR + disc: Discipline; + BEGIN + IF if # NIL THEN + NEW(disc); disc.id := discID; disc.if := if; + Disciplines.Add(s, disc); + ELSE + Disciplines.Remove(s, discID); + END; + Forwarders.Update(s, Forward); + END AttachInterface; + + PROCEDURE GetInterface(s: Streams.Stream; VAR if: Interface); + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + if := disc.if; + ELSE + if := NIL; + END; + END GetInterface; + + PROCEDURE CopyInterface*(from, to: Streams.Stream); + VAR + if: Interface; + BEGIN + GetInterface(from, if); + AttachInterface(to, if); + END CopyInterface; + + PROCEDURE Forward(from, to: Forwarders.Object); + BEGIN + (* this check is necessary because of Forwarders.Update *) + IF ~(from IS Streams.Stream) OR ~(to IS Streams.Stream) THEN + RETURN + END; + + WITH from: Streams.Stream DO WITH to: Streams.Stream DO + (* be careful here, from & to must be reversed *) + CopyInterface(to, from); + END; END; + END Forward; + + PROCEDURE ReadByte*(s: Streams.Stream; VAR byte: Byte) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readByte(s, byte) + ELSE + RETURN Streams.ReadByte(s, byte) + END; + END ReadByte; + + PROCEDURE ReadChar*(s: Streams.Stream; VAR char: CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readChar(s, char) + ELSE + RETURN Streams.ReadByte(s, char) + END; + END ReadChar; + + PROCEDURE ReadBoolean*(s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readBoolean(s, boolean) + ELSE + RETURN Streams.Read(s, boolean) + END; + END ReadBoolean; + + PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readShortInt(s, shortint) + ELSE + RETURN Streams.ReadByte(s, shortint) + END; + END ReadShortInt; + + PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readInteger(s, integer) + ELSE + ret := Streams.Read(s, integer); + IF Types.byteorder = Types.littleEndian THEN + Swap (integer); + END; + RETURN ret; + END; + END ReadInteger; + + PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readLongInt(s, longint) + ELSE + ret := Streams.Read(s, longint); + IF Types.byteorder = Types.littleEndian THEN + Swap (longint); + END; + RETURN ret; + END; + END ReadLongInt; + + PROCEDURE ReadReal*(s: Streams.Stream; VAR real: REAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readReal(s, real) + ELSE + RETURN Streams.Read(s, real) + END; + END ReadReal; + + PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readLongReal(s, longreal) + ELSE + RETURN Streams.Read(s, longreal) + END; + END ReadLongReal; + + PROCEDURE ReadSet*(s: Streams.Stream; VAR set: SET) : BOOLEAN; + VAR + disc: Discipline; + ret : BOOLEAN; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readSet(s, set) + ELSE + ret := Streams.Read(s, set); + IF Types.byteorder = Types.littleEndian THEN + BitSwap (set); + END; + RETURN ret; + END; + END ReadSet; + + PROCEDURE ReadString*(s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; + VAR + disc: Discipline; + ch: CHAR; index: LONGINT; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readString(s, string) + ELSE + index := 0; + WHILE Streams.ReadByte(s, ch) & (ch # 0X) DO + IF index + 1 < LEN(string) THEN + string[index] := ch; INC(index); + END; + END; + string[index] := 0X; + RETURN ~s.error + END; + END ReadString; + + PROCEDURE ReadConstStringD*(s: Streams.Stream; + domain: ConstStrings.Domain; + VAR string: ConstStrings.String) : BOOLEAN; + CONST + bufsize = 512; + VAR + length: LONGINT; + buf: Streams.Stream; + ch: CHAR; + disc: Discipline; + stringbuf: ARRAY bufsize OF CHAR; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.readConstString(s, domain, string) + ELSE + IF ReadLongInt(s, length) THEN + IF length >= bufsize THEN + ConstStrings.Init(buf); + IF ~Streams.Copy(s, buf, length) THEN + RETURN FALSE + END; + ConstStrings.CloseD(buf, domain, string); + RETURN length = s.count; + ELSE + IF ~Streams.ReadPart(s, stringbuf, 0, length) THEN + RETURN FALSE + END; + stringbuf[length] := 0X; + ConstStrings.CreateD(string, domain, stringbuf); + RETURN TRUE + END; ELSE - Disciplines.Remove(s, discID); + RETURN FALSE END; - Forwarders.Update(s, Forward); - END AttachInterface; + END; + END ReadConstStringD; - PROCEDURE GetInterface(s: Streams.Stream; VAR if: Interface); - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - if := disc.if; + PROCEDURE ReadConstString*(s: Streams.Stream; + VAR string: ConstStrings.String) : BOOLEAN; + BEGIN + RETURN ReadConstStringD(s, ConstStrings.std, string) + END ReadConstString; + + PROCEDURE WriteByte*(s: Streams.Stream; byte: Byte) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeByte(s, byte) + ELSE + RETURN Streams.WriteByte(s, byte) + END; + END WriteByte; + + PROCEDURE WriteChar*(s: Streams.Stream; char: CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeChar(s, char) + ELSE + RETURN Streams.WriteByte(s, char) + END; + END WriteChar; + + PROCEDURE WriteBoolean*(s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeBoolean(s, boolean) + ELSE + RETURN Streams.Write(s, boolean) + END; + END WriteBoolean; + + PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeShortInt(s, shortint) + ELSE + RETURN Streams.WriteByte(s, shortint) + END; + END WriteShortInt; + + PROCEDURE WriteInteger*(s: Streams.Stream; integer: INTEGER) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeInteger(s, integer) + ELSE + IF Types.byteorder = Types.littleEndian THEN + Swap (integer); + END; + RETURN Streams.Write(s, integer); + END; + END WriteInteger; + + PROCEDURE WriteLongInt*(s: Streams.Stream; longint: LONGINT) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeLongInt(s, longint) + ELSE + IF Types.byteorder = Types.littleEndian THEN + Swap (longint); + END; + RETURN Streams.Write(s, longint); + END; + END WriteLongInt; + + PROCEDURE WriteReal*(s: Streams.Stream; real: REAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeReal(s, real) + ELSE + RETURN Streams.Write(s, real) + END; + END WriteReal; + + PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeLongReal(s, longreal) + ELSE + RETURN Streams.Write(s, longreal) + END; + END WriteLongReal; + + PROCEDURE WriteSet*(s: Streams.Stream; set: SET) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeSet(s, set) + ELSE + IF Types.byteorder = Types.littleEndian THEN + BitSwap (set); + END; + RETURN Streams.Write(s, set) + END; + END WriteSet; + + PROCEDURE WriteString*(s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; + VAR + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeString(s, string) + ELSE + RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) & + Streams.WriteByte(s, 0X) + END; + END WriteString; + + PROCEDURE WriteConstString*(s: Streams.Stream; + string: ConstStrings.String) : BOOLEAN; + VAR + ch: CHAR; + buf: Streams.Stream; + disc: Discipline; + BEGIN + IF Seek(s, discID, disc) THEN + RETURN disc.if.writeConstString(s, string) + ELSE + IF WriteLongInt(s, string.len) THEN + ConstStrings.Open(buf, string); + RETURN Streams.Copy(buf, s, string.len) ELSE - if := NIL; + RETURN FALSE END; - END GetInterface; - - PROCEDURE CopyInterface*(from, to: Streams.Stream); - VAR - if: Interface; - BEGIN - GetInterface(from, if); - AttachInterface(to, if); - END CopyInterface; - - PROCEDURE Forward(from, to: Forwarders.Object); - BEGIN - (* this check is necessary because of Forwarders.Update *) - IF ~(from IS Streams.Stream) OR ~(to IS Streams.Stream) THEN - RETURN - END; - - WITH from: Streams.Stream DO WITH to: Streams.Stream DO - (* be careful here, from & to must be reversed *) - CopyInterface(to, from); - END; END; - END Forward; - - PROCEDURE ReadByte*(s: Streams.Stream; VAR byte: Byte) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readByte(s, byte) - ELSE - RETURN Streams.ReadByte(s, byte) - END; - END ReadByte; - - PROCEDURE ReadChar*(s: Streams.Stream; VAR char: CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readChar(s, char) - ELSE - RETURN Streams.ReadByte(s, char) - END; - END ReadChar; - - PROCEDURE ReadBoolean*(s: Streams.Stream; VAR boolean: BOOLEAN) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readBoolean(s, boolean) - ELSE - RETURN Streams.Read(s, boolean) - END; - END ReadBoolean; - - PROCEDURE ReadShortInt*(s: Streams.Stream; VAR shortint: SHORTINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readShortInt(s, shortint) - ELSE - RETURN Streams.ReadByte(s, shortint) - END; - END ReadShortInt; - - PROCEDURE ReadInteger*(s: Streams.Stream; VAR integer: INTEGER) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readInteger(s, integer) - ELSE - ret := Streams.Read(s, integer); - IF Types.byteorder = Types.littleEndian THEN - Swap (integer); - END; - RETURN ret; - END; - END ReadInteger; - - PROCEDURE ReadLongInt*(s: Streams.Stream; VAR longint: LONGINT) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readLongInt(s, longint) - ELSE - ret := Streams.Read(s, longint); - IF Types.byteorder = Types.littleEndian THEN - Swap (longint); - END; - RETURN ret; - END; - END ReadLongInt; - - PROCEDURE ReadReal*(s: Streams.Stream; VAR real: REAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readReal(s, real) - ELSE - RETURN Streams.Read(s, real) - END; - END ReadReal; - - PROCEDURE ReadLongReal*(s: Streams.Stream; VAR longreal: LONGREAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readLongReal(s, longreal) - ELSE - RETURN Streams.Read(s, longreal) - END; - END ReadLongReal; - - PROCEDURE ReadSet*(s: Streams.Stream; VAR set: SET) : BOOLEAN; - VAR - disc: Discipline; - ret : BOOLEAN; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readSet(s, set) - ELSE - ret := Streams.Read(s, set); - IF Types.byteorder = Types.littleEndian THEN - BitSwap (set); - END; - RETURN ret; - END; - END ReadSet; - - PROCEDURE ReadString*(s: Streams.Stream; VAR string: ARRAY OF CHAR) : BOOLEAN; - VAR - disc: Discipline; - ch: CHAR; index: LONGINT; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readString(s, string) - ELSE - index := 0; - WHILE Streams.ReadByte(s, ch) & (ch # 0X) DO - IF index + 1 < LEN(string) THEN - string[index] := ch; INC(index); - END; - END; - string[index] := 0X; - RETURN ~s.error - END; - END ReadString; - - PROCEDURE ReadConstStringD*(s: Streams.Stream; - domain: ConstStrings.Domain; - VAR string: ConstStrings.String) : BOOLEAN; - CONST - bufsize = 512; - VAR - length: LONGINT; - buf: Streams.Stream; - ch: CHAR; - disc: Discipline; - stringbuf: ARRAY bufsize OF CHAR; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.readConstString(s, domain, string) - ELSE - IF ReadLongInt(s, length) THEN - IF length >= bufsize THEN - ConstStrings.Init(buf); - IF ~Streams.Copy(s, buf, length) THEN - RETURN FALSE - END; - ConstStrings.CloseD(buf, domain, string); - RETURN length = s.count; - ELSE - IF ~Streams.ReadPart(s, stringbuf, 0, length) THEN - RETURN FALSE - END; - stringbuf[length] := 0X; - ConstStrings.CreateD(string, domain, stringbuf); - RETURN TRUE - END; - ELSE - RETURN FALSE - END; - END; - END ReadConstStringD; - - PROCEDURE ReadConstString*(s: Streams.Stream; - VAR string: ConstStrings.String) : BOOLEAN; - BEGIN - RETURN ReadConstStringD(s, ConstStrings.std, string) - END ReadConstString; - - PROCEDURE WriteByte*(s: Streams.Stream; byte: Byte) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeByte(s, byte) - ELSE - RETURN Streams.WriteByte(s, byte) - END; - END WriteByte; - - PROCEDURE WriteChar*(s: Streams.Stream; char: CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeChar(s, char) - ELSE - RETURN Streams.WriteByte(s, char) - END; - END WriteChar; - - PROCEDURE WriteBoolean*(s: Streams.Stream; boolean: BOOLEAN) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeBoolean(s, boolean) - ELSE - RETURN Streams.Write(s, boolean) - END; - END WriteBoolean; - - PROCEDURE WriteShortInt*(s: Streams.Stream; shortint: SHORTINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeShortInt(s, shortint) - ELSE - RETURN Streams.WriteByte(s, shortint) - END; - END WriteShortInt; - - PROCEDURE WriteInteger*(s: Streams.Stream; integer: INTEGER) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeInteger(s, integer) - ELSE - IF Types.byteorder = Types.littleEndian THEN - Swap (integer); - END; - RETURN Streams.Write(s, integer); - END; - END WriteInteger; - - PROCEDURE WriteLongInt*(s: Streams.Stream; longint: LONGINT) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeLongInt(s, longint) - ELSE - IF Types.byteorder = Types.littleEndian THEN - Swap (longint); - END; - RETURN Streams.Write(s, longint); - END; - END WriteLongInt; - - PROCEDURE WriteReal*(s: Streams.Stream; real: REAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeReal(s, real) - ELSE - RETURN Streams.Write(s, real) - END; - END WriteReal; - - PROCEDURE WriteLongReal*(s: Streams.Stream; longreal: LONGREAL) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeLongReal(s, longreal) - ELSE - RETURN Streams.Write(s, longreal) - END; - END WriteLongReal; - - PROCEDURE WriteSet*(s: Streams.Stream; set: SET) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeSet(s, set) - ELSE - IF Types.byteorder = Types.littleEndian THEN - BitSwap (set); - END; - RETURN Streams.Write(s, set) - END; - END WriteSet; - - PROCEDURE WriteString*(s: Streams.Stream; string: ARRAY OF CHAR) : BOOLEAN; - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeString(s, string) - ELSE - RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) & - Streams.WriteByte(s, 0X) - END; - END WriteString; - - PROCEDURE WriteConstString*(s: Streams.Stream; - string: ConstStrings.String) : BOOLEAN; - VAR - ch: CHAR; - buf: Streams.Stream; - disc: Discipline; - BEGIN - IF Disciplines.Seek(s, discID, SYS.VAL(Disciplines.Discipline, disc)) THEN - RETURN disc.if.writeConstString(s, string) - ELSE - IF WriteLongInt(s, string.len) THEN - ConstStrings.Open(buf, string); - RETURN Streams.Copy(buf, s, string.len) - ELSE - RETURN FALSE - END; - END; - END WriteConstString; + END; + END WriteConstString; BEGIN - discID := Disciplines.Unique(); - Forwarders.Register("Streams.Stream", Forward); + discID := Disciplines.Unique(); + Forwarders.Register("Streams.Stream", Forward); END ulmNetIO. diff --git a/src/library/ulm/ulmOperations.Mod b/src/library/ulm/ulmOperations.Mod index 4f74cc61..617b9808 100644 --- a/src/library/ulm/ulmOperations.Mod +++ b/src/library/ulm/ulmOperations.Mod @@ -1,234 +1,234 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Operations.om,v 1.4 2004/09/16 18:31:54 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Operations.om,v $ - Revision 1.4 2004/09/16 18:31:54 borchert - optimization for Assign added in case of a non-NIL target - and identical types for target and source + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Operations.om,v 1.4 2004/09/16 18:31:54 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Operations.om,v $ + Revision 1.4 2004/09/16 18:31:54 borchert + optimization for Assign added in case of a non-NIL target + and identical types for target and source - Revision 1.3 1997/02/05 16:27:45 borchert - Init asserts now that Services.Init hat been called previously - for ``op'' + Revision 1.3 1997/02/05 16:27:45 borchert + Init asserts now that Services.Init hat been called previously + for ``op'' - Revision 1.2 1995/01/16 21:39:50 borchert - - assertions of Assertions have been converted into real assertions - - some fixes due to changes of PersistentObjects + Revision 1.2 1995/01/16 21:39:50 borchert + - assertions of Assertions have been converted into real assertions + - some fixes due to changes of PersistentObjects - Revision 1.1 1994/02/22 20:09:03 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmOperations; - (* generic support of arithmetic operations *) + (* generic support of arithmetic operations *) - IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices; + IMPORT Events := ulmEvents, Objects := ulmObjects, PersistentDisciplines := ulmPersistentDisciplines, PersistentObjects := ulmPersistentObjects, Services := ulmServices; - CONST - add* = 0; sub* = 1; mul* = 2; div* = 3; cmp* = 4; - TYPE - Operation* = SHORTINT; (* add..cmp *) - Operand* = POINTER TO OperandRec; + CONST + add* = 0; sub* = 1; mul* = 2; div* = 3; cmp* = 4; + TYPE + Operation* = SHORTINT; (* add..cmp *) + Operand* = POINTER TO OperandRec; - TYPE - CapabilitySet* = SET; (* SET OF [add..cmp] *) - CreateProc* = PROCEDURE (VAR op: Operand); - (* should call Operations.Init for op *) - OperatorProc* = PROCEDURE (op: Operation; op1, op2: Operand; - VAR result: Operand); - AssignProc* = PROCEDURE (VAR target: Operand; source: Operand); - CompareProc* = PROCEDURE (op1, op2: Operand) : INTEGER; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; - assign*: AssignProc; - op*: OperatorProc; - compare*: CompareProc; - END; - - TYPE - OperandRec* = - RECORD - (PersistentDisciplines.ObjectRec) - if: Interface; - caps: CapabilitySet; - END; - VAR - operandType: Services.Type; - - PROCEDURE Init*(op: Operand; if: Interface; caps: CapabilitySet); - VAR - type: Services.Type; - BEGIN - Services.GetType(op, type); ASSERT(type # NIL); - op.if := if; op.caps := caps; - END Init; - - PROCEDURE Capabilities*(op: Operand) : CapabilitySet; - BEGIN - RETURN op.caps - END Capabilities; - - PROCEDURE Compatible*(op1, op2: Operand) : BOOLEAN; - (* return TRUE if both operands have the same interface *) - BEGIN - RETURN op1.if = op2.if - END Compatible; - - (* the interface of the first operand must match the interface - of all other operands; - the result parameter must be either NIL or already initialized - with the same interface - *) - - PROCEDURE Op(op: Operation; op1, op2: Operand; VAR result: Operand); - - VAR - tmpresult: Operand; - BEGIN - ASSERT(op1.if = op2.if); - ASSERT(op IN op1.caps); - (* we are very defensive here because the type of tmpresult - is perhaps not identical to result or an extension of it; - op1.if.create(result) will not work in all cases - because of type guard failures - *) - op1.if.create(tmpresult); - op1.if.op(op, op1, op2, tmpresult); - result := tmpresult; - END Op; - - PROCEDURE Add*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(add, op1, op2, result); - RETURN result - END Add; - - PROCEDURE Add2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(add, op1, op2, op1); - END Add2; - - PROCEDURE Add3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(add, op1, op2, result); - END Add3; - - PROCEDURE Sub*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(sub, op1, op2, result); - RETURN result - END Sub; - - PROCEDURE Sub2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(sub, op1, op2, op1); - END Sub2; - - PROCEDURE Sub3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(sub, op1, op2, result); - END Sub3; - - PROCEDURE Mul*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(mul, op1, op2, result); - RETURN result - END Mul; - - PROCEDURE Mul2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(mul, op1, op2, op1); - END Mul2; - - PROCEDURE Mul3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(mul, op1, op2, result); - END Mul3; - - PROCEDURE Div*(op1, op2: Operand) : Operand; - VAR result: Operand; - BEGIN - result := NIL; - Op(div, op1, op2, result); - RETURN result - END Div; - - PROCEDURE Div2*(VAR op1: Operand; op2: Operand); - BEGIN - Op(div, op1, op2, op1); - END Div2; - - PROCEDURE Div3*(VAR result: Operand; op1, op2: Operand); - BEGIN - Op(div, op1, op2, result); - END Div3; - - PROCEDURE Compare*(op1, op2: Operand) : INTEGER; - BEGIN - ASSERT(op1.if = op2.if); - ASSERT(cmp IN op1.caps); - RETURN op1.if.compare(op1, op2) - END Compare; - - PROCEDURE Assign*(VAR target: Operand; source: Operand); - VAR - tmpTarget: Operand; - typesIdentical: BOOLEAN; - targetType, sourceType: Services.Type; - BEGIN - IF (target # NIL) & (target.if = source.if) THEN - Services.GetType(target, targetType); - Services.GetType(source, sourceType); - typesIdentical := targetType = sourceType; - ELSE - typesIdentical := FALSE; + TYPE + CapabilitySet* = SET; (* SET OF [add..cmp] *) + CreateProc* = PROCEDURE (VAR op: Operand); + (* should call Operations.Init for op *) + OperatorProc* = PROCEDURE (op: Operation; op1, op2: Operand; + VAR result: Operand); + AssignProc* = PROCEDURE (VAR target: Operand; source: Operand); + CompareProc* = PROCEDURE (op1, op2: Operand) : INTEGER; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; + assign*: AssignProc; + op*: OperatorProc; + compare*: CompareProc; END; - IF typesIdentical THEN - source.if.assign(target, source); - ELSE - source.if.create(tmpTarget); - source.if.assign(tmpTarget, source); - target := tmpTarget; - END; - END Assign; - PROCEDURE Copy*(source, target: Operand); - BEGIN + TYPE + OperandRec* = + RECORD + (PersistentDisciplines.ObjectRec) + if: Interface; + caps: CapabilitySet; + END; + VAR + operandType: Services.Type; + + PROCEDURE Init*(op: Operand; if: Interface; caps: CapabilitySet); + VAR + type: Services.Type; + BEGIN + Services.GetType(op, type); ASSERT(type # NIL); + op.if := if; op.caps := caps; + END Init; + + PROCEDURE Capabilities*(op: Operand) : CapabilitySet; + BEGIN + RETURN op.caps + END Capabilities; + + PROCEDURE Compatible*(op1, op2: Operand) : BOOLEAN; + (* return TRUE if both operands have the same interface *) + BEGIN + RETURN op1.if = op2.if + END Compatible; + + (* the interface of the first operand must match the interface + of all other operands; + the result parameter must be either NIL or already initialized + with the same interface + *) + + PROCEDURE Op(op: Operation; op1, op2: Operand; VAR result: Operand); + + VAR + tmpresult: Operand; + BEGIN + ASSERT(op1.if = op2.if); + ASSERT(op IN op1.caps); + (* we are very defensive here because the type of tmpresult + is perhaps not identical to result or an extension of it; + op1.if.create(result) will not work in all cases + because of type guard failures + *) + op1.if.create(tmpresult); + op1.if.op(op, op1, op2, tmpresult); + result := tmpresult; + END Op; + + PROCEDURE Add*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(add, op1, op2, result); + RETURN result + END Add; + + PROCEDURE Add2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(add, op1, op2, op1); + END Add2; + + PROCEDURE Add3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(add, op1, op2, result); + END Add3; + + PROCEDURE Sub*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(sub, op1, op2, result); + RETURN result + END Sub; + + PROCEDURE Sub2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(sub, op1, op2, op1); + END Sub2; + + PROCEDURE Sub3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(sub, op1, op2, result); + END Sub3; + + PROCEDURE Mul*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(mul, op1, op2, result); + RETURN result + END Mul; + + PROCEDURE Mul2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(mul, op1, op2, op1); + END Mul2; + + PROCEDURE Mul3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(mul, op1, op2, result); + END Mul3; + + PROCEDURE Div*(op1, op2: Operand) : Operand; + VAR result: Operand; + BEGIN + result := NIL; + Op(div, op1, op2, result); + RETURN result + END Div; + + PROCEDURE Div2*(VAR op1: Operand; op2: Operand); + BEGIN + Op(div, op1, op2, op1); + END Div2; + + PROCEDURE Div3*(VAR result: Operand; op1, op2: Operand); + BEGIN + Op(div, op1, op2, result); + END Div3; + + PROCEDURE Compare*(op1, op2: Operand) : INTEGER; + BEGIN + ASSERT(op1.if = op2.if); + ASSERT(cmp IN op1.caps); + RETURN op1.if.compare(op1, op2) + END Compare; + + PROCEDURE Assign*(VAR target: Operand; source: Operand); + VAR + tmpTarget: Operand; + typesIdentical: BOOLEAN; + targetType, sourceType: Services.Type; + BEGIN + IF (target # NIL) & (target.if = source.if) THEN + Services.GetType(target, targetType); + Services.GetType(source, sourceType); + typesIdentical := targetType = sourceType; + ELSE + typesIdentical := FALSE; + END; + IF typesIdentical THEN source.if.assign(target, source); - END Copy; + ELSE + source.if.create(tmpTarget); + source.if.assign(tmpTarget, source); + target := tmpTarget; + END; + END Assign; + + PROCEDURE Copy*(source, target: Operand); + BEGIN + source.if.assign(target, source); + END Copy; BEGIN - PersistentObjects.RegisterType(operandType, - "Operations.Operand", "PersistentDisciplines.Object", NIL); + PersistentObjects.RegisterType(operandType, + "Operations.Operand", "PersistentDisciplines.Object", NIL); END ulmOperations. diff --git a/src/library/ulm/ulmPersistentDisciplines.Mod b/src/library/ulm/ulmPersistentDisciplines.Mod index 8f37d4ce..538b8de6 100644 --- a/src/library/ulm/ulmPersistentDisciplines.Mod +++ b/src/library/ulm/ulmPersistentDisciplines.Mod @@ -1,391 +1,392 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: PersistentD.om,v 1.4 1998/02/22 10:25:22 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: PersistentD.om,v $ - Revision 1.4 1998/02/22 10:25:22 borchert - bug fix in GetObject: Disciplines.Add was missing if the main object - is just an extension of Disciplines.Object and not of - PersistentDisciplines.Object + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: PersistentD.om,v 1.4 1998/02/22 10:25:22 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: PersistentD.om,v $ + Revision 1.4 1998/02/22 10:25:22 borchert + bug fix in GetObject: Disciplines.Add was missing if the main object + is just an extension of Disciplines.Object and not of + PersistentDisciplines.Object - Revision 1.3 1996/07/24 07:41:28 borchert - bug fix: count component was not initialized (with the - exception of CreateObject) -- detected by Martin Hasch + Revision 1.3 1996/07/24 07:41:28 borchert + bug fix: count component was not initialized (with the + exception of CreateObject) -- detected by Martin Hasch - Revision 1.2 1995/03/17 16:13:33 borchert - - persistent disciplines may now be attached to non-persistent objects - - some fixes due to changes of PersistentObjects + Revision 1.2 1995/03/17 16:13:33 borchert + - persistent disciplines may now be attached to non-persistent objects + - some fixes due to changes of PersistentObjects - Revision 1.1 1994/02/22 20:09:12 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:12 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmPersistentDisciplines; - IMPORT Disciplines := ulmDisciplines, Forwarders := ulmForwarders, NetIO := ulmNetIO, Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, - Services := ulmServices, Streams := ulmStreams, SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Forwarders := ulmForwarders, NetIO := ulmNetIO, Objects := ulmObjects, PersistentObjects := ulmPersistentObjects, + Services := ulmServices, Streams := ulmStreams; - CONST - objectName = "PersistentDisciplines.Object"; - disciplineName = "PersistentDisciplines.Discipline"; + CONST + objectName = "PersistentDisciplines.Object"; + disciplineName = "PersistentDisciplines.Discipline"; - TYPE - Identifier* = LONGINT; + TYPE + Identifier* = LONGINT; - Discipline* = POINTER TO DisciplineRec; - DisciplineRec* = - RECORD - (PersistentObjects.ObjectRec) - id*: Identifier; (* should be unique for all types of disciplines *) - END; + Discipline* = POINTER TO DisciplineRec; + DisciplineRec* = + RECORD + (PersistentObjects.ObjectRec) + id*: Identifier; (* should be unique for all types of disciplines *) + END; - DisciplineList = POINTER TO DisciplineListRec; - DisciplineListRec = - RECORD - discipline: Discipline; - id: Identifier; (* copied from discipline.id *) - next: DisciplineList; - END; + DisciplineList = POINTER TO DisciplineListRec; + DisciplineListRec = + RECORD + discipline: Discipline; + id: Identifier; (* copied from discipline.id *) + next: DisciplineList; + END; - Interface = POINTER TO InterfaceRec; - Object = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (PersistentObjects.ObjectRec) - (* private part *) - count: LONGINT; (* number of attached disciplines *) - list: DisciplineList; (* set of disciplines *) - if: Interface; (* overrides builtins if # NIL *) - forwardTo: Object; - usedBy: Object; (* used as target of UseInterfaceOf *) - (* very restrictive way of avoiding reference cycles: - forwardTo references must be built from inner to - outer objects and not vice versa - *) - END; + Interface = POINTER TO InterfaceRec; + Object = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (PersistentObjects.ObjectRec) + (* private part *) + count: LONGINT; (* number of attached disciplines *) + list: DisciplineList; (* set of disciplines *) + if: Interface; (* overrides builtins if # NIL *) + forwardTo: Object; + usedBy: Object; (* used as target of UseInterfaceOf *) + (* very restrictive way of avoiding reference cycles: + forwardTo references must be built from inner to + outer objects and not vice versa + *) + END; - TYPE - VolatileDiscipline = POINTER TO VolatileDisciplineRec; - VolatileDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - object: Object; - END; - VAR - volDiscID: Disciplines.Identifier; + TYPE + VolatileDiscipline = POINTER TO VolatileDisciplineRec; + VolatileDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + object: Object; + END; + VAR + volDiscID: Disciplines.Identifier; - TYPE - AddProc* = PROCEDURE (object: Disciplines.Object; discipline: Discipline); - RemoveProc* = PROCEDURE (object: Disciplines.Object; id: Identifier); - SeekProc* = PROCEDURE (object: Disciplines.Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - add*: AddProc; - remove*: RemoveProc; - seek*: SeekProc; - END; + TYPE + AddProc* = PROCEDURE (object: Disciplines.Object; discipline: Discipline); + RemoveProc* = PROCEDURE (object: Disciplines.Object; id: Identifier); + SeekProc* = PROCEDURE (object: Disciplines.Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + add*: AddProc; + remove*: RemoveProc; + seek*: SeekProc; + END; - VAR - unique: Identifier; - objIf: PersistentObjects.Interface; - objDatatype, discDatatype: Services.Type; + VAR + unique: Identifier; + objIf: PersistentObjects.Interface; + objDatatype, discDatatype: Services.Type; - CONST - hashtabsize = 32; - TYPE - Sample = POINTER TO SampleRec; - SampleRec = - RECORD - id: Identifier; - sample: Discipline; - next: Sample; - END; - BucketTable = ARRAY hashtabsize OF Sample; - VAR - samples: BucketTable; + CONST + hashtabsize = 32; + TYPE + Sample = POINTER TO SampleRec; + SampleRec = + RECORD + id: Identifier; + sample: Discipline; + next: Sample; + END; + BucketTable = ARRAY hashtabsize OF Sample; + VAR + samples: BucketTable; - PROCEDURE CreateObject*(VAR object: Object); - (* creates a new object; this procedures should be called instead of - NEW for objects of type `Object' + PROCEDURE CreateObject*(VAR object: Object); + (* creates a new object; this procedures should be called instead of + NEW for objects of type `Object' + *) + BEGIN + NEW(object); + object.count := 0; (* up to now, there are no attached disciplines *) + object.list := NIL; + object.if := NIL; + PersistentObjects.Init(object, objDatatype); + END CreateObject; + + PROCEDURE GetObject(obj: Disciplines.Object; VAR object: Object); + VAR + disc: Disciplines.Discipline; + vdisc: VolatileDiscipline; + BEGIN + IF obj IS Object THEN + object := obj(Object); + (* initialize private components now if not done already; + we assume here that pointers which have not been + initialized yet are defined to be NIL + (because of the garbage collection); + a similar assumption does not necessarily hold for + other types (e.g. integers) *) - BEGIN - NEW(object); - object.count := 0; (* up to now, there are no attached disciplines *) - object.list := NIL; - object.if := NIL; - PersistentObjects.Init(object, objDatatype); - END CreateObject; + IF object.list = NIL THEN + object.count := 0; + END; + ELSIF Disciplines.Seek(obj, volDiscID, disc) THEN + object := disc(VolatileDiscipline).object; + ELSE + CreateObject(object); + NEW(vdisc); vdisc.id := volDiscID; vdisc.object := object; + Disciplines.Add(obj, vdisc); + END; + END GetObject; - PROCEDURE GetObject(obj: Disciplines.Object; VAR object: Object); - VAR - disc: VolatileDiscipline; - BEGIN - IF obj IS Object THEN - object := obj(Object); - (* initialize private components now if not done already; - we assume here that pointers which have not been - initialized yet are defined to be NIL - (because of the garbage collection); - a similar assumption does not necessarily hold for - other types (e.g. integers) - *) - IF object.list = NIL THEN - object.count := 0; - END; - ELSIF Disciplines.Seek(obj, volDiscID, SYS.VAL(Disciplines.Discipline, disc)) THEN - object := disc.object; + (* === normal stuff for disciplines ===================================== *) + + PROCEDURE Unique*(sample: Discipline) : Identifier; + (* returns a unique identifier; + this procedure should be called during initialization by + all modules defining a discipline type; + a sample of the associated discipline has to be provided + *) + VAR + hashval: Identifier; + entry: Sample; + BEGIN + INC(unique); + NEW(entry); entry.id := unique; entry.sample := sample; + hashval := unique MOD hashtabsize; + entry.next := samples[hashval]; samples[hashval] := entry; + RETURN unique + END Unique; + + PROCEDURE GetSample*(id: Identifier) : Discipline; + (* return sample for the given identifier; + NIL will be returned if id has not yet been returned by Unique + *) + VAR + hashval: Identifier; + ptr: Sample; + BEGIN + hashval := id MOD hashtabsize; + ptr := samples[hashval]; + WHILE (ptr # NIL) & (ptr.id # id) DO + ptr := ptr.next; + END; + IF ptr # NIL THEN + RETURN ptr.sample + ELSE + RETURN NIL + END; + END GetSample; + + PROCEDURE AttachInterface*(object: Disciplines.Object; if: Interface); + (* override the builtin implementations of Add, Remove and + Seek for `object' with the implementations given by `if' + *) + VAR + po: Object; + BEGIN + GetObject(object, po); + IF (po.list = NIL) & (po.forwardTo = NIL) THEN + po.if := if; + END; + END AttachInterface; + + PROCEDURE UseInterfaceOf*(object, host: Disciplines.Object); + (* forward Add, Remove and Seek operations from object to host *) + VAR + po, phost: Object; + BEGIN + GetObject(object, po); GetObject(host, phost); + IF (po.list = NIL) & (po.forwardTo = NIL) & + (po.usedBy = NIL) THEN + po.forwardTo := phost; + phost.usedBy := po; (* avoid reference cycles *) + END; + END UseInterfaceOf; + + PROCEDURE Forward(from, to: Forwarders.Object); + BEGIN + UseInterfaceOf(from, to); + END Forward; + + PROCEDURE Remove*(object: Disciplines.Object; id: Identifier); + (* remove the discipline with the given id from object, if it exists *) + VAR + po: Object; + prev, dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + prev := NIL; + dl := po.list; + WHILE (dl # NIL) & (dl.id # id) DO + prev := dl; dl := dl.next; + END; + IF dl # NIL THEN + IF prev = NIL THEN + po.list := dl.next; + ELSE + prev.next := dl.next; + END; + DEC(po.count); (* discipline removed *) + END; + ELSE + po.if.remove(po, id); + END; + END Remove; + + PROCEDURE Add*(object: Disciplines.Object; discipline: Discipline); + (* adds a new discipline to the given object; + if already a discipline with the same identifier exist + it is deleted first + *) + VAR + po: Object; + dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + dl := po.list; + WHILE (dl # NIL) & (dl.id # discipline.id) DO + dl := dl.next; + END; + IF dl = NIL THEN + NEW(dl); + dl.id := discipline.id; + dl.next := po.list; + po.list := dl; + INC(po.count); (* discipline added *) + END; + dl.discipline := discipline; + ELSE + po.if.add(po, discipline); + END; + END Add; + + PROCEDURE Seek*(object: Disciplines.Object; id: Identifier; + VAR discipline: Discipline) : BOOLEAN; + (* returns TRUE if a discipline with the given id is found *) + VAR + po: Object; + dl: DisciplineList; + BEGIN + GetObject(object, po); + WHILE po.forwardTo # NIL DO + po := po.forwardTo; + END; + IF po.if = NIL THEN + dl := po.list; + WHILE (dl # NIL) & (dl.id # id) DO + dl := dl.next; + END; + IF dl # NIL THEN + discipline := dl.discipline; ELSE - CreateObject(object); - NEW(disc); disc.id := volDiscID; disc.object := object; - Disciplines.Add(obj, disc); + discipline := NIL; END; - END GetObject; + RETURN discipline # NIL + ELSE + RETURN po.if.seek(po, id, discipline) + END; + END Seek; - (* === normal stuff for disciplines ===================================== *) + (* === interface procedures for PersistentObjects for Object === *) - PROCEDURE Unique*(sample: Discipline) : Identifier; - (* returns a unique identifier; - this procedure should be called during initialization by - all modules defining a discipline type; - a sample of the associated discipline has to be provided - *) - VAR - hashval: Identifier; - entry: Sample; - BEGIN - INC(unique); - NEW(entry); entry.id := unique; entry.sample := sample; - hashval := unique MOD hashtabsize; - entry.next := samples[hashval]; samples[hashval] := entry; - RETURN unique - END Unique; + PROCEDURE ReadObjectData(stream: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + (* read data and attached disciplines of given object from stream *) + VAR + discipline: PersistentObjects.Object; (* Discipline *) + count: LONGINT; + BEGIN + (* get number of attached disciplines *) + IF ~NetIO.ReadLongInt(stream, count) THEN + RETURN FALSE; + END; + (* read all disciplines from `stream' and attach them to `object' *) + WHILE count > 0 DO + IF ~PersistentObjects.Read(stream, discipline) THEN + RETURN FALSE; + END; + Add(object(Object), discipline(Discipline)); + DEC(count); + END; + RETURN TRUE; + END ReadObjectData; - PROCEDURE GetSample*(id: Identifier) : Discipline; - (* return sample for the given identifier; - NIL will be returned if id has not yet been returned by Unique - *) - VAR - hashval: Identifier; - ptr: Sample; - BEGIN - hashval := id MOD hashtabsize; - ptr := samples[hashval]; - WHILE (ptr # NIL) & (ptr.id # id) DO - ptr := ptr.next; + PROCEDURE WriteObjectData(stream: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + (* write data and attached disciplines of given object to stream *) + VAR + dl: DisciplineList; + BEGIN + WITH object: Object DO + (* write number of attached disciplines to `stream' *) + IF ~NetIO.WriteLongInt(stream, object.count) THEN + RETURN FALSE; END; - IF ptr # NIL THEN - RETURN ptr.sample - ELSE - RETURN NIL + (* write all attached disciplines to the stream *) + dl := object.list; + WHILE dl # NIL DO + IF ~PersistentObjects.Write(stream, dl.discipline) THEN + RETURN FALSE; + END; + dl := dl.next; END; - END GetSample; + END; + RETURN TRUE; + END WriteObjectData; - PROCEDURE AttachInterface*(object: Disciplines.Object; if: Interface); - (* override the builtin implementations of Add, Remove and - Seek for `object' with the implementations given by `if' - *) - VAR - po: Object; - BEGIN - GetObject(object, po); - IF (po.list = NIL) & (po.forwardTo = NIL) THEN - po.if := if; - END; - END AttachInterface; - - PROCEDURE UseInterfaceOf*(object, host: Disciplines.Object); - (* forward Add, Remove and Seek operations from object to host *) - VAR - po, phost: Object; - BEGIN - GetObject(object, po); GetObject(host, phost); - IF (po.list = NIL) & (po.forwardTo = NIL) & - (po.usedBy = NIL) THEN - po.forwardTo := phost; - phost.usedBy := po; (* avoid reference cycles *) - END; - END UseInterfaceOf; - - PROCEDURE Forward(from, to: Forwarders.Object); - BEGIN - UseInterfaceOf(from, to); - END Forward; - - PROCEDURE Remove*(object: Disciplines.Object; id: Identifier); - (* remove the discipline with the given id from object, if it exists *) - VAR - po: Object; - prev, dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - prev := NIL; - dl := po.list; - WHILE (dl # NIL) & (dl.id # id) DO - prev := dl; dl := dl.next; - END; - IF dl # NIL THEN - IF prev = NIL THEN - po.list := dl.next; - ELSE - prev.next := dl.next; - END; - DEC(po.count); (* discipline removed *) - END; - ELSE - po.if.remove(po, id); - END; - END Remove; - - PROCEDURE Add*(object: Disciplines.Object; discipline: Discipline); - (* adds a new discipline to the given object; - if already a discipline with the same identifier exist - it is deleted first - *) - VAR - po: Object; - dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - dl := po.list; - WHILE (dl # NIL) & (dl.id # discipline.id) DO - dl := dl.next; - END; - IF dl = NIL THEN - NEW(dl); - dl.id := discipline.id; - dl.next := po.list; - po.list := dl; - INC(po.count); (* discipline added *) - END; - dl.discipline := discipline; - ELSE - po.if.add(po, discipline); - END; - END Add; - - PROCEDURE Seek*(object: Disciplines.Object; id: Identifier; - VAR discipline: Discipline) : BOOLEAN; - (* returns TRUE if a discipline with the given id is found *) - VAR - po: Object; - dl: DisciplineList; - BEGIN - GetObject(object, po); - WHILE po.forwardTo # NIL DO - po := po.forwardTo; - END; - IF po.if = NIL THEN - dl := po.list; - WHILE (dl # NIL) & (dl.id # id) DO - dl := dl.next; - END; - IF dl # NIL THEN - discipline := dl.discipline; - ELSE - discipline := NIL; - END; - RETURN discipline # NIL - ELSE - RETURN po.if.seek(po, id, discipline) - END; - END Seek; - - (* === interface procedures for PersistentObjects for Object === *) - - PROCEDURE ReadObjectData(stream: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - (* read data and attached disciplines of given object from stream *) - VAR - discipline: Discipline; - count: LONGINT; - BEGIN - (* get number of attached disciplines *) - IF ~NetIO.ReadLongInt(stream, count) THEN - RETURN FALSE; - END; - (* read all disciplines from `stream' and attach them to `object' *) - WHILE count > 0 DO - IF ~PersistentObjects.Read(stream, SYS.VAL(PersistentObjects.Object, discipline)) THEN - RETURN FALSE; - END; - Add(object(Object), discipline); - DEC(count); - END; - RETURN TRUE; - END ReadObjectData; - - PROCEDURE WriteObjectData(stream: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - (* write data and attached disciplines of given object to stream *) - VAR - dl: DisciplineList; - BEGIN - WITH object: Object DO - (* write number of attached disciplines to `stream' *) - IF ~NetIO.WriteLongInt(stream, object.count) THEN - RETURN FALSE; - END; - (* write all attached disciplines to the stream *) - dl := object.list; - WHILE dl # NIL DO - IF ~PersistentObjects.Write(stream, dl.discipline) THEN - RETURN FALSE; - END; - dl := dl.next; - END; - END; - RETURN TRUE; - END WriteObjectData; - - PROCEDURE InternalCreate(VAR obj: PersistentObjects.Object); - VAR - myObject: Object; - BEGIN - CreateObject(myObject); - obj := myObject; - END InternalCreate; + PROCEDURE InternalCreate(VAR obj: PersistentObjects.Object); + VAR + myObject: Object; + BEGIN + CreateObject(myObject); + obj := myObject; + END InternalCreate; BEGIN - unique := 0; + unique := 0; - NEW(objIf); - objIf.read := ReadObjectData; - objIf.write := WriteObjectData; - objIf.create := InternalCreate; - objIf.createAndRead := NIL; - PersistentObjects.RegisterType(objDatatype, objectName, "", objIf); - PersistentObjects.RegisterType(discDatatype, disciplineName, "", NIL); + NEW(objIf); + objIf.read := ReadObjectData; + objIf.write := WriteObjectData; + objIf.create := InternalCreate; + objIf.createAndRead := NIL; + PersistentObjects.RegisterType(objDatatype, objectName, "", objIf); + PersistentObjects.RegisterType(discDatatype, disciplineName, "", NIL); - volDiscID := Disciplines.Unique(); + volDiscID := Disciplines.Unique(); - Forwarders.Register("", Forward); + Forwarders.Register("", Forward); END ulmPersistentDisciplines. diff --git a/src/library/ulm/ulmPersistentObjects.Mod b/src/library/ulm/ulmPersistentObjects.Mod index 3f82e089..c64b4fc0 100644 --- a/src/library/ulm/ulmPersistentObjects.Mod +++ b/src/library/ulm/ulmPersistentObjects.Mod @@ -1,1079 +1,1086 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: PersistentO.om,v 1.8 2004/03/30 13:14:16 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: PersistentO.om,v $ - Revision 1.8 2004/03/30 13:14:16 borchert - introduced more elaborate error events for cannotReadData + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: PersistentO.om,v 1.8 2004/03/30 13:14:16 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: PersistentO.om,v $ + Revision 1.8 2004/03/30 13:14:16 borchert + introduced more elaborate error events for cannotReadData - Revision 1.7 1998/04/09 16:55:48 borchert - bug fix: ReadTypeInfo failed on hierarchical mode if none of the - types were known by returning TRUE with type set to NIL + Revision 1.7 1998/04/09 16:55:48 borchert + bug fix: ReadTypeInfo failed on hierarchical mode if none of the + types were known by returning TRUE with type set to NIL - Revision 1.6 1998/03/24 22:42:28 borchert - improvements: - - it is now acceptable that read and write if procedures are given - but neither create nor createAndRead -- this is fine for - abstractions that maintain some components - - Read operates now immediately on the given object to support - LinearizedStructures -- otherwise it would be nearly impossible - to reconstruct self-referential data structures; - note that this is *not supported* by GuardedRead + Revision 1.6 1998/03/24 22:42:28 borchert + improvements: + - it is now acceptable that read and write if procedures are given + but neither create nor createAndRead -- this is fine for + abstractions that maintain some components + - Read operates now immediately on the given object to support + LinearizedStructures -- otherwise it would be nearly impossible + to reconstruct self-referential data structures; + note that this is *not supported* by GuardedRead - Revision 1.5 1995/04/04 12:36:39 borchert - major redesign of PersistentObjects: - - new type encoding schemes - - size if proc removed - - support for NIL and guards added + Revision 1.5 1995/04/04 12:36:39 borchert + major redesign of PersistentObjects: + - new type encoding schemes + - size if proc removed + - support for NIL and guards added - Revision 1.4 1994/07/18 14:19:13 borchert - bug fix: SizeOf used uninitialized variable (name) and added the - length of all type names of the hierarchy to the sum + Revision 1.4 1994/07/18 14:19:13 borchert + bug fix: SizeOf used uninitialized variable (name) and added the + length of all type names of the hierarchy to the sum - Revision 1.3 1994/07/05 08:47:26 borchert - bug fix: modifications due to last bug fix didn't work correctly in - in all cases - code cleaned up at several locations + Revision 1.3 1994/07/05 08:47:26 borchert + bug fix: modifications due to last bug fix didn't work correctly in + in all cases + code cleaned up at several locations - Revision 1.2 1994/03/25 15:54:09 borchert - bug fix: the complete type hierarchy together with all abstract types - was written -- this caused a NIL-procedure to be called in - case of projections. Now, we write shorter type hierarchies and - GetCreate checks the create-procedure against NIL + Revision 1.2 1994/03/25 15:54:09 borchert + bug fix: the complete type hierarchy together with all abstract types + was written -- this caused a NIL-procedure to be called in + case of projections. Now, we write shorter type hierarchies and + GetCreate checks the create-procedure against NIL - Revision 1.1 1994/02/22 20:09:21 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:21 borchert + Initial revision - ---------------------------------------------------------------------------- - DB 7/93 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + DB 7/93 + ---------------------------------------------------------------------------- *) MODULE ulmPersistentObjects; - (* handling of persistent objects *) + (* handling of persistent objects *) - IMPORT ASCII := ulmASCII, ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Errors := ulmErrors, Events := ulmEvents, Forwarders := ulmForwarders, - IndirectDisciplines := ulmIndirectDisciplines, Loader := ulmLoader, NetIO := ulmNetIO, Objects := ulmObjects, Priorities := ulmPriorities, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM; + IMPORT ASCII := ulmASCII, ConstStrings := ulmConstStrings, Disciplines := ulmDisciplines, Errors := ulmErrors, Events := ulmEvents, Forwarders := ulmForwarders, + IndirectDisciplines := ulmIndirectDisciplines, Loader := ulmLoader, NetIO := ulmNetIO, Objects := ulmObjects, Priorities := ulmPriorities, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, StreamDisciplines := ulmStreamDisciplines, Streams := ulmStreams, Strings := ulmStrings, Texts := ulmTexts, SYS := SYSTEM; - CONST - maxNameLen = 128; (* max length of data type names *) - TYPE - TypeName = ARRAY maxNameLen OF CHAR; (* for temporary use only *) - ShortTypeName = ARRAY 32 OF CHAR; (* for error messages only *) + CONST + maxNameLen = 128; (* max length of data type names *) + TYPE + TypeName = ARRAY maxNameLen OF CHAR; (* for temporary use only *) + ShortTypeName = ARRAY 32 OF CHAR; (* for error messages only *) - CONST - cannotReadData* = 0; - cannotWriteData* = 1; - cannotReadType* = 2; - cannotWriteType* = 3; - invalidType* = 4; - unknownType* = 5; - otherTypeHier* = 6; - eofReached* = 7; - cannotSkip* = 8; - typeGuardFailure* = 9; (* GuardedRead failed to type guard failure *) - errorcodes* = 10; (* number of error codes *) + CONST + cannotReadData* = 0; + cannotWriteData* = 1; + cannotReadType* = 2; + cannotWriteType* = 3; + invalidType* = 4; + unknownType* = 5; + otherTypeHier* = 6; + eofReached* = 7; + cannotSkip* = 8; + typeGuardFailure* = 9; (* GuardedRead failed to type guard failure *) + errorcodes* = 10; (* number of error codes *) - (* how are types specified: fullTypeName, typeCode, incrTypeCode - with or without size info: withSize, withoutSize - with or without type hier: withHier, withoutHier + (* how are types specified: fullTypeName, typeCode, incrTypeCode + with or without size info: withSize, withoutSize + with or without type hier: withHier, withoutHier - combinations are given as additions, - e.g. typeCode + withSize + withHier - *) - fullTypeName* = 1; typeCode* = 2; incrTypeCode* = 3; - withSize* = 4; withoutSize* = 0; - withHier* = 8; withoutHier* = 0; + combinations are given as additions, + e.g. typeCode + withSize + withHier + *) + fullTypeName* = 1; typeCode* = 2; incrTypeCode* = 3; + withSize* = 4; withoutSize* = 0; + withHier* = 8; withoutHier* = 0; - defaultMode = fullTypeName + withSize + withHier; - (* provide all informations on default *) + defaultMode = fullTypeName + withSize + withHier; + (* provide all informations on default *) - (* forms: - type spec: codeF | incrF | nameF | incrhierF | hierF - size spec: sizeF | noSizeF - add specs, eg. codeF + sizeF - *) - codeF = 1; (* just a type code *) - incrF = 2; (* type name + code given *) - nameF = 3; (* type name given *) - incrhierF = 4; (* type hierarchy with codes *) - hierF = 5; (* type hierarchy without codes *) - sizeF = 8; (* size information given *) - noSizeF = 0; (* no size information given *) - maskF = 8; - maxF = 13; (* maximal valid form code *) + (* forms: + type spec: codeF | incrF | nameF | incrhierF | hierF + size spec: sizeF | noSizeF + add specs, eg. codeF + sizeF + *) + codeF = 1; (* just a type code *) + incrF = 2; (* type name + code given *) + nameF = 3; (* type name given *) + incrhierF = 4; (* type hierarchy with codes *) + hierF = 5; (* type hierarchy without codes *) + sizeF = 8; (* size information given *) + noSizeF = 0; (* no size information given *) + maskF = 8; + maxF = 13; (* maximal valid form code *) - TYPE - Mode* = SHORTINT; - Form = SHORTINT; + TYPE + Mode* = SHORTINT; + Form = SHORTINT; - Object* = POINTER TO ObjectRec; - Type = POINTER TO TypeRec; + Object* = POINTER TO ObjectRec; + Type = POINTER TO TypeRec; - ReadProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; - WriteProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; - CreateProc* = PROCEDURE (VAR o: Object); - CreateAndReadProc* = PROCEDURE (s: Streams.Stream; - create: BOOLEAN; - VAR o: Object) : BOOLEAN; + ReadProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; + WriteProc* = PROCEDURE (s: Streams.Stream; o: Object) : BOOLEAN; + CreateProc* = PROCEDURE (VAR o: Object); + CreateAndReadProc* = PROCEDURE (s: Streams.Stream; + create: BOOLEAN; + VAR o: Object) : BOOLEAN; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; (* create object *) - read*: ReadProc; (* read data from stream *) - write*: WriteProc; (* write data to stream *) - createAndRead*: CreateAndReadProc; (* replaces create & read *) - END; + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; (* create object *) + read*: ReadProc; (* read data from stream *) + write*: WriteProc; (* write data to stream *) + createAndRead*: CreateAndReadProc; (* replaces create & read *) + END; - ObjectRec* = - RECORD - (Services.ObjectRec) - (* private data *) - type: Type; - projected: BOOLEAN; (* set after Read *) - END; + ObjectRec* = + RECORD + (Services.ObjectRec) + (* private data *) + type: Type; + projected: BOOLEAN; (* set after Read *) + END; - CONST - ttlen = 16; - TYPE - TypeEntry = POINTER TO TypeEntryRec; - TypeEntryRec = - RECORD - code: LONGINT; - type: Type; - next: TypeEntry; - END; - TypeTable = ARRAY ttlen OF TypeEntry; - StreamDiscipline = POINTER TO StreamDisciplineRec; - StreamDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - mode: Mode; (* type encoding mode for the stream *) - rtypes, wtypes: TypeTable; - END; + CONST + ttlen = 16; + TYPE + TypeEntry = POINTER TO TypeEntryRec; + TypeEntryRec = + RECORD + code: LONGINT; + type: Type; + next: TypeEntry; + END; + TypeTable = ARRAY ttlen OF TypeEntry; + StreamDiscipline = POINTER TO StreamDisciplineRec; + StreamDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + mode: Mode; (* type encoding mode for the stream *) + rtypes, wtypes: TypeTable; + END; - InterfaceList = POINTER TO InterfaceListRec; - InterfaceListRec = - RECORD - if: Interface; - next: InterfaceList; (* points to next extension *) - END; - TypeRec = - RECORD - (Services.TypeRec) - baseType: Type; (* the next non-abstract base type *) - if: Interface; (* may be = NIL for abstract types *) - ifs: InterfaceList; (* list of interfaces in reverse order *) - code: LONGINT; (* unique number *) - END; + InterfaceList = POINTER TO InterfaceListRec; + InterfaceListRec = + RECORD + if: Interface; + next: InterfaceList; (* points to next extension *) + END; + TypeRec = + RECORD + (Services.TypeRec) + baseType: Type; (* the next non-abstract base type *) + if: Interface; (* may be = NIL for abstract types *) + ifs: InterfaceList; (* list of interfaces in reverse order *) + code: LONGINT; (* unique number *) + END; - (* this list is used for storing the base type list of an object during - reading this object - *) - BaseTypeList = POINTER TO BaseTypeRec; - BaseTypeRec = - RECORD - name: ConstStrings.String; (* name of the base type *) - next: BaseTypeList; - END; + (* this list is used for storing the base type list of an object during + reading this object + *) + BaseTypeList = POINTER TO BaseTypeRec; + BaseTypeRec = + RECORD + name: ConstStrings.String; (* name of the base type *) + next: BaseTypeList; + END; - (* each error causes an event; the error number is stored in - event.errorcode; the associated text can be taken from event.message - *) - ErrorCode = SHORTINT; - Event = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - stream*: Streams.Stream; - errorcode*: ErrorCode; - END; - UnknownTypeEvent = POINTER TO UnknownTypeEventRec; - UnknownTypeEventRec = - RECORD - (EventRec) - typeName: ARRAY 80 OF CHAR; - END; - DecodeFailureEvent = POINTER TO DecodeFailureEventRec; - DecodeFailureEventRec = - RECORD - (EventRec) - objectType: Services.Type; - END; - TypeGuardFailureEvent = POINTER TO TypeGuardFailureEventRec; - TypeGuardFailureEventRec = - RECORD - (EventRec) - found, expected: Services.Type; - END; + (* each error causes an event; the error number is stored in + event.errorcode; the associated text can be taken from event.message + *) + ErrorCode = SHORTINT; + Event = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + stream*: Streams.Stream; + errorcode*: ErrorCode; + END; + UnknownTypeEvent = POINTER TO UnknownTypeEventRec; + UnknownTypeEventRec = + RECORD + (EventRec) + typeName: ARRAY 80 OF CHAR; + END; + DecodeFailureEvent = POINTER TO DecodeFailureEventRec; + DecodeFailureEventRec = + RECORD + (EventRec) + objectType: Services.Type; + END; + TypeGuardFailureEvent = POINTER TO TypeGuardFailureEventRec; + TypeGuardFailureEventRec = + RECORD + (EventRec) + found, expected: Services.Type; + END; - VAR - id: Disciplines.Identifier; - nextTypeCode: LONGINT; (* for the generation of unique numbers *) - potype: Services.Type; + VAR + id: Disciplines.Identifier; + nextTypeCode: LONGINT; (* for the generation of unique numbers *) + potype: Services.Type; - errormsg*: ARRAY errorcodes OF Events.Message; - (* readable text for error codes *) - error*: Events.EventType; - (* raised on failed stream operations; ignored by default *) + errormsg*: ARRAY errorcodes OF Events.Message; + (* readable text for error codes *) + error*: Events.EventType; + (* raised on failed stream operations; ignored by default *) - (* ===== for internal use only ========================================== *) + (* ===== for internal use only ========================================== *) - PROCEDURE Error(stream: Streams.Stream; code: ErrorCode); - (* raise an error event with the error code `code' *) + PROCEDURE Error(stream: Streams.Stream; code: ErrorCode); + (* raise an error event with the error code `code' *) + VAR + event: Event; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.stream := stream; + event.errorcode := code; + RelatedEvents.Raise(stream, event); + END Error; + + PROCEDURE UnknownType(stream: Streams.Stream; typeName: ARRAY OF CHAR); + VAR + event: UnknownTypeEvent; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[unknownType]; + event.stream := stream; + event.errorcode := unknownType; + COPY(typeName, event.typeName); + RelatedEvents.Raise(stream, event); + END UnknownType; + + PROCEDURE TypeGuardFailure(stream: Streams.Stream; + found, expected: Services.Type); + VAR + event: TypeGuardFailureEvent; + BEGIN + stream.count := 0; + NEW(event); + event.type := error; + event.message := errormsg[typeGuardFailure]; + event.stream := stream; + event.errorcode := typeGuardFailure; + event.found := found; + event.expected := expected; + RelatedEvents.Raise(stream, event); + END TypeGuardFailure; + + PROCEDURE WriteEvent(s: Streams.Stream; event: Events.Event); + + VAR + typename: ARRAY 128 OF CHAR; + + PROCEDURE WriteString(s: Streams.Stream; + string: ARRAY OF CHAR) : BOOLEAN; + BEGIN + RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) + END WriteString; + + PROCEDURE WriteLn(s: Streams.Stream) : BOOLEAN; VAR - event: Event; - BEGIN - stream.count := 0; + lineterm: StreamDisciplines.LineTerminator; + width: INTEGER; + BEGIN + StreamDisciplines.GetLineTerm(s, lineterm); + IF ~WriteString(s, lineterm) THEN RETURN FALSE END; + StreamDisciplines.GetIndentationWidth(s, width); + WHILE width > 0 DO + IF ~Streams.WriteByte(s, " ") THEN RETURN FALSE END; + DEC(width); + END; + RETURN TRUE + END WriteLn; + + PROCEDURE WriteType(s: Streams.Stream; + type: Services.Type) : BOOLEAN; + VAR + name: TypeName; + BEGIN + Services.GetTypeName(type, name); + RETURN Streams.WriteByte(s, ASCII.quote) & + WriteString(s, name) & + Streams.WriteByte(s, ASCII.quote) + END WriteType; + + BEGIN + IF event IS UnknownTypeEvent THEN + WITH event: UnknownTypeEvent DO + IF WriteString(s, event.message) & + WriteString(s, ": ") & + Streams.WriteByte(s, ASCII.quote) & + WriteString(s, event.typeName) & + Streams.WriteByte(s, ASCII.quote) THEN + END; + END; + ELSIF event IS TypeGuardFailureEvent THEN + WITH event: TypeGuardFailureEvent DO + IF WriteString(s, event.message) & + WriteString(s, ":") & + WriteLn(s) & + WriteString(s, "expected extension of ") & + WriteType(s, event.expected) & + WriteString(s, " but got ") & + WriteType(s, event.found) THEN + END; + END; + ELSIF event IS DecodeFailureEvent THEN + WITH event: DecodeFailureEvent DO + Services.GetTypeName(event.objectType, typename); + IF WriteString(s, event.message) & + WriteString(s, ":") & + WriteLn(s) & + WriteString(s, "unable to parse object of type ") & + Streams.WriteByte(s, ASCII.quote) & + WriteString(s, typename) & + Streams.WriteByte(s, ASCII.quote) THEN + END; + END; + ELSE + IF WriteString(s, event.message) THEN END; + END; + END WriteEvent; + + PROCEDURE InitErrorHandling; + BEGIN + errormsg[cannotReadData] := "cannot read data part of persistent object"; + errormsg[cannotWriteData] := "cannot write data part of persistent object"; + errormsg[cannotReadType] := "cannot read type of persistent object"; + errormsg[cannotWriteType] := "cannot write type of persistent object"; + errormsg[invalidType] := "invalid type form read"; + errormsg[unknownType] := "unknown type information found"; + errormsg[otherTypeHier] := "different & nonconforming type hierarchy found"; + errormsg[eofReached] := "unexpected EOF encountered during reading"; + errormsg[cannotSkip] := "unable to skip unknown data parts"; + errormsg[typeGuardFailure] := "read object is of unexpected type"; + + Events.Define(error); + Events.SetPriority(error, Priorities.liberrors); + Events.Ignore(error); + Errors.AssignWriteProcedure(error, WriteEvent); + END InitErrorHandling; + + (* ==== marshalling procedures ======================================== *) + + (* encoding scheme: + + Object = Form Type Size ObjectInfo . + Form = SHORTINT; + Type = Code (* codeF *) | + Code TypeName (* incrF *) | + TypeName (* nameF *) | + Code TypeName { Code TypeName } 0 (* incrhierF *) | + TypeName { TypeName } 0X (* hierF *) . + Size = (* noSizeF *) | + Size (* sizeF *) . (* size of object info in bytes *) + ObjectInfo = { Byte } . + *) + + PROCEDURE DecodeForm(form: Form; + VAR nameGiven, codeGiven, hier, size: BOOLEAN); + VAR + typeform: SHORTINT; + sizeform: SHORTINT; + BEGIN + typeform := form MOD maskF; sizeform := form DIV maskF; + nameGiven := typeform IN {incrF, nameF, hierF, incrhierF}; + codeGiven := typeform IN {codeF, incrF, incrhierF}; + hier := (typeform = incrhierF) OR (typeform = hierF); + size := (sizeform = sizeF); + END DecodeForm; + + PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); + (* get the name of the module where 'name' was defined *) + VAR + index: INTEGER; + BEGIN + index := 0; + WHILE (name[index] # ".") & (name[index] # 0X) & + (index < LEN(module)-1) DO + module[index] := name[index]; INC(index); + END; + module[index] := 0X; + END GetModule; + + PROCEDURE Failure(s: Streams.Stream; code: ErrorCode); + BEGIN + IF s.eof THEN + Error(s, eofReached); + ELSE + Error(s, code); + END; + END Failure; + + PROCEDURE DecodeFailure(s: Streams.Stream; type: Services.Type); + VAR + event: DecodeFailureEvent; + BEGIN + IF s.eof THEN + Error(s, eofReached); + ELSE NEW(event); event.type := error; - event.message := errormsg[code]; - event.stream := stream; - event.errorcode := code; - RelatedEvents.Raise(stream, event); - END Error; + event.message := errormsg[cannotReadData]; + event.stream := s; + event.errorcode := cannotReadData; + event.objectType := type; + RelatedEvents.Raise(s, event); + END; + END DecodeFailure; - PROCEDURE UnknownType(stream: Streams.Stream; typeName: ARRAY OF CHAR); + PROCEDURE GetStreamDisc(s: Streams.Stream; VAR disc: StreamDiscipline); + VAR d: IndirectDisciplines.Discipline; + BEGIN + IF IndirectDisciplines.Seek(s, id, d) THEN + disc := d(StreamDiscipline) + ELSE + NEW(disc); disc.id := id; disc.mode := defaultMode; + IndirectDisciplines.Add(s, disc); + END; + END GetStreamDisc; + + PROCEDURE ReadTypeInfo(s: Streams.Stream; VAR type: Type; + VAR projection: BOOLEAN; + VAR size: Streams.Count) : BOOLEAN; + VAR + form: Form; + btype: Type; + nameGiven, codeGiven, hier, sizeGiven: BOOLEAN; + disc: StreamDiscipline; + sentinelFound, unknownTypeFound: BOOLEAN; + lastType: Type; + + PROCEDURE ReadType(s: Streams.Stream; VAR type: Type; + VAR sentinelFound, unknownTypeFound: BOOLEAN) : BOOLEAN; VAR - event: UnknownTypeEvent; - BEGIN - stream.count := 0; - NEW(event); - event.type := error; - event.message := errormsg[unknownType]; - event.stream := stream; - event.errorcode := unknownType; - COPY(typeName, event.typeName); - RelatedEvents.Raise(stream, event); - END UnknownType; + code: LONGINT; + entry: TypeEntry; + typeName: TypeName; + btype: Type; - PROCEDURE TypeGuardFailure(stream: Streams.Stream; - found, expected: Services.Type); - VAR - event: TypeGuardFailureEvent; - BEGIN - stream.count := 0; - NEW(event); - event.type := error; - event.message := errormsg[typeGuardFailure]; - event.stream := stream; - event.errorcode := typeGuardFailure; - event.found := found; - event.expected := expected; - RelatedEvents.Raise(stream, event); - END TypeGuardFailure; - - PROCEDURE WriteEvent(s: Streams.Stream; event: Events.Event); - - VAR - typename: ARRAY 128 OF CHAR; - - PROCEDURE WriteString(s: Streams.Stream; - string: ARRAY OF CHAR) : BOOLEAN; + PROCEDURE SeekType(typeName: ARRAY OF CHAR; + VAR type: Type) : BOOLEAN; + VAR + t: Services.Type; + module: TypeName; BEGIN - RETURN Streams.WritePart(s, string, 0, Strings.Len(string)) - END WriteString; + Services.SeekType(typeName, t); + IF t = NIL THEN + GetModule(typeName, module); + IF Loader.Load(module, s) THEN + (* maybe the type is now registered *) + Services.SeekType(typeName, t); + END; + END; + IF (t # NIL) & (t IS Type) THEN + type := t(Type); RETURN TRUE + END; + RETURN FALSE + END SeekType; - PROCEDURE WriteLn(s: Streams.Stream) : BOOLEAN; - VAR - lineterm: StreamDisciplines.LineTerminator; - width: INTEGER; - BEGIN - StreamDisciplines.GetLineTerm(s, lineterm); - IF ~WriteString(s, lineterm) THEN RETURN FALSE END; - StreamDisciplines.GetIndentationWidth(s, width); - WHILE width > 0 DO - IF ~Streams.WriteByte(s, " ") THEN RETURN FALSE END; - DEC(width); - END; - RETURN TRUE - END WriteLn; - - PROCEDURE WriteType(s: Streams.Stream; - type: Services.Type) : BOOLEAN; - VAR - name: TypeName; - BEGIN - Services.GetTypeName(type, name); - RETURN Streams.WriteByte(s, ASCII.quote) & - WriteString(s, name) & - Streams.WriteByte(s, ASCII.quote) - END WriteType; - - BEGIN - IF event IS UnknownTypeEvent THEN - WITH event: UnknownTypeEvent DO - IF WriteString(s, event.message) & - WriteString(s, ": ") & - Streams.WriteByte(s, ASCII.quote) & - WriteString(s, event.typeName) & - Streams.WriteByte(s, ASCII.quote) THEN - END; - END; - ELSIF event IS TypeGuardFailureEvent THEN - WITH event: TypeGuardFailureEvent DO - IF WriteString(s, event.message) & - WriteString(s, ":") & - WriteLn(s) & - WriteString(s, "expected extension of ") & - WriteType(s, event.expected) & - WriteString(s, " but got ") & - WriteType(s, event.found) THEN - END; - END; - ELSIF event IS DecodeFailureEvent THEN - WITH event: DecodeFailureEvent DO - Services.GetTypeName(event.objectType, typename); - IF WriteString(s, event.message) & - WriteString(s, ":") & - WriteLn(s) & - WriteString(s, "unable to parse object of type ") & - Streams.WriteByte(s, ASCII.quote) & - WriteString(s, typename) & - Streams.WriteByte(s, ASCII.quote) THEN - END; - END; - ELSE - IF WriteString(s, event.message) THEN END; - END; - END WriteEvent; - - PROCEDURE InitErrorHandling; - BEGIN - errormsg[cannotReadData] := "cannot read data part of persistent object"; - errormsg[cannotWriteData] := "cannot write data part of persistent object"; - errormsg[cannotReadType] := "cannot read type of persistent object"; - errormsg[cannotWriteType] := "cannot write type of persistent object"; - errormsg[invalidType] := "invalid type form read"; - errormsg[unknownType] := "unknown type information found"; - errormsg[otherTypeHier] := "different & nonconforming type hierarchy found"; - errormsg[eofReached] := "unexpected EOF encountered during reading"; - errormsg[cannotSkip] := "unable to skip unknown data parts"; - errormsg[typeGuardFailure] := "read object is of unexpected type"; - - Events.Define(error); - Events.SetPriority(error, Priorities.liberrors); - Events.Ignore(error); - Errors.AssignWriteProcedure(error, WriteEvent); - END InitErrorHandling; - - (* ==== marshalling procedures ======================================== *) - - (* encoding scheme: - - Object = Form Type Size ObjectInfo . - Form = SHORTINT; - Type = Code (* codeF *) | - Code TypeName (* incrF *) | - TypeName (* nameF *) | - Code TypeName { Code TypeName } 0 (* incrhierF *) | - TypeName { TypeName } 0X (* hierF *) . - Size = (* noSizeF *) | - Size (* sizeF *) . (* size of object info in bytes *) - ObjectInfo = { Byte } . - *) - - PROCEDURE DecodeForm(form: Form; - VAR nameGiven, codeGiven, hier, size: BOOLEAN); - VAR - typeform: SHORTINT; - sizeform: SHORTINT; - BEGIN - typeform := form MOD maskF; sizeform := form DIV maskF; - nameGiven := typeform IN {incrF, nameF, hierF, incrhierF}; - codeGiven := typeform IN {codeF, incrF, incrhierF}; - hier := (typeform = incrhierF) OR (typeform = hierF); - size := (sizeform = sizeF); - END DecodeForm; - - PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); - (* get the name of the module where 'name' was defined *) - VAR - index: INTEGER; - BEGIN - index := 0; - WHILE (name[index] # ".") & (name[index] # 0X) & - (index < LEN(module)-1) DO - module[index] := name[index]; INC(index); - END; - module[index] := 0X; - END GetModule; - - PROCEDURE Failure(s: Streams.Stream; code: ErrorCode); - BEGIN - IF s.eof THEN - Error(s, eofReached); - ELSE - Error(s, code); - END; - END Failure; - - PROCEDURE DecodeFailure(s: Streams.Stream; type: Services.Type); - VAR - event: DecodeFailureEvent; - BEGIN - IF s.eof THEN - Error(s, eofReached); - ELSE - NEW(event); - event.type := error; - event.message := errormsg[cannotReadData]; - event.stream := s; - event.errorcode := cannotReadData; - event.objectType := type; - RelatedEvents.Raise(s, event); - END; - END DecodeFailure; - - PROCEDURE GetStreamDisc(s: Streams.Stream; VAR disc: StreamDiscipline); - BEGIN - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - NEW(disc); disc.id := id; disc.mode := defaultMode; - IndirectDisciplines.Add(s, disc); - END; - END GetStreamDisc; - - PROCEDURE ReadTypeInfo(s: Streams.Stream; VAR type: Type; - VAR projection: BOOLEAN; - VAR size: Streams.Count) : BOOLEAN; - VAR - form: Form; - btype: Type; - nameGiven, codeGiven, hier, sizeGiven: BOOLEAN; - disc: StreamDiscipline; - sentinelFound, unknownTypeFound: BOOLEAN; - lastType: Type; - - PROCEDURE ReadType(s: Streams.Stream; VAR type: Type; - VAR sentinelFound, unknownTypeFound: BOOLEAN) : BOOLEAN; - VAR - code: LONGINT; - entry: TypeEntry; - typeName: TypeName; - btype: Type; - - PROCEDURE SeekType(typeName: ARRAY OF CHAR; - VAR type: Type) : BOOLEAN; - VAR - t: Services.Type; - module: TypeName; - BEGIN - Services.SeekType(typeName, t); - IF t = NIL THEN - GetModule(typeName, module); - IF Loader.Load(module, s) THEN - (* maybe the type is now registered *) - Services.SeekType(typeName, t); - END; - END; - IF (t # NIL) & (t IS Type) THEN - type := t(Type); RETURN TRUE - END; - RETURN FALSE - END SeekType; - - BEGIN (* ReadType *) - sentinelFound := FALSE; unknownTypeFound := FALSE; - type := NIL; - IF codeGiven THEN - IF ~NetIO.ReadLongInt(s, code) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF code = 0 THEN sentinelFound := TRUE; RETURN FALSE END; - entry := disc.rtypes[code MOD ttlen]; - WHILE (entry # NIL) & (entry.code # code) DO - entry := entry.next; - END; - IF entry # NIL THEN - type := entry.type; - END; - IF (entry = NIL) & ~nameGiven THEN - Failure(s, unknownType); unknownTypeFound := TRUE; RETURN FALSE - END; - END; - IF nameGiven THEN - IF ~NetIO.ReadString(s, typeName) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF typeName[0] = 0X THEN sentinelFound := TRUE; RETURN FALSE END; - IF (type = NIL) & ~SeekType(typeName, type) THEN - UnknownType(s, typeName); unknownTypeFound := TRUE; RETURN FALSE - END; - END; - IF codeGiven & (entry = NIL) THEN - NEW(entry); - entry.code := code; - entry.type := type; - entry.next := disc.rtypes[code MOD ttlen]; - disc.rtypes[code MOD ttlen] := entry; - END; - RETURN TRUE - END ReadType; - - BEGIN (* ReadTypeInfo *) - (* read & check form of type info *) - IF ~NetIO.ReadShortInt(s, form) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF (form <= 0) OR (form > maxF) THEN - Failure(s, invalidType); RETURN FALSE - END; - DecodeForm(form, nameGiven, codeGiven, hier, sizeGiven); + BEGIN (* ReadType *) + sentinelFound := FALSE; unknownTypeFound := FALSE; + type := NIL; IF codeGiven THEN - GetStreamDisc(s, disc); + IF ~NetIO.ReadLongInt(s, code) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF code = 0 THEN sentinelFound := TRUE; RETURN FALSE END; + entry := disc.rtypes[code MOD ttlen]; + WHILE (entry # NIL) & (entry.code # code) DO + entry := entry.next; + END; + IF entry # NIL THEN + type := entry.type; + END; + IF (entry = NIL) & ~nameGiven THEN + Failure(s, unknownType); unknownTypeFound := TRUE; RETURN FALSE + END; END; - - (* read first type information *) - IF ~ReadType(s, type, sentinelFound, unknownTypeFound) & ~hier THEN - RETURN FALSE + IF nameGiven THEN + IF ~NetIO.ReadString(s, typeName) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF typeName[0] = 0X THEN sentinelFound := TRUE; RETURN FALSE END; + IF (type = NIL) & ~SeekType(typeName, type) THEN + UnknownType(s, typeName); unknownTypeFound := TRUE; RETURN FALSE + END; END; - - (* read type hierarchy, if any *) - projection := FALSE; - IF hier THEN - IF sentinelFound THEN - Failure(s, invalidType); RETURN FALSE - END; - lastType := type; - LOOP (* until type hierarchy is read *) - IF ReadType(s, btype, sentinelFound, unknownTypeFound) THEN - IF (lastType # NIL) & (lastType.baseType # btype) THEN - Failure(s, otherTypeHier); RETURN FALSE - END; - IF type = NIL THEN - projection := TRUE; - type := btype; - END; - lastType := btype; - ELSIF sentinelFound THEN - EXIT - ELSIF unknownTypeFound THEN - IF lastType # NIL THEN - Failure(s, otherTypeHier); RETURN FALSE - END; - ELSE - RETURN FALSE - END; - END; - IF type = NIL THEN - (* error events already generated by ReadType *) - RETURN FALSE - END; - END; - - (* read size information, if any *) - IF sizeGiven THEN - IF ~NetIO.ReadLongInt(s, size) THEN - Failure(s, cannotReadType); RETURN FALSE - END; - IF size < 0 THEN - Failure(s, invalidType); RETURN FALSE - END; - ELSE - size := -1; + IF codeGiven & (entry = NIL) THEN + NEW(entry); + entry.code := code; + entry.type := type; + entry.next := disc.rtypes[code MOD ttlen]; + disc.rtypes[code MOD ttlen] := entry; END; RETURN TRUE - END ReadTypeInfo; + END ReadType; - PROCEDURE ReadData(s: Streams.Stream; VAR object: Object) : BOOLEAN; - (* use the interface list to read all data in the right order *) + BEGIN (* ReadTypeInfo *) + (* read & check form of type info *) + IF ~NetIO.ReadShortInt(s, form) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF (form <= 0) OR (form > maxF) THEN + Failure(s, invalidType); RETURN FALSE + END; + DecodeForm(form, nameGiven, codeGiven, hier, sizeGiven); + IF codeGiven THEN + GetStreamDisc(s, disc); + END; + + (* read first type information *) + IF ~ReadType(s, type, sentinelFound, unknownTypeFound) & ~hier THEN + RETURN FALSE + END; + + (* read type hierarchy, if any *) + projection := FALSE; + IF hier THEN + IF sentinelFound THEN + Failure(s, invalidType); RETURN FALSE + END; + lastType := type; + LOOP (* until type hierarchy is read *) + IF ReadType(s, btype, sentinelFound, unknownTypeFound) THEN + IF (lastType # NIL) & (lastType.baseType # btype) THEN + Failure(s, otherTypeHier); RETURN FALSE + END; + IF type = NIL THEN + projection := TRUE; + type := btype; + END; + lastType := btype; + ELSIF sentinelFound THEN + EXIT + ELSIF unknownTypeFound THEN + IF lastType # NIL THEN + Failure(s, otherTypeHier); RETURN FALSE + END; + ELSE + RETURN FALSE + END; + END; + IF type = NIL THEN + (* error events already generated by ReadType *) + RETURN FALSE + END; + END; + + (* read size information, if any *) + IF sizeGiven THEN + IF ~NetIO.ReadLongInt(s, size) THEN + Failure(s, cannotReadType); RETURN FALSE + END; + IF size < 0 THEN + Failure(s, invalidType); RETURN FALSE + END; + ELSE + size := -1; + END; + RETURN TRUE + END ReadTypeInfo; + + PROCEDURE ReadData(s: Streams.Stream; VAR object: Object) : BOOLEAN; + (* use the interface list to read all data in the right order *) + VAR + ifList: InterfaceList; + BEGIN + ifList := object.type.ifs; + WHILE ifList # NIL DO + IF ~ifList.if.read(s, object) THEN + (* error handling is done by the calling procedure *) + RETURN FALSE + END; + ifList := ifList.next; + END; + RETURN (object.type.if.read = NIL) OR object.type.if.read(s, object) + END ReadData; + + PROCEDURE EncodeForm(s: Streams.Stream; type: Type; VAR form: Form); + VAR + mode: Mode; + disc: IndirectDisciplines.Discipline; + hier: BOOLEAN; + + PROCEDURE KnownType() : BOOLEAN; VAR - ifList: InterfaceList; - BEGIN - ifList := object.type.ifs; - WHILE ifList # NIL DO - IF ~ifList.if.read(s, object) THEN - (* error handling is done by the calling procedure *) - RETURN FALSE - END; - ifList := ifList.next; + p: TypeEntry; + BEGIN + p := disc(StreamDiscipline).wtypes[type.code MOD ttlen]; + WHILE (p # NIL) & (p.type # type) DO + p := p.next; END; - RETURN (object.type.if.read = NIL) OR object.type.if.read(s, object) - END ReadData; + RETURN p # NIL + END KnownType; - PROCEDURE EncodeForm(s: Streams.Stream; type: Type; VAR form: Form); + BEGIN + IF ~IndirectDisciplines.Seek(s, id, disc) THEN + mode := defaultMode; disc := NIL; + ELSE + mode := disc(StreamDiscipline).mode; + END; + form := 0; + hier := mode DIV 8 MOD 2 > 0; + CASE mode MOD 4 OF + | fullTypeName: IF hier THEN form := hierF ELSE form := nameF END; + | typeCode: form := codeF; ASSERT(~hier); + | incrTypeCode: IF KnownType() THEN + form := codeF; + ELSIF hier THEN + form := incrhierF; + ELSE + form := incrF; + END; + ELSE + END; + IF mode DIV 4 MOD 2 > 0 THEN + INC(form, sizeF); + ELSE + INC(form, noSizeF); + END; + END EncodeForm; + + PROCEDURE WriteTypeInfo(s: Streams.Stream; type: Type; + VAR giveSize: BOOLEAN) : BOOLEAN; + (* write type information without size *) + VAR + form: Form; + giveName, giveCode, hier: BOOLEAN; + mode: Mode; incr: BOOLEAN; + disc: IndirectDisciplines.Discipline; + btype: Type; + + PROCEDURE WriteType(s: Streams.Stream; type: Type) : BOOLEAN; VAR - mode: Mode; - disc: StreamDiscipline; - hier: BOOLEAN; - - PROCEDURE KnownType() : BOOLEAN; - VAR - p: TypeEntry; - BEGIN - p := disc.wtypes[type.code MOD ttlen]; - WHILE (p # NIL) & (p.type # type) DO - p := p.next; - END; - RETURN p # NIL - END KnownType; - - BEGIN - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - mode := defaultMode; disc := NIL; - ELSE - mode := disc.mode; + typeName: TypeName; + entry: TypeEntry; + BEGIN + IF giveCode THEN + IF ~NetIO.WriteLongInt(s, type.code) THEN + Error(s, cannotWriteType); RETURN FALSE + END; END; - form := 0; - hier := mode DIV 8 MOD 2 > 0; - CASE mode MOD 4 OF - | fullTypeName: IF hier THEN form := hierF ELSE form := nameF END; - | typeCode: form := codeF; ASSERT(~hier); - | incrTypeCode: IF KnownType() THEN - form := codeF; - ELSIF hier THEN - form := incrhierF; - ELSE - form := incrF; - END; - ELSE + IF giveName THEN + Services.GetTypeName(type, typeName); + IF ~NetIO.WriteString(s, typeName) THEN + Error(s, cannotWriteType); RETURN FALSE + END; END; - IF mode DIV 4 MOD 2 > 0 THEN - INC(form, sizeF); - ELSE - INC(form, noSizeF); + IF incr THEN + NEW(entry); entry.type := type; entry.code := type.code; + entry.next := disc(StreamDiscipline).wtypes[type.code MOD ttlen]; + disc(StreamDiscipline).wtypes[type.code MOD ttlen] := entry; END; - END EncodeForm; - - PROCEDURE WriteTypeInfo(s: Streams.Stream; type: Type; - VAR giveSize: BOOLEAN) : BOOLEAN; - (* write type information without size *) - VAR - form: Form; - giveName, giveCode, hier: BOOLEAN; - mode: Mode; incr: BOOLEAN; - disc: StreamDiscipline; - btype: Type; - - PROCEDURE WriteType(s: Streams.Stream; type: Type) : BOOLEAN; - VAR - typeName: TypeName; - entry: TypeEntry; - BEGIN - IF giveCode THEN - IF ~NetIO.WriteLongInt(s, type.code) THEN - Error(s, cannotWriteType); RETURN FALSE - END; - END; - IF giveName THEN - Services.GetTypeName(type, typeName); - IF ~NetIO.WriteString(s, typeName) THEN - Error(s, cannotWriteType); RETURN FALSE - END; - END; - IF incr THEN - NEW(entry); entry.type := type; entry.code := type.code; - entry.next := disc.wtypes[type.code MOD ttlen]; - disc.wtypes[type.code MOD ttlen] := entry; - END; - RETURN TRUE - END WriteType; - - BEGIN (* WriteTypeInfo *) - EncodeForm(s, type, form); - IF ~NetIO.WriteShortInt(s, form) THEN - Error(s, cannotWriteType); - END; - DecodeForm(form, giveName, giveCode, hier, giveSize); - IF ~IndirectDisciplines.Seek(s, id, SYS.VAL(IndirectDisciplines.Discipline, disc)) THEN - mode := defaultMode; - END; - incr := giveName & giveCode; - - IF ~WriteType(s, type) THEN RETURN FALSE END; - - IF hier THEN - btype := type.baseType; - WHILE btype # NIL DO - IF ~WriteType(s, btype) THEN RETURN FALSE END; - btype := btype.baseType; - END; - (* write sentinel *) - IF giveCode THEN - IF ~NetIO.WriteLongInt(s, 0) THEN - Error(s, cannotWriteType); - RETURN FALSE - END; - ELSE - IF ~NetIO.WriteString(s, "") THEN - Error(s, cannotWriteType); - RETURN FALSE - END; - END; - END; - RETURN TRUE - END WriteTypeInfo; + END WriteType; - PROCEDURE WriteData(s: Streams.Stream; object: Object) : BOOLEAN; - (* use the interface list to write all data in the right order *) - VAR - ifList: InterfaceList; - BEGIN - ifList := object.type.ifs; - WHILE ifList # NIL DO - IF ~ifList.if.write(s, object) THEN - (* error handling is done by the calling procedure *) - RETURN FALSE - END; - ifList := ifList.next; + BEGIN (* WriteTypeInfo *) + EncodeForm(s, type, form); + IF ~NetIO.WriteShortInt(s, form) THEN + Error(s, cannotWriteType); + END; + DecodeForm(form, giveName, giveCode, hier, giveSize); + IF ~IndirectDisciplines.Seek(s, id, disc) THEN + mode := defaultMode; + END; + incr := giveName & giveCode; + + IF ~WriteType(s, type) THEN RETURN FALSE END; + + IF hier THEN + btype := type.baseType; + WHILE btype # NIL DO + IF ~WriteType(s, btype) THEN RETURN FALSE END; + btype := btype.baseType; END; - RETURN (object.type.if.write = NIL) OR object.type.if.write(s, object) - END WriteData; - - (* ===== exported procedures ============================================ *) - - PROCEDURE RegisterType*(VAR type: Services.Type; - name, baseName: ARRAY OF CHAR; - if: Interface); - VAR - newtype: Type; - baseType: Services.Type; - member: InterfaceList; - bt: Type; - ifval: INTEGER; - BEGIN - (* check the parameters *) - ASSERT(name[0] # 0X); - IF if # NIL THEN - ifval := 0; - IF if.create # NIL THEN INC(ifval, 1) END; - IF if.read # NIL THEN INC(ifval, 2) END; - IF if.write # NIL THEN INC(ifval, 4) END; - IF if.createAndRead # NIL THEN INC(ifval, 8) END; - (* legal variants: - - if = NIL abstract data type - - create read write createAndRead - #NIL NIL NIL NIL 1 empty data type - NIL #NIL #NIL NIL 6 abstract data type - #NIL #NIL #NIL NIL 7 normal case - NIL NIL #NIL #NIL 12 special case - - note that the special case must not be given as base type! - *) - ASSERT(ifval IN {1, 6, 7, 12}); - END; - - (* create type and determine next non-abstract base type *) - NEW(newtype); - newtype.code := nextTypeCode; INC(nextTypeCode); - newtype.if := if; - IF baseName = "" THEN - Services.InitType(newtype, name, "PersistentObjects.Object"); + (* write sentinel *) + IF giveCode THEN + IF ~NetIO.WriteLongInt(s, 0) THEN + Error(s, cannotWriteType); + RETURN FALSE + END; ELSE - Services.InitType(newtype, name, baseName); + IF ~NetIO.WriteString(s, "") THEN + Error(s, cannotWriteType); + RETURN FALSE + END; END; - IF baseName = "" THEN - newtype.baseType := NIL; - ELSE - Services.GetBaseType(newtype, baseType); - ASSERT((baseType # NIL) & (baseType IS Type)); - WHILE (baseType # NIL) & (baseType IS Type) & - (baseType(Type).if = NIL) DO - Services.GetBaseType(baseType, baseType); - END; - IF (baseType = NIL) OR ~(baseType IS Type) THEN - newtype.baseType := NIL; - ELSE - newtype.baseType := baseType(Type); - ASSERT(newtype.baseType.if.createAndRead = NIL); - END; + END; + + RETURN TRUE + END WriteTypeInfo; + + PROCEDURE WriteData(s: Streams.Stream; object: Object) : BOOLEAN; + (* use the interface list to write all data in the right order *) + VAR + ifList: InterfaceList; + BEGIN + ifList := object.type.ifs; + WHILE ifList # NIL DO + IF ~ifList.if.write(s, object) THEN + (* error handling is done by the calling procedure *) + RETURN FALSE END; + ifList := ifList.next; + END; + RETURN (object.type.if.write = NIL) OR object.type.if.write(s, object) + END WriteData; - (* build up list of interfaces *) - newtype.ifs := NIL; bt := newtype.baseType; - WHILE bt # NIL DO - NEW(member); member.if := bt.if; - member.next := newtype.ifs; newtype.ifs := member; - bt := bt.baseType; - END; + (* ===== exported procedures ============================================ *) - type := newtype; - END RegisterType; + PROCEDURE RegisterType*(VAR type: Services.Type; + name, baseName: ARRAY OF CHAR; + if: Interface); + VAR + newtype: Type; + baseType: Services.Type; + member: InterfaceList; + bt: Type; + ifval: INTEGER; + BEGIN + (* check the parameters *) + ASSERT(name[0] # 0X); + IF if # NIL THEN + ifval := 0; + IF if.create # NIL THEN INC(ifval, 1) END; + IF if.read # NIL THEN INC(ifval, 2) END; + IF if.write # NIL THEN INC(ifval, 4) END; + IF if.createAndRead # NIL THEN INC(ifval, 8) END; + (* legal variants: - PROCEDURE Init*(object: Object; type: Services.Type); - BEGIN - ASSERT(type IS Type); - WITH type: Type DO - ASSERT((type.if.create # NIL) OR (type.if.createAndRead # NIL)); - object.type := type; - object.projected := FALSE; - Services.Init(object, type); - END; - END Init; + if = NIL abstract data type - PROCEDURE SetMode*(s: Streams.Stream; mode: Mode); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYS.VAL(Disciplines.Discipline, disc)) THEN - NEW(disc); disc.id := id; - END; - disc.mode := mode; - Disciplines.Add(s, disc); - END SetMode; + create read write createAndRead + #NIL NIL NIL NIL 1 empty data type + NIL #NIL #NIL NIL 6 abstract data type + #NIL #NIL #NIL NIL 7 normal case + NIL NIL #NIL #NIL 12 special case - PROCEDURE GetMode*(s: Streams.Stream; VAR mode: Mode); - (* return the current mode for the given stream *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYS.VAL(Disciplines.Discipline, disc)) THEN - mode := disc.mode; - ELSE - mode := defaultMode; - END; - END GetMode; - - PROCEDURE IsProjected*(object: Object) : BOOLEAN; - (* show whether the object was a victim of projection or not *) - BEGIN - RETURN object.projected - END IsProjected; - - PROCEDURE InternalRead(s: Streams.Stream; create: BOOLEAN; - VAR object: Object) : BOOLEAN; - (* read `object' from `s'; - note that we have to operate on `object' directly because - LinearizedStructures relies on this in case of cyclic - references + note that the special case must not be given as base type! *) - VAR - streamCaps: Streams.CapabilitySet; - type, objectType: Type; - projection: BOOLEAN; (* necessary due to unknown types? *) - size: Streams.Count; (* size information, if unknown it equals -1 *) - skipUnknownParts: BOOLEAN; (* are we able to skip data if necessary? *) + ASSERT(ifval IN {1, 6, 7, 12}); + END; - (* these vars are used for skipping unknown data areas *) - oldPos, newPos: Streams.Count; - textbuf: Texts.Text; - - BEGIN (* InternalRead *) - IF ~ReadTypeInfo(s, type, projection, size) THEN RETURN FALSE END; - IF ~create & (type.if.createAndRead = NIL) THEN - (* projection necessary due to target object? *) - Services.GetType(object, SYS.VAL(Services.Type, objectType)); - IF ~Services.IsExtensionOf(type, objectType) THEN - TypeGuardFailure(s, type, objectType); RETURN FALSE - END; - projection := projection OR (type # objectType); + (* create type and determine next non-abstract base type *) + NEW(newtype); + newtype.code := nextTypeCode; INC(nextTypeCode); + newtype.if := if; + IF baseName = "" THEN + Services.InitType(newtype, name, "PersistentObjects.Object"); + ELSE + Services.InitType(newtype, name, baseName); + END; + IF baseName = "" THEN + newtype.baseType := NIL; + ELSE + Services.GetBaseType(newtype, baseType); + ASSERT((baseType # NIL) & (baseType IS Type)); + WHILE (baseType # NIL) & (baseType IS Type) & + (baseType(Type).if = NIL) DO + Services.GetBaseType(baseType, baseType); END; - skipUnknownParts := projection & (size > 0); + IF (baseType = NIL) OR ~(baseType IS Type) THEN + newtype.baseType := NIL; + ELSE + newtype.baseType := baseType(Type); + ASSERT(newtype.baseType.if.createAndRead = NIL); + END; + END; + + (* build up list of interfaces *) + newtype.ifs := NIL; bt := newtype.baseType; + WHILE bt # NIL DO + NEW(member); member.if := bt.if; + member.next := newtype.ifs; newtype.ifs := member; + bt := bt.baseType; + END; + + type := newtype; + END RegisterType; + + PROCEDURE Init*(object: Object; type: Services.Type); + BEGIN + ASSERT(type IS Type); + WITH type: Type DO + ASSERT((type.if.create # NIL) OR (type.if.createAndRead # NIL)); + object.type := type; + object.projected := FALSE; + Services.Init(object, type); + END; + END Init; + + PROCEDURE SetMode*(s: Streams.Stream; mode: Mode); + VAR + disc: StreamDiscipline; + d: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, d) THEN + disc := d(StreamDiscipline) + ELSE + NEW(disc); disc.id := id; + END; + disc.mode := mode; + Disciplines.Add(s, disc); + END SetMode; + + PROCEDURE GetMode*(s: Streams.Stream; VAR mode: Mode); + (* return the current mode for the given stream *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + mode := disc(StreamDiscipline).mode; + ELSE + mode := defaultMode; + END; + END GetMode; + + PROCEDURE IsProjected*(object: Object) : BOOLEAN; + (* show whether the object was a victim of projection or not *) + BEGIN + RETURN object.projected + END IsProjected; + + PROCEDURE InternalRead(s: Streams.Stream; create: BOOLEAN; + VAR object: Object) : BOOLEAN; + (* read `object' from `s'; + note that we have to operate on `object' directly because + LinearizedStructures relies on this in case of cyclic + references + *) + VAR + streamCaps: Streams.CapabilitySet; + type: Type; + objectType: Services.Type; + projection: BOOLEAN; (* necessary due to unknown types? *) + size: Streams.Count; (* size information, if unknown it equals -1 *) + skipUnknownParts: BOOLEAN; (* are we able to skip data if necessary? *) + + (* these vars are used for skipping unknown data areas *) + oldPos, newPos: Streams.Count; + textbuf: Texts.Text; + + BEGIN (* InternalRead *) + IF ~ReadTypeInfo(s, type, projection, size) THEN RETURN FALSE END; + IF ~create & (type.if.createAndRead = NIL) THEN + (* projection necessary due to target object? *) + Services.GetType(object, objectType); + IF ~Services.IsExtensionOf(type, objectType) THEN + TypeGuardFailure(s, type, objectType); RETURN FALSE + END; + projection := projection OR (type # objectType); + END; + skipUnknownParts := projection & (size > 0); + streamCaps := Streams.Capabilities(s); + IF skipUnknownParts THEN + IF Streams.tell IN streamCaps THEN + Streams.GetPos(s, oldPos); + ELSE + Texts.Open(SYS.VAL(Streams.Stream, textbuf)); + IF ~Streams.Copy(s, textbuf, size) THEN + Failure(s, cannotReadData); RETURN FALSE + END; + Forwarders.Forward(textbuf, s); + RelatedEvents.Forward(textbuf, s); + s := textbuf; + skipUnknownParts := FALSE; + END; + END; + + IF type.if.createAndRead # NIL THEN + IF ~type.if.createAndRead(s, create, object) THEN + DecodeFailure(s, type); object := NIL; RETURN FALSE + END; + ELSE + IF create THEN + type.if.create(object); + END; + IF ~ReadData(s, object) THEN + DecodeFailure(s, type); + object := NIL; + RETURN FALSE + END; + END; + + (* store information about projection into object *) + object.projected := projection; + + IF skipUnknownParts THEN + IF Streams.seek IN streamCaps THEN + Streams.SetPos(s, oldPos + size); + ELSE + Streams.GetPos(s, newPos); + IF ~Streams.Copy(s, Streams.null, size - newPos + oldPos) THEN + Failure(s, cannotSkip); RETURN FALSE + END; + END; + ELSIF projection & (size < 0) THEN + Error(s, cannotSkip); RETURN FALSE + END; + + s.count := 1; (* show success *) + RETURN TRUE + END InternalRead; + + PROCEDURE Read*(s: Streams.Stream; VAR object: Object) : BOOLEAN; + (* read `object' from `s'; object # NIL on success *) + BEGIN + RETURN InternalRead(s, (* create = *) TRUE, object) + END Read; + + PROCEDURE ReadInto*(s: Streams.Stream; object: Object) : BOOLEAN; + (* read an object from `s' and assign it to `object'; + this fails if `object' doesn't has the IDENTICAL type + (thus projections are not supported here) + *) + BEGIN + RETURN InternalRead(s, (* create = *) FALSE, object) + END ReadInto; + + PROCEDURE GuardedRead*(s: Streams.Stream; guard: Services.Type; + VAR object: Object) : BOOLEAN; + (* read an object from `s' and return it, provided + the type of the read object is an extension of `guard' + *) + VAR + testObject: Object; + type: Services.Type; + BEGIN + IF ~Read(s, testObject) THEN RETURN FALSE END; + Services.GetType(testObject, type); + IF Services.IsExtensionOf(type, guard) THEN + object := testObject; RETURN TRUE + ELSE + TypeGuardFailure(s, type, guard); + RETURN FALSE + END; + END GuardedRead; + + PROCEDURE Write*(s: Streams.Stream; object: Object) : BOOLEAN; + (* write `obj' to `s' *) + VAR + giveSize: BOOLEAN; + streamCaps: Streams.CapabilitySet; + patchSize: BOOLEAN; + sizePos, beginPos, endPos: Streams.Count; + textbuf, origStream: Streams.Stream; + mode: Mode; + BEGIN + IF ~WriteTypeInfo(s, object.type, giveSize) THEN RETURN FALSE END; + IF giveSize THEN streamCaps := Streams.Capabilities(s); - IF skipUnknownParts THEN - IF Streams.tell IN streamCaps THEN - Streams.GetPos(s, oldPos); - ELSE - Texts.Open(SYS.VAL(Streams.Stream, textbuf)); - IF ~Streams.Copy(s, textbuf, size) THEN - Failure(s, cannotReadData); RETURN FALSE - END; - Forwarders.Forward(textbuf, s); - RelatedEvents.Forward(textbuf, s); - s := textbuf; - skipUnknownParts := FALSE; - END; - END; - - IF type.if.createAndRead # NIL THEN - IF ~type.if.createAndRead(s, create, object) THEN - DecodeFailure(s, type); object := NIL; RETURN FALSE - END; + patchSize := ({Streams.tell, Streams.seek} - streamCaps = {}) & + Streams.Tell(s, sizePos); + IF patchSize THEN + IF ~NetIO.WriteLongInt(s, 0) THEN + Error(s, cannotWriteData); RETURN FALSE + END; + Streams.GetPos(s, beginPos); ELSE - IF create THEN - type.if.create(object); - END; - IF ~ReadData(s, object) THEN - DecodeFailure(s, type); - object := NIL; - RETURN FALSE - END; + Texts.Open(textbuf); + Forwarders.Forward(textbuf, s); + RelatedEvents.Forward(textbuf, s); + GetMode(s, mode); SetMode(textbuf, mode); + origStream := s; s := textbuf; END; + END; - (* store information about projection into object *) - object.projected := projection; - - IF skipUnknownParts THEN - IF Streams.seek IN streamCaps THEN - Streams.SetPos(s, oldPos + size); - ELSE - Streams.GetPos(s, newPos); - IF ~Streams.Copy(s, Streams.null, size - newPos + oldPos) THEN - Failure(s, cannotSkip); RETURN FALSE - END; - END; - ELSIF projection & (size < 0) THEN - Error(s, cannotSkip); RETURN FALSE + IF object.type.if.createAndRead # NIL THEN + IF ~object.type.if.write(s, object) THEN + Error(s, cannotWriteData); RETURN FALSE END; + ELSE + IF ~WriteData(s, object) THEN + Error(s, cannotWriteData); RETURN FALSE + END; + END; - s.count := 1; (* show success *) - RETURN TRUE - END InternalRead; - - PROCEDURE Read*(s: Streams.Stream; VAR object: Object) : BOOLEAN; - (* read `object' from `s'; object # NIL on success *) - BEGIN - RETURN InternalRead(s, (* create = *) TRUE, object) - END Read; - - PROCEDURE ReadInto*(s: Streams.Stream; object: Object) : BOOLEAN; - (* read an object from `s' and assign it to `object'; - this fails if `object' doesn't has the IDENTICAL type - (thus projections are not supported here) - *) - BEGIN - RETURN InternalRead(s, (* create = *) FALSE, object) - END ReadInto; - - PROCEDURE GuardedRead*(s: Streams.Stream; guard: Services.Type; - VAR object: Object) : BOOLEAN; - (* read an object from `s' and return it, provided - the type of the read object is an extension of `guard' - *) - VAR - testObject: Object; - type: Services.Type; - BEGIN - IF ~Read(s, testObject) THEN RETURN FALSE END; - Services.GetType(testObject, type); - IF Services.IsExtensionOf(type, guard) THEN - object := testObject; RETURN TRUE + IF giveSize THEN + IF patchSize THEN + Streams.GetPos(s, endPos); + Streams.SetPos(s, sizePos); + IF ~NetIO.WriteLongInt(s, endPos - beginPos) THEN + Streams.SetPos(s, endPos); + Error(s, cannotWriteData); + RETURN FALSE + END; + Streams.SetPos(s, endPos); ELSE - TypeGuardFailure(s, type, guard); - RETURN FALSE + Streams.GetPos(textbuf, endPos); + Streams.SetPos(textbuf, 0); + s := origStream; + IF ~NetIO.WriteLongInt(s, endPos) OR + ~Streams.Copy(textbuf, s, endPos) THEN + Error(s, cannotWriteData); + END; END; - END GuardedRead; + END; + s.count := 1; + RETURN TRUE + END Write; - PROCEDURE Write*(s: Streams.Stream; object: Object) : BOOLEAN; - (* write `obj' to `s' *) - VAR - giveSize: BOOLEAN; - streamCaps: Streams.CapabilitySet; - patchSize: BOOLEAN; - sizePos, beginPos, endPos: Streams.Count; - textbuf, origStream: Streams.Stream; - mode: Mode; - BEGIN - IF ~WriteTypeInfo(s, object.type, giveSize) THEN RETURN FALSE END; - IF giveSize THEN - streamCaps := Streams.Capabilities(s); - patchSize := ({Streams.tell, Streams.seek} - streamCaps = {}) & - Streams.Tell(s, sizePos); - IF patchSize THEN - IF ~NetIO.WriteLongInt(s, 0) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - Streams.GetPos(s, beginPos); - ELSE - Texts.Open(textbuf); - Forwarders.Forward(textbuf, s); - RelatedEvents.Forward(textbuf, s); - GetMode(s, mode); SetMode(textbuf, mode); - origStream := s; s := textbuf; - END; - END; + PROCEDURE ReadObjectOrNIL*(s: Streams.Stream; VAR object: Object) : BOOLEAN; + VAR + nil: BOOLEAN; + BEGIN + object := NIL; + RETURN NetIO.ReadBoolean(s, nil) & (nil OR Read(s, object)) + END ReadObjectOrNIL; - IF object.type.if.createAndRead # NIL THEN - IF ~object.type.if.write(s, object) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - ELSE - IF ~WriteData(s, object) THEN - Error(s, cannotWriteData); RETURN FALSE - END; - END; - - IF giveSize THEN - IF patchSize THEN - Streams.GetPos(s, endPos); - Streams.SetPos(s, sizePos); - IF ~NetIO.WriteLongInt(s, endPos - beginPos) THEN - Streams.SetPos(s, endPos); - Error(s, cannotWriteData); - RETURN FALSE - END; - Streams.SetPos(s, endPos); - ELSE - Streams.GetPos(textbuf, endPos); - Streams.SetPos(textbuf, 0); - s := origStream; - IF ~NetIO.WriteLongInt(s, endPos) OR - ~Streams.Copy(textbuf, s, endPos) THEN - Error(s, cannotWriteData); - END; - END; - END; - s.count := 1; - RETURN TRUE - END Write; - - PROCEDURE ReadObjectOrNIL*(s: Streams.Stream; VAR object: Object) : BOOLEAN; - VAR - nil: BOOLEAN; - BEGIN + PROCEDURE GuardedReadObjectOrNIL*(s: Streams.Stream; guard: Services.Type; + VAR object: Object) : BOOLEAN; + (* may be used instead of ReadObjectOrNIL *) + VAR + testObject: Object; + type: Services.Type; + nil: BOOLEAN; + BEGIN + IF ~NetIO.ReadBoolean(s, nil) THEN RETURN FALSE END; + IF nil THEN object := NIL; - RETURN NetIO.ReadBoolean(s, nil) & (nil OR Read(s, object)) - END ReadObjectOrNIL; + RETURN TRUE + END; + IF ~Read(s, testObject) THEN RETURN FALSE END; + IF testObject = NIL THEN RETURN TRUE END; + Services.GetType(testObject, type); + IF Services.IsExtensionOf(type, guard) THEN + object := testObject; RETURN TRUE + ELSE + TypeGuardFailure(s, type, guard); + RETURN FALSE + END; + END GuardedReadObjectOrNIL; - PROCEDURE GuardedReadObjectOrNIL*(s: Streams.Stream; guard: Services.Type; - VAR object: Object) : BOOLEAN; - (* may be used instead of ReadObjectOrNIL *) - VAR - testObject: Object; - type: Services.Type; - nil: BOOLEAN; - BEGIN - IF ~NetIO.ReadBoolean(s, nil) THEN RETURN FALSE END; - IF nil THEN - object := NIL; - RETURN TRUE - END; - IF ~Read(s, testObject) THEN RETURN FALSE END; - IF testObject = NIL THEN RETURN TRUE END; - Services.GetType(testObject, type); - IF Services.IsExtensionOf(type, guard) THEN - object := testObject; RETURN TRUE - ELSE - TypeGuardFailure(s, type, guard); - RETURN FALSE - END; - END GuardedReadObjectOrNIL; - - PROCEDURE WriteObjectOrNIL*(s: Streams.Stream; object: Object) : BOOLEAN; - VAR - nil: BOOLEAN; - BEGIN - nil := object = NIL; - RETURN NetIO.WriteBoolean(s, nil) & (nil OR Write(s, object)) - END WriteObjectOrNIL; + PROCEDURE WriteObjectOrNIL*(s: Streams.Stream; object: Object) : BOOLEAN; + VAR + nil: BOOLEAN; + BEGIN + nil := object = NIL; + RETURN NetIO.WriteBoolean(s, nil) & (nil OR Write(s, object)) + END WriteObjectOrNIL; BEGIN - id := Disciplines.Unique(); - nextTypeCode := 1; - InitErrorHandling; - Services.CreateType(potype, "PersistentObjects.Object", ""); + id := Disciplines.Unique(); + nextTypeCode := 1; + InitErrorHandling; + Services.CreateType(potype, "PersistentObjects.Object", ""); END ulmPersistentObjects. diff --git a/src/library/ulm/ulmRandomGenerators.Mod b/src/library/ulm/ulmRandomGenerators.Mod index cb63a9a5..f1aa36de 100644 --- a/src/library/ulm/ulmRandomGenerators.Mod +++ b/src/library/ulm/ulmRandomGenerators.Mod @@ -1,419 +1,421 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: RandomGener.om,v 1.9 2004/03/09 21:44:12 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: RandomGener.om,v $ - Revision 1.9 2004/03/09 21:44:12 borchert - unpredictable added to the standard set of PRNGs + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: RandomGener.om,v 1.9 2004/03/09 21:44:12 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: RandomGener.om,v $ + Revision 1.9 2004/03/09 21:44:12 borchert + unpredictable added to the standard set of PRNGs - Revision 1.8 2004/03/06 07:22:09 borchert - Init asserts that the sequence has been registered at Services + Revision 1.8 2004/03/06 07:22:09 borchert + Init asserts that the sequence has been registered at Services - Revision 1.7 1998/02/14 22:04:09 martin - Missing calls of Services.Init and Services.CreateType added. + Revision 1.7 1998/02/14 22:04:09 martin + Missing calls of Services.Init and Services.CreateType added. - Revision 1.6 1997/10/11 21:22:03 martin - assertion in ValS added, obsolete variable removed + Revision 1.6 1997/10/11 21:22:03 martin + assertion in ValS added, obsolete variable removed - Revision 1.5 1997/10/10 16:26:49 martin - RestartSequence added, range conversions improved, - default implementation replaced. + Revision 1.5 1997/10/10 16:26:49 martin + RestartSequence added, range conversions improved, + default implementation replaced. - Revision 1.4 1997/04/01 16:33:41 borchert - major revision of Random: - - module renamed to RandomGenerators - - abstraction instead of simple implementation (work by Frank Fischer) + Revision 1.4 1997/04/01 16:33:41 borchert + major revision of Random: + - module renamed to RandomGenerators + - abstraction instead of simple implementation (work by Frank Fischer) - Revision 1.3 1994/09/01 18:15:41 borchert - bug fix: avoid arithmetic overflow in ValS + Revision 1.3 1994/09/01 18:15:41 borchert + bug fix: avoid arithmetic overflow in ValS - Revision 1.2 1994/08/30 09:48:00 borchert - sequences added + Revision 1.2 1994/08/30 09:48:00 borchert + sequences added - Revision 1.1 1994/02/23 07:25:30 borchert - Initial revision + Revision 1.1 1994/02/23 07:25:30 borchert + Initial revision - ---------------------------------------------------------------------------- - original implementation by AFB 2/90 - conversion to abstraction by Frank B.J. Fischer 3/97 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + original implementation by AFB 2/90 + conversion to abstraction by Frank B.J. Fischer 3/97 + ---------------------------------------------------------------------------- *) MODULE ulmRandomGenerators; - (* Anyone who considers arithmetical - methods of producing random digits - is, of course, in a state of sin. - - John von Neumann (1951) - *) + (* Anyone who considers arithmetical + methods of producing random digits + is, of course, in a state of sin. + - John von Neumann (1951) + *) - IMPORT - Clocks := ulmClocks, Disciplines := ulmDisciplines, Objects := ulmObjects, Operations := ulmOperations, Process := ulmProcess, Services := ulmServices, Times := ulmTimes, - Types := ulmTypes, S := SYSTEM; + IMPORT + Clocks := ulmClocks, Disciplines := ulmDisciplines, + Objects := ulmObjects, Operations := ulmOperations, + Process := ulmProcess, Services := ulmServices, + Times := ulmTimes, Types := ulmTypes; - TYPE - Sequence* = POINTER TO SequenceRec; + TYPE + Sequence* = POINTER TO SequenceRec; - Int32ValSProc* = PROCEDURE (sequence: Sequence): Types.Int32; - LongRealValSProc* = PROCEDURE (sequence: Sequence): LONGREAL; - RewindSequenceProc* = PROCEDURE (sequence: Sequence); - RestartSequenceProc* = PROCEDURE (sequence, seed: Sequence); - SetValSProc* = PROCEDURE (sequence: Sequence; value: Operations.Operand); + Int32ValSProc* = PROCEDURE (sequence: Sequence): Types.Int32; + LongRealValSProc* = PROCEDURE (sequence: Sequence): LONGREAL; + RewindSequenceProc* = PROCEDURE (sequence: Sequence); + RestartSequenceProc* = PROCEDURE (sequence, seed: Sequence); + SetValSProc* = PROCEDURE (sequence: Sequence; value: Operations.Operand); - CONST - int32ValS* = 0; longRealValS* = 1; rewindSequence* = 2; restartSequence* = 3; + CONST + int32ValS* = 0; longRealValS* = 1; rewindSequence* = 2; restartSequence* = 3; - TYPE - CapabilitySet* = SET; (* of [int32ValS..restartSequence] *) - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - int32ValS* : Int32ValSProc; (* at least one of ... *) - longRealValS* : LongRealValSProc; (* ... these required *) - rewindSequence* : RewindSequenceProc; (* optional *) - restartSequence*: RestartSequenceProc; (* optional *) - END; + TYPE + CapabilitySet* = SET; (* of [int32ValS..restartSequence] *) + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + int32ValS* : Int32ValSProc; (* at least one of ... *) + longRealValS* : LongRealValSProc; (* ... these required *) + rewindSequence* : RewindSequenceProc; (* optional *) + restartSequence*: RestartSequenceProc; (* optional *) + END; - SequenceRec* = - RECORD - (Services.ObjectRec) - (* private components *) - if : Interface; - caps: CapabilitySet; - END; + SequenceRec* = + RECORD + (Services.ObjectRec) + (* private components *) + if : Interface; + caps: CapabilitySet; + END; - VAR - std* : Sequence; (* default sequence *) - seed*: Sequence; (* sequence of seed values *) - unpredictable*: Sequence; - (* reasonably fast sequence of unpredictable values; - is initially NIL - *) + VAR + std* : Sequence; (* default sequence *) + seed*: Sequence; (* sequence of seed values *) + unpredictable*: Sequence; + (* reasonably fast sequence of unpredictable values; + is initially NIL + *) - (* ----- private definitions ----- *) + (* ----- private definitions ----- *) - CONST - modulus1 = 2147483647; (* a Mersenne prime *) - factor1 = 48271; (* passes spectral test *) - quotient1 = modulus1 DIV factor1; (* 44488 *) - remainder1 = modulus1 MOD factor1; (* 3399; must be < quotient1 *) - modulus2 = 2147483399; (* a non-Mersenne prime *) - factor2 = 40692; (* also passes spectral test *) - quotient2 = modulus2 DIV factor2; (* 52774 *) - remainder2 = modulus2 MOD factor2; (* 3791; must be < quotient2 *) + CONST + modulus1 = 2147483647; (* a Mersenne prime *) + factor1 = 48271; (* passes spectral test *) + quotient1 = modulus1 DIV factor1; (* 44488 *) + remainder1 = modulus1 MOD factor1; (* 3399; must be < quotient1 *) + modulus2 = 2147483399; (* a non-Mersenne prime *) + factor2 = 40692; (* also passes spectral test *) + quotient2 = modulus2 DIV factor2; (* 52774 *) + remainder2 = modulus2 MOD factor2; (* 3791; must be < quotient2 *) - TYPE - DefaultSequence = POINTER TO DefaultSequenceRec; - DefaultSequenceRec = - RECORD - (SequenceRec) - seed1, seed2: LONGINT; - value1, value2: LONGINT; - END; + TYPE + DefaultSequence = POINTER TO DefaultSequenceRec; + DefaultSequenceRec = + RECORD + (SequenceRec) + seed1, seed2: LONGINT; + value1, value2: LONGINT; + END; - ServiceDiscipline = POINTER TO ServiceDisciplineRec; - ServiceDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - setValS: SetValSProc; - END; + ServiceDiscipline = POINTER TO ServiceDisciplineRec; + ServiceDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + setValS: SetValSProc; + END; - VAR - service : Services.Service; - serviceDiscID: Disciplines.Identifier; - sequenceType, - defaultSequenceType: Services.Type; + VAR + service : Services.Service; + serviceDiscID: Disciplines.Identifier; + sequenceType, + defaultSequenceType: Services.Type; - (* ----- bug workaround ----- *) + (* ----- bug workaround ----- *) - PROCEDURE Entier(value: LONGREAL): LONGINT; + PROCEDURE Entier(value: LONGREAL): LONGINT; + VAR + result: LONGINT; + BEGIN + result := ENTIER(value); + IF result > value THEN + DEC(result); + END; + RETURN result + END Entier; + + (* ----- exported procedures ----- *) + + PROCEDURE Init*(sequence: Sequence; if: Interface; caps: CapabilitySet); + (* initialize sequence *) + VAR + type: Services.Type; + BEGIN + ASSERT((if.int32ValS # NIL) OR (if.longRealValS # NIL)); + ASSERT(~(int32ValS IN caps) OR (if.int32ValS # NIL)); + ASSERT(~(longRealValS IN caps) OR (if.longRealValS # NIL)); + ASSERT(~(rewindSequence IN caps) OR (if.rewindSequence # NIL)); + Services.GetType(sequence, type); ASSERT(type # NIL); + sequence.if := if; + sequence.caps := caps; + END Init; + + PROCEDURE Capabilities*(sequence: Sequence): CapabilitySet; + (* tell which procedures are implemented *) + BEGIN + RETURN sequence.caps + END Capabilities; + + PROCEDURE RewindSequence*(sequence: Sequence); + (* re-examine sequence *) + BEGIN + ASSERT(rewindSequence IN sequence.caps); + sequence.if.rewindSequence(sequence); + END RewindSequence; + + PROCEDURE RestartSequence*(sequence, seed: Sequence); + (* restart sequence with new seed values *) + BEGIN + ASSERT(restartSequence IN sequence.caps); + sequence.if.restartSequence(sequence, seed); + END RestartSequence; + + PROCEDURE ^ LongRealValS*(sequence: Sequence): LONGREAL; + + PROCEDURE Int32ValS*(sequence: Sequence): Types.Int32; + (* get random 32-bit value from sequence *) + VAR + real: LONGREAL; + BEGIN + IF int32ValS IN sequence.caps THEN + RETURN sequence.if.int32ValS(sequence) + ELSE + real := LongRealValS(sequence); + RETURN SHORT(Entier( (1. - real - real) * MIN(Types.Int32) )) + END; + END Int32ValS; + + PROCEDURE Int32Val*(): Types.Int32; + (* get random 32-bit value from std sequence *) + BEGIN + RETURN Int32ValS(std); + END Int32Val; + + PROCEDURE LongRealValS*(sequence: Sequence): LONGREAL; + (* get a uniformly distributed longreal value in [0..1) *) + BEGIN + IF longRealValS IN sequence.caps THEN + RETURN sequence.if.longRealValS(sequence) + ELSE + RETURN 0.5 + + Int32ValS(sequence) / (0. - MIN(Types.Int32) - MIN(Types.Int32)) + END; + END LongRealValS; + + PROCEDURE LongRealVal*(): LONGREAL; + (* get a uniformly distributed longreal value in [0..1) *) + BEGIN + RETURN LongRealValS(std) + END LongRealVal; + + PROCEDURE RealValS*(sequence: Sequence): REAL; + (* get a uniformly distributed real value in [0..1) *) + BEGIN + RETURN SHORT(LongRealValS(sequence)) + END RealValS; + + PROCEDURE RealVal*(): REAL; + (* get a uniformly distributed real value in [0..1) *) + BEGIN + RETURN SHORT(LongRealValS(std)) + END RealVal; + + PROCEDURE ValS*(sequence: Sequence; low, high: LONGINT): LONGINT; + (* get a uniformly distributed integer in [low..high] *) + BEGIN + ASSERT(low <= high); + RETURN Entier( low + LongRealValS(sequence) * (1. + high - low) ) + END ValS; + + PROCEDURE Val*(low, high: LONGINT): LONGINT; + (* get a uniformly distributed integer in [low..high] *) + BEGIN + RETURN ValS(std, low, high) + END Val; + + PROCEDURE FlipS*(sequence: Sequence): BOOLEAN; + (* return TRUE or FALSE *) + BEGIN + IF int32ValS IN sequence.caps THEN + RETURN sequence.if.int32ValS(sequence) >= 0 + ELSE + RETURN sequence.if.longRealValS(sequence) >= 0.5 + END; + END FlipS; + + PROCEDURE Flip*(): BOOLEAN; + (* return TRUE or FALSE *) + BEGIN + RETURN FlipS(std) + END Flip; + + PROCEDURE Support*(type: Services.Type; setValS: SetValSProc); + (* support service for type *) + VAR + serviceDisc: ServiceDiscipline; + BEGIN + NEW(serviceDisc); + serviceDisc.id := serviceDiscID; + serviceDisc.setValS := setValS; + Disciplines.Add(type, serviceDisc); + Services.Define(type, service, NIL); + END Support; + + PROCEDURE SetValS*(sequence: Sequence; value: Operations.Operand); + (* store random value from sequence into already initialized value *) + VAR + baseType : Services.Type; + serviceDisc: Disciplines.Discipline; (* ServiceDiscipline *) + ok : BOOLEAN; + BEGIN + Services.GetSupportedBaseType(value, service, baseType); + ok := Disciplines.Seek(baseType, serviceDiscID, serviceDisc); + ASSERT(ok); + serviceDisc(ServiceDiscipline).setValS(sequence, value); + END SetValS; + + PROCEDURE SetVal*(value: Operations.Operand); + (* store random value from std sequence into already initialized value *) + BEGIN + SetValS(std, value); + END SetVal; + + (* ----- DefaultSequence ----- *) + + PROCEDURE CongruentialStep(VAR value1, value2: LONGINT); + BEGIN + value1 := + factor1 * (value1 MOD quotient1) - remainder1 * (value1 DIV quotient1); + IF value1 < 0 THEN + INC(value1, modulus1); + END; + value2 := + factor2 * (value2 MOD quotient2) - remainder2 * (value2 DIV quotient2); + IF value2 < 0 THEN + INC(value2, modulus2); + END; + END CongruentialStep; + + PROCEDURE DefaultSequenceValue(sequence: Sequence): LONGREAL; + VAR + value: LONGINT; + BEGIN + WITH sequence: DefaultSequence DO + CongruentialStep(sequence.value1, sequence.value2); + value := sequence.value1 - sequence.value2; + IF value <= 0 THEN + INC(value, modulus1); + END; + RETURN (value - 1.) / (modulus1 - 1.) + END; + END DefaultSequenceValue; + + PROCEDURE DefaultSequenceRewind(sequence: Sequence); + BEGIN + WITH sequence: DefaultSequence DO + sequence.value1 := sequence.seed1; + sequence.value2 := sequence.seed2; + END; + END DefaultSequenceRewind; + + PROCEDURE DefaultSequenceRestart(sequence, seed: Sequence); + BEGIN + WITH sequence: DefaultSequence DO + sequence.seed1 := ValS(seed, 1, modulus1-1); + sequence.seed2 := ValS(seed, 1, modulus2-1); + sequence.value1 := sequence.seed1; + sequence.value2 := sequence.seed2; + END; + END DefaultSequenceRestart; + + PROCEDURE CreateDefaultSequences; + VAR + mySeed, myStd: DefaultSequence; + if: Interface; + daytime: Times.Time; + timeval: Times.TimeValueRec; + count: LONGINT; + + PROCEDURE Hash(str: ARRAY OF CHAR): LONGINT; VAR - result: LONGINT; - BEGIN - result := ENTIER(value); - IF result > value THEN - DEC(result); - END; - RETURN result - END Entier; + index, + val: LONGINT; + BEGIN + val := 27567352; + index := 0; + WHILE str[index] # 0X DO + val := (val MOD 16777216) * 128 + + (val DIV 16777216 + ORD(str[index])) MOD 128; + INC(index); + END; (*WHILE*) + RETURN val + END Hash; - (* ----- exported procedures ----- *) + BEGIN + (* define interface for all default sequences *) + NEW(if); + if.longRealValS := DefaultSequenceValue; + if.rewindSequence := DefaultSequenceRewind; + if.restartSequence := DefaultSequenceRestart; - PROCEDURE Init*(sequence: Sequence; if: Interface; caps: CapabilitySet); - (* initialize sequence *) - VAR - type: Services.Type; - BEGIN - ASSERT((if.int32ValS # NIL) OR (if.longRealValS # NIL)); - ASSERT(~(int32ValS IN caps) OR (if.int32ValS # NIL)); - ASSERT(~(longRealValS IN caps) OR (if.longRealValS # NIL)); - ASSERT(~(rewindSequence IN caps) OR (if.rewindSequence # NIL)); - Services.GetType(sequence, type); ASSERT(type # NIL); - sequence.if := if; - sequence.caps := caps; - END Init; + (* fake initial randomness using some portably accessible sources *) + NEW(mySeed); + Services.Init(mySeed, defaultSequenceType); + Init(mySeed, if, {longRealValS}); + Clocks.GetTime(Clocks.system, daytime); + Times.GetValue(daytime, timeval); + (* extract those 31 bits from daytime that are most likely to vary *) + mySeed.value1 := timeval.usec * 2048 + timeval.second MOD 65536 + 1; + (* generate 31 more bits from the process name *) + mySeed.value2 := Hash(Process.name) MOD (modulus2 - 1) + 1; + (* scramble these values *) + count := 0; + WHILE count < 4 DO + CongruentialStep(mySeed.value1, mySeed.value2); + INC(count); + END; + (* mix them together *) + DefaultSequenceRestart(mySeed, mySeed); + seed := mySeed; - PROCEDURE Capabilities*(sequence: Sequence): CapabilitySet; - (* tell which procedures are implemented *) - BEGIN - RETURN sequence.caps - END Capabilities; + (* now use our seed to initialize std sequence *) + NEW(myStd); + Services.Init(myStd, defaultSequenceType); + Init(myStd, if, {longRealValS, rewindSequence, restartSequence}); + DefaultSequenceRestart(myStd, mySeed); + std := myStd; - PROCEDURE RewindSequence*(sequence: Sequence); - (* re-examine sequence *) - BEGIN - ASSERT(rewindSequence IN sequence.caps); - sequence.if.rewindSequence(sequence); - END RewindSequence; - - PROCEDURE RestartSequence*(sequence, seed: Sequence); - (* restart sequence with new seed values *) - BEGIN - ASSERT(restartSequence IN sequence.caps); - sequence.if.restartSequence(sequence, seed); - END RestartSequence; - - PROCEDURE ^ LongRealValS*(sequence: Sequence): LONGREAL; - - PROCEDURE Int32ValS*(sequence: Sequence): Types.Int32; - (* get random 32-bit value from sequence *) - VAR - real: LONGREAL; - BEGIN - IF int32ValS IN sequence.caps THEN - RETURN sequence.if.int32ValS(sequence) - ELSE - real := LongRealValS(sequence); - RETURN SHORT(Entier( (1. - real - real) * MIN(Types.Int32) )) - END; - END Int32ValS; - - PROCEDURE Int32Val*(): Types.Int32; - (* get random 32-bit value from std sequence *) - BEGIN - RETURN Int32ValS(std); - END Int32Val; - - PROCEDURE LongRealValS*(sequence: Sequence): LONGREAL; - (* get a uniformly distributed longreal value in [0..1) *) - BEGIN - IF longRealValS IN sequence.caps THEN - RETURN sequence.if.longRealValS(sequence) - ELSE - RETURN 0.5 + - Int32ValS(sequence) / (0. - MIN(Types.Int32) - MIN(Types.Int32)) - END; - END LongRealValS; - - PROCEDURE LongRealVal*(): LONGREAL; - (* get a uniformly distributed longreal value in [0..1) *) - BEGIN - RETURN LongRealValS(std) - END LongRealVal; - - PROCEDURE RealValS*(sequence: Sequence): REAL; - (* get a uniformly distributed real value in [0..1) *) - BEGIN - RETURN SHORT(LongRealValS(sequence)) - END RealValS; - - PROCEDURE RealVal*(): REAL; - (* get a uniformly distributed real value in [0..1) *) - BEGIN - RETURN SHORT(LongRealValS(std)) - END RealVal; - - PROCEDURE ValS*(sequence: Sequence; low, high: LONGINT): LONGINT; - (* get a uniformly distributed integer in [low..high] *) - BEGIN - ASSERT(low <= high); - RETURN Entier( low + LongRealValS(sequence) * (1. + high - low) ) - END ValS; - - PROCEDURE Val*(low, high: LONGINT): LONGINT; - (* get a uniformly distributed integer in [low..high] *) - BEGIN - RETURN ValS(std, low, high) - END Val; - - PROCEDURE FlipS*(sequence: Sequence): BOOLEAN; - (* return TRUE or FALSE *) - BEGIN - IF int32ValS IN sequence.caps THEN - RETURN sequence.if.int32ValS(sequence) >= 0 - ELSE - RETURN sequence.if.longRealValS(sequence) >= 0.5 - END; - END FlipS; - - PROCEDURE Flip*(): BOOLEAN; - (* return TRUE or FALSE *) - BEGIN - RETURN FlipS(std) - END Flip; - - PROCEDURE Support*(type: Services.Type; setValS: SetValSProc); - (* support service for type *) - VAR - serviceDisc: ServiceDiscipline; - BEGIN - NEW(serviceDisc); - serviceDisc.id := serviceDiscID; - serviceDisc.setValS := setValS; - Disciplines.Add(type, serviceDisc); - Services.Define(type, service, NIL); - END Support; - - PROCEDURE SetValS*(sequence: Sequence; value: Operations.Operand); - (* store random value from sequence into already initialized value *) - VAR - baseType : Services.Type; - serviceDisc: ServiceDiscipline; - ok : BOOLEAN; - BEGIN - Services.GetSupportedBaseType(value, service, baseType); - ok := Disciplines.Seek(baseType, serviceDiscID, S.VAL(Disciplines.Discipline, serviceDisc)); - ASSERT(ok); - serviceDisc.setValS(sequence, value); - END SetValS; - - PROCEDURE SetVal*(value: Operations.Operand); - (* store random value from std sequence into already initialized value *) - BEGIN - SetValS(std, value); - END SetVal; - - (* ----- DefaultSequence ----- *) - - PROCEDURE CongruentialStep(VAR value1, value2: LONGINT); - BEGIN - value1 := - factor1 * (value1 MOD quotient1) - remainder1 * (value1 DIV quotient1); - IF value1 < 0 THEN - INC(value1, modulus1); - END; - value2 := - factor2 * (value2 MOD quotient2) - remainder2 * (value2 DIV quotient2); - IF value2 < 0 THEN - INC(value2, modulus2); - END; - END CongruentialStep; - - PROCEDURE DefaultSequenceValue(sequence: Sequence): LONGREAL; - VAR - value: LONGINT; - BEGIN - WITH sequence: DefaultSequence DO - CongruentialStep(sequence.value1, sequence.value2); - value := sequence.value1 - sequence.value2; - IF value <= 0 THEN - INC(value, modulus1); - END; - RETURN (value - 1.) / (modulus1 - 1.) - END; - END DefaultSequenceValue; - - PROCEDURE DefaultSequenceRewind(sequence: Sequence); - BEGIN - WITH sequence: DefaultSequence DO - sequence.value1 := sequence.seed1; - sequence.value2 := sequence.seed2; - END; - END DefaultSequenceRewind; - - PROCEDURE DefaultSequenceRestart(sequence, seed: Sequence); - BEGIN - WITH sequence: DefaultSequence DO - sequence.seed1 := ValS(seed, 1, modulus1-1); - sequence.seed2 := ValS(seed, 1, modulus2-1); - sequence.value1 := sequence.seed1; - sequence.value2 := sequence.seed2; - END; - END DefaultSequenceRestart; - - PROCEDURE CreateDefaultSequences; - VAR - mySeed, myStd: DefaultSequence; - if: Interface; - daytime: Times.Time; - timeval: Times.TimeValueRec; - count: LONGINT; - - PROCEDURE Hash(str: ARRAY OF CHAR): LONGINT; - VAR - index, - val: LONGINT; - BEGIN - val := 27567352; - index := 0; - WHILE str[index] # 0X DO - val := (val MOD 16777216) * 128 + - (val DIV 16777216 + ORD(str[index])) MOD 128; - INC(index); - END; (*WHILE*) - RETURN val - END Hash; - - BEGIN - (* define interface for all default sequences *) - NEW(if); - if.longRealValS := DefaultSequenceValue; - if.rewindSequence := DefaultSequenceRewind; - if.restartSequence := DefaultSequenceRestart; - - (* fake initial randomness using some portably accessible sources *) - NEW(mySeed); - Services.Init(mySeed, defaultSequenceType); - Init(mySeed, if, {longRealValS}); - Clocks.GetTime(Clocks.system, daytime); - Times.GetValue(daytime, timeval); - (* extract those 31 bits from daytime that are most likely to vary *) - mySeed.value1 := timeval.usec * 2048 + timeval.second MOD 65536 + 1; - (* generate 31 more bits from the process name *) - mySeed.value2 := Hash(Process.name) MOD (modulus2 - 1) + 1; - (* scramble these values *) - count := 0; - WHILE count < 4 DO - CongruentialStep(mySeed.value1, mySeed.value2); - INC(count); - END; - (* mix them together *) - DefaultSequenceRestart(mySeed, mySeed); - seed := mySeed; - - (* now use our seed to initialize std sequence *) - NEW(myStd); - Services.Init(myStd, defaultSequenceType); - Init(myStd, if, {longRealValS, rewindSequence, restartSequence}); - DefaultSequenceRestart(myStd, mySeed); - std := myStd; - - unpredictable := NIL; - END CreateDefaultSequences; + unpredictable := NIL; + END CreateDefaultSequences; BEGIN - serviceDiscID := Disciplines.Unique(); - Services.Create(service, "RandomGenerators"); - Services.CreateType(sequenceType, "RandomGenerators.Sequence", ""); - Services.CreateType(defaultSequenceType, "RandomGenerators.DefaultSequence", - "RandomGenerators.Sequence"); - CreateDefaultSequences; + serviceDiscID := Disciplines.Unique(); + Services.Create(service, "RandomGenerators"); + Services.CreateType(sequenceType, "RandomGenerators.Sequence", ""); + Services.CreateType(defaultSequenceType, "RandomGenerators.DefaultSequence", + "RandomGenerators.Sequence"); + CreateDefaultSequences; END ulmRandomGenerators. diff --git a/src/library/ulm/ulmRelatedEvents.Mod b/src/library/ulm/ulmRelatedEvents.Mod index 6f9a0c32..a5ad5453 100644 --- a/src/library/ulm/ulmRelatedEvents.Mod +++ b/src/library/ulm/ulmRelatedEvents.Mod @@ -1,422 +1,429 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: RelatedEven.om,v 1.8 2005/04/28 08:30:09 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: RelatedEven.om,v $ - Revision 1.8 2005/04/28 08:30:09 borchert - added assertion to Forward that takes care that from # to - (otherwise we get a nasty infinite loop) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: RelatedEven.om,v 1.8 2005/04/28 08:30:09 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: RelatedEven.om,v $ + Revision 1.8 2005/04/28 08:30:09 borchert + added assertion to Forward that takes care that from # to + (otherwise we get a nasty infinite loop) - Revision 1.7 2004/09/09 21:04:24 borchert - undoing change of Revision 1.5: - fields dependants and dependson must not be subject of - Save/Restore as this makes it impossible to undo the - dependencies within the TerminationHandler - we no longer remove the discipline in case of terminated - objects as this causes a list of error events to be lost + Revision 1.7 2004/09/09 21:04:24 borchert + undoing change of Revision 1.5: + fields dependants and dependson must not be subject of + Save/Restore as this makes it impossible to undo the + dependencies within the TerminationHandler + we no longer remove the discipline in case of terminated + objects as this causes a list of error events to be lost - Revision 1.6 2004/02/18 17:01:59 borchert - Raise asserts now that event.type # NIL + Revision 1.6 2004/02/18 17:01:59 borchert + Raise asserts now that event.type # NIL - Revision 1.5 2004/02/18 16:53:48 borchert - fields dependants and dependson moved from discipline to state - object to support them for Save/Restore + Revision 1.5 2004/02/18 16:53:48 borchert + fields dependants and dependson moved from discipline to state + object to support them for Save/Restore - Revision 1.4 1998/01/12 14:39:18 borchert - some bug fixes around RelatedEvents.null + Revision 1.4 1998/01/12 14:39:18 borchert + some bug fixes around RelatedEvents.null - Revision 1.3 1995/03/20 17:05:13 borchert - - Save & Restore added - - support for Forwarders & Resources added + Revision 1.3 1995/03/20 17:05:13 borchert + - Save & Restore added + - support for Forwarders & Resources added - Revision 1.2 1994/08/27 14:49:44 borchert - null object added + Revision 1.2 1994/08/27 14:49:44 borchert + null object added - Revision 1.1 1994/02/22 20:09:53 borchert - Initial revision + Revision 1.1 1994/02/22 20:09:53 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 11/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 11/91 + ---------------------------------------------------------------------------- *) MODULE ulmRelatedEvents; - (* relate events to objects *) + (* relate events to objects *) - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Forwarders := ulmForwarders, Objects := ulmObjects, Priorities := ulmPriorities, Resources := ulmResources, SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Forwarders := ulmForwarders, Objects := ulmObjects, Priorities := ulmPriorities, Resources := ulmResources, SYSTEM; - CONST - (* possible directions of propagated events *) - forward = 0; (* forward along the forwardTo chain, if given *) - backward = 1; (* forward event to all dependants, if present *) - both = 2; (* forward event to both directions *) - TYPE - Direction = SHORTINT; (* forward, backward, both *) + CONST + (* possible directions of propagated events *) + forward = 0; (* forward along the forwardTo chain, if given *) + backward = 1; (* forward event to all dependants, if present *) + both = 2; (* forward event to both directions *) + TYPE + Direction = SHORTINT; (* forward, backward, both *) - TYPE - Object* = Disciplines.Object; - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - object*: Object; - event*: Events.Event; - END; - Queue* = POINTER TO QueueRec; - QueueRec* = - RECORD - (Objects.ObjectRec) - event*: Events.Event; - next*: Queue; - END; - ObjectList = POINTER TO ObjectListRec; - ObjectListRec = - RECORD - object: Object; - next: ObjectList; - END; - - TYPE - State = POINTER TO StateRec; - StateRec = - RECORD - default: BOOLEAN; (* default reaction? *) - eventType: Events.EventType; (* may be NIL *) - queue: BOOLEAN; (* are events to be queued? *) - forwardto: Object; - head, tail: Queue; - saved: State; - END; - Discipline = POINTER TO DisciplineRec; - DisciplineRec = - RECORD - (Disciplines.DisciplineRec) - state: State; - dependants: ObjectList; - dependsOn: Object; - END; - VAR - id: Disciplines.Identifier; - VAR - null*: Object; (* object which ignores all related events *) - nullevent: Events.EventType; - - PROCEDURE RemoveDependant(VAR list: ObjectList; dependant: Object); - VAR - prev, p: ObjectList; - BEGIN - prev := NIL; p := list; - WHILE (p # NIL) & (p.object # dependant) DO - prev := p; p := p.next; + TYPE + Object* = Disciplines.Object; + Event* = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + object*: Object; + event*: Events.Event; END; - IF p # NIL THEN - IF prev = NIL THEN - list := p.next; - ELSE - prev.next := p.next; - END; + Queue* = POINTER TO QueueRec; + QueueRec* = + RECORD + (Objects.ObjectRec) + event*: Events.Event; + next*: Queue; END; - END RemoveDependant; - - PROCEDURE TerminationHandler(event: Events.Event); - VAR - disc: Discipline; - BEGIN - WITH event: Resources.Event DO - IF (event.change = Resources.terminated) & - Disciplines.Seek(event.resource, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - IF (disc.dependsOn # NIL) & - Disciplines.Seek(disc.dependsOn, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - RemoveDependant(disc.dependants, event.resource); - disc.dependsOn := NIL; - END; - (* - afb 9/2004: - do not remove this discipline for dead objects - as this makes it impossible to retrieve the final - list of error events - Disciplines.Remove(event.resource, id); - *) - END; + ObjectList = POINTER TO ObjectListRec; + ObjectListRec = + RECORD + object: Object; + next: ObjectList; END; - END TerminationHandler; - PROCEDURE CreateState(VAR state: State); - BEGIN - NEW(state); - state.eventType := NIL; - state.queue := FALSE; state.head := NIL; state.tail := NIL; - state.forwardto := NIL; - state.default := TRUE; - state.saved := NIL; - END CreateState; + TYPE + State = POINTER TO StateRec; + StateRec = + RECORD + default: BOOLEAN; (* default reaction? *) + eventType: Events.EventType; (* may be NIL *) + queue: BOOLEAN; (* are events to be queued? *) + forwardto: Object; + head, tail: Queue; + saved: State; + END; + Discipline = POINTER TO DisciplineRec; + DisciplineRec = + RECORD + (Disciplines.DisciplineRec) + state: State; + dependants: ObjectList; + dependsOn: Object; + END; + VAR + id: Disciplines.Identifier; + VAR + null*: Object; (* object which ignores all related events *) + nullevent: Events.EventType; - PROCEDURE CreateDiscipline(VAR disc: Discipline); - BEGIN - NEW(disc); disc.id := id; CreateState(disc.state); - END CreateDiscipline; - - PROCEDURE GetEventType*(object: Object; VAR eventType: Events.EventType); - (* returns an event type for the given object; - all events related to the object are also handled by this event type - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object = null THEN - eventType := nullevent; + PROCEDURE RemoveDependant(VAR list: ObjectList; dependant: Object); + VAR + prev, p: ObjectList; + BEGIN + prev := NIL; p := list; + WHILE (p # NIL) & (p.object # dependant) DO + prev := p; p := p.next; + END; + IF p # NIL THEN + IF prev = NIL THEN + list := p.next; ELSE - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - state := disc.state; - state.default := FALSE; - IF state.eventType = NIL THEN - Events.Define(state.eventType); - Events.SetPriority(state.eventType, Priorities.liberrors + 1); - Events.Ignore(state.eventType); - END; - eventType := state.eventType; + prev.next := p.next; END; - END GetEventType; + END; + END RemoveDependant; - PROCEDURE Forward*(from, to: Object); - (* causes all events related to `from' to be forwarded to `to' *) - VAR - disc: Discipline; - BEGIN - IF (from # NIL) & (from # null) THEN - ASSERT(from # to); - IF ~Disciplines.Seek(from, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(from, disc); - END; - IF to = null THEN - to := NIL; - END; - disc.state.forwardto := to; - disc.state.default := FALSE; + PROCEDURE Seek(object: Object; id: Disciplines.Identifier; + VAR discipline: Discipline): BOOLEAN; + VAR + disc: Disciplines.Discipline; + result: BOOLEAN; + BEGIN + result := Disciplines.Seek(object, id, disc); + IF result THEN discipline := disc(Discipline) ELSE discipline := NIL END; + RETURN result + END Seek; + + PROCEDURE TerminationHandler(event: Events.Event); + VAR + disc: Discipline; + BEGIN + WITH event: Resources.Event DO + IF (event.change = Resources.terminated) & Seek(event.resource, id, disc) THEN + IF (disc.dependsOn # NIL) & Seek(disc.dependsOn, id, disc) THEN + RemoveDependant(disc.dependants, event.resource); + disc.dependsOn := NIL; + END; + (* + afb 9/2004: + do not remove this discipline for dead objects + as this makes it impossible to retrieve the final + list of error events + Disciplines.Remove(event.resource, id); + *) END; - END Forward; + END; + END TerminationHandler; - PROCEDURE ForwardToDependants(from, to: Forwarders.Object); - (* is called by Forwarders.Forward: - build a backward chain from `to' to `from' - *) - VAR - fromDisc, toDisc: Discipline; - member: ObjectList; - eventType: Events.EventType; - BEGIN - IF (from = null) OR (to = null) THEN RETURN END; - IF ~Disciplines.Seek(from, id, SYSTEM.VAL(Disciplines.Discipline, fromDisc)) THEN (* noch *) - CreateDiscipline(fromDisc); Disciplines.Add(from, fromDisc); + PROCEDURE CreateState(VAR state: State); + BEGIN + NEW(state); + state.eventType := NIL; + state.queue := FALSE; state.head := NIL; state.tail := NIL; + state.forwardto := NIL; + state.default := TRUE; + state.saved := NIL; + END CreateState; + + PROCEDURE CreateDiscipline(VAR disc: Discipline); + BEGIN + NEW(disc); disc.id := id; CreateState(disc.state); + END CreateDiscipline; + + PROCEDURE GetEventType*(object: Object; VAR eventType: Events.EventType); + (* returns an event type for the given object; + all events related to the object are also handled by this event type + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object = null THEN + eventType := nullevent; + ELSE + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); END; - IF fromDisc.dependsOn # NIL THEN RETURN END; - fromDisc.dependsOn := to; - Resources.TakeInterest(from, eventType); - Events.Handler(eventType, TerminationHandler); - - IF ~Disciplines.Seek(to, id, SYSTEM.VAL(Disciplines.Discipline, toDisc)) THEN (* noch *) - CreateDiscipline(toDisc); Disciplines.Add(to, toDisc); + state := disc.state; + state.default := FALSE; + IF state.eventType = NIL THEN + Events.Define(state.eventType); + Events.SetPriority(state.eventType, Priorities.liberrors + 1); + Events.Ignore(state.eventType); END; - NEW(member); member.object := from; - member.next := toDisc.dependants; toDisc.dependants := member; - END ForwardToDependants; + eventType := state.eventType; + END; + END GetEventType; - PROCEDURE QueueEvents*(object: Object); - (* put all incoming events into a queue *) - VAR - disc: Discipline; - state: State; - BEGIN - IF (object # NIL) & (object # null) THEN - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - state := disc.state; - state.default := FALSE; - IF ~state.queue THEN - state.queue := TRUE; state.head := NIL; state.tail := NIL; - END; + PROCEDURE Forward*(from, to: Object); + (* causes all events related to `from' to be forwarded to `to' *) + VAR + disc: Discipline; + BEGIN + IF (from # NIL) & (from # null) THEN + ASSERT(from # to); + IF ~Seek(from, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(from, disc); END; - END QueueEvents; + IF to = null THEN + to := NIL; + END; + disc.state.forwardto := to; + disc.state.default := FALSE; + END; + END Forward; - PROCEDURE GetQueue*(object: Object; VAR queue: Queue); - (* return queue of related events which is removed - from the object; - object must have been prepared by QueueEvents - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF (object # NIL) & (object # null) & - Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & disc.state.queue THEN (* noch *) - state := disc.state; - queue := state.head; state.head := NIL; state.tail := NIL; + PROCEDURE ForwardToDependants(from, to: Forwarders.Object); + (* is called by Forwarders.Forward: + build a backward chain from `to' to `from' + *) + VAR + fromDisc, toDisc: Discipline; + member: ObjectList; + eventType: Events.EventType; + BEGIN + IF (from = null) OR (to = null) THEN RETURN END; + IF ~Seek(from, id, fromDisc) THEN + CreateDiscipline(fromDisc); Disciplines.Add(from, fromDisc); + END; + IF fromDisc.dependsOn # NIL THEN RETURN END; + fromDisc.dependsOn := to; + Resources.TakeInterest(from, eventType); + Events.Handler(eventType, TerminationHandler); + + IF ~Seek(to, id, toDisc) THEN + CreateDiscipline(toDisc); Disciplines.Add(to, toDisc); + END; + NEW(member); member.object := from; + member.next := toDisc.dependants; toDisc.dependants := member; + END ForwardToDependants; + + PROCEDURE QueueEvents*(object: Object); + (* put all incoming events into a queue *) + VAR + disc: Discipline; + state: State; + BEGIN + IF (object # NIL) & (object # null) THEN + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); + END; + state := disc.state; + state.default := FALSE; + IF ~state.queue THEN + state.queue := TRUE; state.head := NIL; state.tail := NIL; + END; + END; + END QueueEvents; + + PROCEDURE GetQueue*(object: Object; VAR queue: Queue); + (* return queue of related events which is removed + from the object; + object must have been prepared by QueueEvents + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF (object # NIL) & (object # null) & Seek(object, id, disc) & disc.state.queue THEN + state := disc.state; + queue := state.head; state.head := NIL; state.tail := NIL; + ELSE + queue := NIL; + END; + END GetQueue; + + PROCEDURE EventsPending*(object: Object) : BOOLEAN; + (* return TRUE if GetQueue will return a queue # NIL *) + VAR + disc: Discipline; + BEGIN + IF (object # NIL) & (object # null) & Seek(object, id, disc) & disc.state.queue THEN + RETURN disc.state.head # NIL + ELSE + RETURN FALSE + END; + END EventsPending; + + PROCEDURE Reset*(object: Object); + (* return to default behaviour *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object # null THEN + IF Seek(object, id, disc) THEN + IF (disc.state.saved = NIL) & + (disc.dependsOn = NIL) & + (disc.dependants = NIL) THEN + Disciplines.Remove(object, id); + ELSE + state := disc.state; + state.queue := FALSE; state.head := NIL; state.tail := NIL; + state.eventType := NIL; state.forwardto := NIL; + state.default := TRUE; + END; + END; + END; + END Reset; + + PROCEDURE Save*(object: Object); + (* save current status of the given object and reset to + default behaviour; + the status includes the reaction types and event queues; + Save operations may be nested + *) + VAR + disc: Discipline; + state: State; + BEGIN + IF object # null THEN + IF ~Seek(object, id, disc) THEN + CreateDiscipline(disc); + Disciplines.Add(object, disc); + END; + CreateState(state); + state.saved := disc.state; disc.state := state; + END; + END Save; + + PROCEDURE Restore*(object: Object); + (* restore status saved earlier by Save *) + VAR + disc: Discipline; + BEGIN + IF Seek(object, id, disc) & (disc.state.saved # NIL) THEN + disc.state := disc.state.saved; + END; + END Restore; + + PROCEDURE InternalRaise(object: Object; dir: Direction; event: Events.Event); + VAR + disc: Discipline; + state: State; + relEvent: Event; + element: Queue; (* new element of queue *) + dependant: ObjectList; + BEGIN + IF (object = null) OR ~Seek(object, id, disc) THEN RETURN END; + + (* backward chaining *) + IF (disc.dependants # NIL) & (dir IN {backward, both}) THEN + dependant := disc.dependants; + WHILE dependant # NIL DO + InternalRaise(dependant.object, backward, event); + dependant := dependant.next; + END; + END; + + (* local handling & forward chaining *) + IF ~disc.state.default THEN + state := disc.state; + IF state.queue THEN + NEW(element); element.next := NIL; element.event := event; + IF state.tail # NIL THEN + state.tail.next := element; + ELSE + state.head := element; + END; + state.tail := element; + END; + IF state.eventType # NIL THEN + NEW(relEvent); + relEvent.message := event.message; + relEvent.type := state.eventType; + relEvent.object := object; + relEvent.event := event; + Events.Raise(relEvent); + END; + IF (state.forwardto # NIL) & (dir IN {both, forward}) THEN + InternalRaise(state.forwardto, forward, event); + END; + END; + END InternalRaise; + + PROCEDURE Raise*(object: Object; event: Events.Event); + VAR + disc: Discipline; + BEGIN + ASSERT(event.type # NIL); + IF object # null THEN + IF (object = NIL) OR ~Seek(object, id, disc) THEN + Events.Raise(event); ELSE - queue := NIL; + InternalRaise(object, both, event); END; - END GetQueue; + END; + END Raise; - PROCEDURE EventsPending*(object: Object) : BOOLEAN; - (* return TRUE if GetQueue will return a queue # NIL *) - VAR - disc: Discipline; - BEGIN - IF (object # NIL) & (object # null) & - Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & disc.state.queue THEN (* noch *) - RETURN disc.state.head # NIL - ELSE - RETURN FALSE - END; - END EventsPending; - - PROCEDURE Reset*(object: Object); - (* return to default behaviour *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object # null THEN - IF Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - IF (disc.state.saved = NIL) & - (disc.dependsOn = NIL) & - (disc.dependants = NIL) THEN - Disciplines.Remove(object, id); - ELSE - state := disc.state; - state.queue := FALSE; state.head := NIL; state.tail := NIL; - state.eventType := NIL; state.forwardto := NIL; - state.default := TRUE; - END; - END; - END; - END Reset; - - PROCEDURE Save*(object: Object); - (* save current status of the given object and reset to - default behaviour; - the status includes the reaction types and event queues; - Save operations may be nested - *) - VAR - disc: Discipline; - state: State; - BEGIN - IF object # null THEN - IF ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - CreateDiscipline(disc); - Disciplines.Add(object, disc); - END; - CreateState(state); - state.saved := disc.state; disc.state := state; - END; - END Save; - - PROCEDURE Restore*(object: Object); - (* restore status saved earlier by Save *) - VAR - disc: Discipline; - BEGIN - IF Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) & (disc.state.saved # NIL) THEN (* noch *) - disc.state := disc.state.saved; - END; - END Restore; - - PROCEDURE InternalRaise(object: Object; dir: Direction; event: Events.Event); - VAR - disc: Discipline; - state: State; - relEvent: Event; - element: Queue; (* new element of queue *) - dependant: ObjectList; - BEGIN - IF (object = null) OR ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN RETURN END; - - (* backward chaining *) - IF (disc.dependants # NIL) & (dir IN {backward, both}) THEN - dependant := disc.dependants; - WHILE dependant # NIL DO - InternalRaise(dependant.object, backward, event); - dependant := dependant.next; - END; - END; - - (* local handling & forward chaining *) - IF ~disc.state.default THEN - state := disc.state; - IF state.queue THEN - NEW(element); element.next := NIL; element.event := event; - IF state.tail # NIL THEN - state.tail.next := element; - ELSE - state.head := element; - END; - state.tail := element; - END; - IF state.eventType # NIL THEN - NEW(relEvent); - relEvent.message := event.message; - relEvent.type := state.eventType; - relEvent.object := object; - relEvent.event := event; - Events.Raise(relEvent); - END; - IF (state.forwardto # NIL) & (dir IN {both, forward}) THEN - InternalRaise(state.forwardto, forward, event); - END; - END; - END InternalRaise; - - PROCEDURE Raise*(object: Object; event: Events.Event); - VAR - disc: Discipline; - BEGIN - ASSERT(event.type # NIL); - IF object # null THEN - IF (object = NIL) OR ~Disciplines.Seek(object, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) - Events.Raise(event); - ELSE - InternalRaise(object, both, event); - END; - END; - END Raise; - - PROCEDURE AppendQueue*(object: Object; queue: Queue); - (* Raise(object, event) for all events of the queue *) - BEGIN - WHILE queue # NIL DO - Raise(object, queue.event); - queue := queue.next; - END; - END AppendQueue; + PROCEDURE AppendQueue*(object: Object; queue: Queue); + (* Raise(object, event) for all events of the queue *) + BEGIN + WHILE queue # NIL DO + Raise(object, queue.event); + queue := queue.next; + END; + END AppendQueue; BEGIN - id := Disciplines.Unique(); - NEW(null); - Events.Define(nullevent); - Forwarders.Register("", ForwardToDependants); + id := Disciplines.Unique(); + NEW(null); + Events.Define(nullevent); + Forwarders.Register("", ForwardToDependants); END ulmRelatedEvents. diff --git a/src/library/ulm/ulmResources.Mod b/src/library/ulm/ulmResources.Mod index 9ff929bd..a700d22a 100644 --- a/src/library/ulm/ulmResources.Mod +++ b/src/library/ulm/ulmResources.Mod @@ -107,19 +107,11 @@ MODULE ulmResources; (* === private procedures ============================================ *) PROCEDURE GetDisc(resource: Resource; VAR disc: Discipline); + VAR d: Disciplines.Discipline; BEGIN - (*IF ~Disciplines.Seek(resource, discID, disc) THEN*) - (* this line causes error - err 123 type of actual parameter is not identical with that of formal VAR-parameter - because Discipline defined in this module is an extention of the same type in module Disciplines - Disciplines.Seek expects Disciplines.Discipline, not the extended type. - voc (ofront, OP2, as well as oo2c) behaves right by not allowing this, while Ulm's Oberon system - accepts this. - So we introduce here a workaround, which makes usage of this module unsafe; - - noch - *) - IF ~Disciplines.Seek(resource, discID, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN (* noch *) + IF Disciplines.Seek(resource, discID, d) THEN + disc := d(Discipline) + ELSE NEW(disc); disc.id := discID; disc.state := alive; disc.refcnt := 0; disc.eventType := NIL; diff --git a/src/library/ulm/ulmScales.Mod b/src/library/ulm/ulmScales.Mod index 5de1188b..12cf5363 100644 --- a/src/library/ulm/ulmScales.Mod +++ b/src/library/ulm/ulmScales.Mod @@ -1,446 +1,446 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Scales.om,v 1.3 2004/09/03 09:31:53 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Scales.om,v $ - Revision 1.3 2004/09/03 09:31:53 borchert - bug fixes: Services.Init added in CreateOperand - Scales.Measure changed to Measure + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Scales.om,v 1.3 2004/09/03 09:31:53 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Scales.om,v $ + Revision 1.3 2004/09/03 09:31:53 borchert + bug fixes: Services.Init added in CreateOperand + Scales.Measure changed to Measure - Revision 1.2 1995/01/16 21:40:39 borchert - - assertions of Assertions converted into real assertions - - fixes due to changed if of PersistentObjects + Revision 1.2 1995/01/16 21:40:39 borchert + - assertions of Assertions converted into real assertions + - fixes due to changed if of PersistentObjects - Revision 1.1 1994/02/22 20:10:03 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:03 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmScales; - IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, - RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM; + IMPORT Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, SYS := SYSTEM; - TYPE - Scale* = POINTER TO ScaleRec; - Family* = POINTER TO FamilyRec; - FamilyRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - reference: Scale; - END; - - TYPE - Unit* = POINTER TO UnitRec; - UnitList = POINTER TO UnitListRec; - UnitListRec = - RECORD - unit: Unit; - next: UnitList; - END; - Interface* = POINTER TO InterfaceRec; - ScaleRec* = - RECORD - (Disciplines.ObjectRec) - (* private components *) - if: Interface; - family: Family; - head, tail: UnitList; - nextUnit: UnitList; - END; - - CONST - unitNameLength* = 32; - TYPE - UnitName* = ARRAY unitNameLength OF CHAR; - UnitRec* = RECORD - (Disciplines.ObjectRec) - name: UnitName; - scale: Scale; + TYPE + Scale* = POINTER TO ScaleRec; + Family* = POINTER TO FamilyRec; + FamilyRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + reference: Scale; END; - CONST - undefined = 0; absolute* = 1; relative* = 2; - TYPE - Measure* = POINTER TO MeasureRec; - MeasureRec* = - RECORD - (Operations.OperandRec) - scale: Scale; - type: SHORTINT; (* absolute or relative? *) - END; - VAR - measureType: Services.Type; + TYPE + Unit* = POINTER TO UnitRec; + UnitList = POINTER TO UnitListRec; + UnitListRec = + RECORD + unit: Unit; + next: UnitList; + END; + Interface* = POINTER TO InterfaceRec; + ScaleRec* = + RECORD + (Disciplines.ObjectRec) + (* private components *) + if: Interface; + family: Family; + head, tail: UnitList; + nextUnit: UnitList; + END; - TYPE - Value* = LONGINT; + CONST + unitNameLength* = 32; + TYPE + UnitName* = ARRAY unitNameLength OF CHAR; + UnitRec* = RECORD + (Disciplines.ObjectRec) + name: UnitName; + scale: Scale; + END; - CONST - add* = Operations.add; sub* = Operations.sub; - TYPE - Operation* = SHORTINT; (* add or sub *) - TYPE - CreateProc* = PROCEDURE (scale: Scale; VAR measure: Measure; abs: BOOLEAN); - GetValueProc* = PROCEDURE (measure: Measure; unit: Unit; VAR value: Value); - SetValueProc* = PROCEDURE (measure: Measure; unit: Unit; value: Value); - AssignProc* = PROCEDURE (target: Measure; source: Measure); - OperatorProc* = PROCEDURE (op: Operation; op1, op2, result: Measure); - CompareProc* = PROCEDURE (op1, op2: Measure) : INTEGER; - ConvertProc* = PROCEDURE (from, to: Measure); - - InterfaceRec* = - RECORD - (Objects.ObjectRec) - create*: CreateProc; - getvalue*: GetValueProc; - setvalue*: SetValueProc; - assign*: AssignProc; - op*: OperatorProc; - compare*: CompareProc; - (* the conversion routines are only to be provided - if the scaling system belongs to a family - *) - scaleToReference*: ConvertProc; - referenceToScale*: ConvertProc; - END; + CONST + undefined = 0; absolute* = 1; relative* = 2; + TYPE + Measure* = POINTER TO MeasureRec; + MeasureRec* = + RECORD + (Operations.OperandRec) + scale: Scale; + type: SHORTINT; (* absolute or relative? *) + END; + VAR + measureType: Services.Type; - VAR - invalidOperation*: Events.EventType; - (* operation cannot be performed for the given combination - of types (absolute or relative) - *) - incompatibleScales*: Events.EventType; - (* the scales of the operands do not belong to the same family *) - badCombination*: Events.EventType; - (* SetValue or GetValue: - given measure and unit do not belong to the same scaling system - *) + TYPE + Value* = LONGINT; - (* our interface to Operations *) - opif: Operations.Interface; - opcaps: Operations.CapabilitySet; + CONST + add* = Operations.add; sub* = Operations.sub; + TYPE + Operation* = SHORTINT; (* add or sub *) + TYPE + CreateProc* = PROCEDURE (scale: Scale; VAR measure: Measure; abs: BOOLEAN); + GetValueProc* = PROCEDURE (measure: Measure; unit: Unit; VAR value: Value); + SetValueProc* = PROCEDURE (measure: Measure; unit: Unit; value: Value); + AssignProc* = PROCEDURE (target: Measure; source: Measure); + OperatorProc* = PROCEDURE (op: Operation; op1, op2, result: Measure); + CompareProc* = PROCEDURE (op1, op2: Measure) : INTEGER; + ConvertProc* = PROCEDURE (from, to: Measure); - (* ======= private procedures ===================================== *) + InterfaceRec* = + RECORD + (Objects.ObjectRec) + create*: CreateProc; + getvalue*: GetValueProc; + setvalue*: SetValueProc; + assign*: AssignProc; + op*: OperatorProc; + compare*: CompareProc; + (* the conversion routines are only to be provided + if the scaling system belongs to a family + *) + scaleToReference*: ConvertProc; + referenceToScale*: ConvertProc; + END; - PROCEDURE DummyConversion(from, to: Measure); - BEGIN - from.scale.if.assign(to, from); - END DummyConversion; + VAR + invalidOperation*: Events.EventType; + (* operation cannot be performed for the given combination + of types (absolute or relative) + *) + incompatibleScales*: Events.EventType; + (* the scales of the operands do not belong to the same family *) + badCombination*: Events.EventType; + (* SetValue or GetValue: + given measure and unit do not belong to the same scaling system + *) - (* ======== exported procedures ==================================== *) + (* our interface to Operations *) + opif: Operations.Interface; + opcaps: Operations.CapabilitySet; - PROCEDURE InitFamily*(family: Family; reference: Scale); - BEGIN - family.reference := reference; - (* the reference scale becomes now a member of the family *) - reference.family := family; - reference.if.scaleToReference := DummyConversion; - reference.if.referenceToScale := DummyConversion; - END InitFamily; + (* ======= private procedures ===================================== *) - PROCEDURE Init*(scale: Scale; family: Family; if: Interface); - (* reference scales are to be initialized with family = NIL *) - BEGIN - scale.if := if; - scale.family := family; - scale.head := NIL; scale.tail := NIL; - scale.nextUnit := NIL; - END Init; + PROCEDURE DummyConversion(from, to: Measure); + BEGIN + from.scale.if.assign(to, from); + END DummyConversion; - PROCEDURE InitUnit*(scale: Scale; unit: Unit; name: UnitName); - VAR - listp: UnitList; - BEGIN - unit.name := name; - unit.scale := scale; - NEW(listp); listp.unit := unit; listp.next := NIL; - IF scale.head # NIL THEN - scale.tail.next := listp; + (* ======== exported procedures ==================================== *) + + PROCEDURE InitFamily*(family: Family; reference: Scale); + BEGIN + family.reference := reference; + (* the reference scale becomes now a member of the family *) + reference.family := family; + reference.if.scaleToReference := DummyConversion; + reference.if.referenceToScale := DummyConversion; + END InitFamily; + + PROCEDURE Init*(scale: Scale; family: Family; if: Interface); + (* reference scales are to be initialized with family = NIL *) + BEGIN + scale.if := if; + scale.family := family; + scale.head := NIL; scale.tail := NIL; + scale.nextUnit := NIL; + END Init; + + PROCEDURE InitUnit*(scale: Scale; unit: Unit; name: UnitName); + VAR + listp: UnitList; + BEGIN + unit.name := name; + unit.scale := scale; + NEW(listp); listp.unit := unit; listp.next := NIL; + IF scale.head # NIL THEN + scale.tail.next := listp; + ELSE + scale.head := listp; + END; + scale.tail := listp; + END InitUnit; + + PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: SHORTINT); + BEGIN + scale.if.create(scale, measure, type = absolute); + Operations.Init(measure, opif, opcaps); + measure.scale := scale; + measure.type := type; + END CreateMeasure; + + PROCEDURE CreateAbsMeasure*(scale: Scale; VAR measure: Measure); + (* init measure to the origin of the given system *) + BEGIN + CreateMeasure(scale, measure, absolute); + END CreateAbsMeasure; + + PROCEDURE CreateRelMeasure*(scale: Scale; VAR measure: Measure); + (* init relative measure to 0 *) + BEGIN + CreateMeasure(scale, measure, relative); + END CreateRelMeasure; + + PROCEDURE ConvertMeasure*(scale: Scale; VAR measure: Measure); + (* convert measure to the given scale which must belong + to the same family as the original scale of measure + *) + VAR + newMeasure: Measure; + refMeasure: Measure; + reference: Scale; + BEGIN + IF scale = measure.scale THEN + (* trivial case -- nothing is to be done *) + RETURN + END; + (* check that both scales belong to the same family *) + ASSERT((scale.family # NIL) & (scale.family = measure.scale.family)); + CreateMeasure(scale, newMeasure, measure.type); + reference := scale.family.reference; + CreateMeasure(reference, refMeasure, measure.type); + measure.scale.if.scaleToReference(measure, refMeasure); + scale.if.referenceToScale(refMeasure, newMeasure); + measure := newMeasure; + END ConvertMeasure; + + PROCEDURE GetReference*(family: Family; VAR reference: Scale); + BEGIN + reference := family.reference; + END GetReference; + + PROCEDURE GetFamily*(scale: Scale; VAR family: Family); + BEGIN + family := scale.family; + END GetFamily; + + PROCEDURE GetScaleOfUnit*(unit: Unit; VAR scale: Scale); + BEGIN + scale := unit.scale; + END GetScaleOfUnit; + + PROCEDURE GetScale*(measure: Measure; VAR scale: Scale); + BEGIN + scale := measure.scale; + END GetScale; + + PROCEDURE TraverseUnits*(scale: Scale); + BEGIN + scale.nextUnit := scale.head; + END TraverseUnits; + + PROCEDURE NextUnit*(scale: Scale; VAR unit: Unit) : BOOLEAN; + BEGIN + IF scale.nextUnit # NIL THEN + unit := scale.nextUnit.unit; + scale.nextUnit := scale.nextUnit.next; + RETURN TRUE + ELSE + RETURN FALSE + END; + END NextUnit; + + PROCEDURE GetName*(unit: Unit; VAR name: UnitName); + BEGIN + name := unit.name; + END GetName; + + PROCEDURE GetValue*(measure: Measure; unit: Unit; VAR value: Value); + VAR + scale: Scale; + BEGIN + scale := measure.scale; + ASSERT(unit.scale = scale); + scale.if.getvalue(measure, unit, value); + END GetValue; + + PROCEDURE SetValue*(measure: Measure; unit: Unit; value: Value); + VAR + scale: Scale; + BEGIN + scale := measure.scale; + ASSERT(unit.scale = scale); + scale.if.setvalue(measure, unit, value); + END SetValue; + + PROCEDURE IsAbsolute*(measure: Measure) : BOOLEAN; + BEGIN + RETURN measure.type = absolute + END IsAbsolute; + + PROCEDURE IsRelative*(measure: Measure) : BOOLEAN; + BEGIN + RETURN measure.type = relative + END IsRelative; + + PROCEDURE MeasureType*(measure: Measure) : SHORTINT; + BEGIN + RETURN measure.type + END MeasureType; + + (* ======== interface procedures for Operations ================= *) + + PROCEDURE CreateOperand(VAR op: Operations.Operand); + (* at this time we don't know anything about the + associated scale -- so we've have to delay this decision + *) + VAR + measure: Measure; + BEGIN + NEW(measure); + measure.type := undefined; + measure.scale := NIL; + Services.Init(measure, measureType); + op := measure; + Operations.Init(op, opif, {Operations.add..Operations.cmp}); + END CreateOperand; + + PROCEDURE Assign(VAR target: Operations.Operand; source: Operations.Operand); + BEGIN + (*WITH source: Measure DO WITH target: Measure DO*) + WITH source: Measure DO IF target IS Measure THEN (* WITH is replaced by IS -- noch *) + (* target is already initialized but possibly to a dummy operand + by CreateOperand + *) + IF target(Measure).type = undefined THEN (* type guard introduced *) + (* init target with the scale of source *) + CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); (* need to cast *) + END; + IF target(Measure).scale # source.scale THEN + (* adapt scale type from source -- + this could lead to a type guard failure if + target is not of the appropiate type + *) + CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); + END; + IF target(Measure).type # source.type THEN + (* adapt measure type from source *) + CreateMeasure(target(Measure).scale, SYS.VAL(Measure, target), source.type); + END; + source.scale.if.assign(SYS.VAL(Measure, target), source); + END; END; + END Assign; + + PROCEDURE CheckCompatibility(op1, op2: Operations.Operand; + VAR m1, m2: Measure); + (* is needed by Op and Compare: + both operands are checked to be members of the same family; + if they have different scales of the same family a + conversion is done; + *) + VAR + scale1, scale2: Scale; + BEGIN + WITH op1: Measure DO WITH op2: Measure DO + scale1 := op1.scale; scale2 := op2.scale; + IF scale1 # scale2 THEN + ASSERT((scale1.family # NIL) & (scale1.family = scale2.family)); + (* convert both operands to the reference scale *) + CreateMeasure(scale1.family.reference, m1, op1.type); + scale1.if.scaleToReference(op1, m1); + CreateMeasure(scale2.family.reference, m2, op2.type); + scale2.if.scaleToReference(op2, m2); ELSE - scale.head := listp; + m1 := op1; + m2 := op2; END; - scale.tail := listp; - END InitUnit; + END; END; + END CheckCompatibility; - PROCEDURE CreateMeasure*(scale: Scale; VAR measure: Measure; type: SHORTINT); - BEGIN - scale.if.create(scale, measure, type = absolute); - Operations.Init(measure, opif, opcaps); - measure.scale := scale; - measure.type := type; - END CreateMeasure; + PROCEDURE Op(op: Operations.Operation; op1, op2: Operations.Operand; + VAR result: Operations.Operand); + VAR + restype: SHORTINT; (* type of result -- set by CheckTypes *) + m1, m2: Measure; - PROCEDURE CreateAbsMeasure*(scale: Scale; VAR measure: Measure); - (* init measure to the origin of the given system *) - BEGIN - CreateMeasure(scale, measure, absolute); - END CreateAbsMeasure; - - PROCEDURE CreateRelMeasure*(scale: Scale; VAR measure: Measure); - (* init relative measure to 0 *) - BEGIN - CreateMeasure(scale, measure, relative); - END CreateRelMeasure; - - PROCEDURE ConvertMeasure*(scale: Scale; VAR measure: Measure); - (* convert measure to the given scale which must belong - to the same family as the original scale of measure + PROCEDURE CheckTypes(VAR restype: SHORTINT); + (* check operands for correct typing; + sets restype to the correct result type; *) - VAR - newMeasure: Measure; - refMeasure: Measure; - reference: Scale; - BEGIN - IF scale = measure.scale THEN - (* trivial case -- nothing is to be done *) - RETURN - END; - (* check that both scales belong to the same family *) - ASSERT((scale.family # NIL) & (scale.family = measure.scale.family)); - CreateMeasure(scale, newMeasure, measure.type); - reference := scale.family.reference; - CreateMeasure(reference, refMeasure, measure.type); - measure.scale.if.scaleToReference(measure, refMeasure); - scale.if.referenceToScale(refMeasure, newMeasure); - measure := newMeasure; - END ConvertMeasure; - - PROCEDURE GetReference*(family: Family; VAR reference: Scale); - BEGIN - reference := family.reference; - END GetReference; - - PROCEDURE GetFamily*(scale: Scale; VAR family: Family); - BEGIN - family := scale.family; - END GetFamily; - - PROCEDURE GetScaleOfUnit*(unit: Unit; VAR scale: Scale); - BEGIN - scale := unit.scale; - END GetScaleOfUnit; - - PROCEDURE GetScale*(measure: Measure; VAR scale: Scale); - BEGIN - scale := measure.scale; - END GetScale; - - PROCEDURE TraverseUnits*(scale: Scale); - BEGIN - scale.nextUnit := scale.head; - END TraverseUnits; - - PROCEDURE NextUnit*(scale: Scale; VAR unit: Unit) : BOOLEAN; - BEGIN - IF scale.nextUnit # NIL THEN - unit := scale.nextUnit.unit; - scale.nextUnit := scale.nextUnit.next; - RETURN TRUE - ELSE - RETURN FALSE - END; - END NextUnit; - - PROCEDURE GetName*(unit: Unit; VAR name: UnitName); - BEGIN - name := unit.name; - END GetName; - - PROCEDURE GetValue*(measure: Measure; unit: Unit; VAR value: Value); - VAR - scale: Scale; - BEGIN - scale := measure.scale; - ASSERT(unit.scale = scale); - scale.if.getvalue(measure, unit, value); - END GetValue; - - PROCEDURE SetValue*(measure: Measure; unit: Unit; value: Value); - VAR - scale: Scale; - BEGIN - scale := measure.scale; - ASSERT(unit.scale = scale); - scale.if.setvalue(measure, unit, value); - END SetValue; - - PROCEDURE IsAbsolute*(measure: Measure) : BOOLEAN; - BEGIN - RETURN measure.type = absolute - END IsAbsolute; - - PROCEDURE IsRelative*(measure: Measure) : BOOLEAN; - BEGIN - RETURN measure.type = relative - END IsRelative; - - PROCEDURE MeasureType*(measure: Measure) : SHORTINT; - BEGIN - RETURN measure.type - END MeasureType; - - (* ======== interface procedures for Operations ================= *) - - PROCEDURE CreateOperand(VAR op: Operations.Operand); - (* at this time we don't know anything about the - associated scale -- so we've have to delay this decision - *) - VAR - measure: Measure; - BEGIN - NEW(measure); - measure.type := undefined; - measure.scale := NIL; - Services.Init(measure, measureType); - op := measure; - Operations.Init(op, opif, {Operations.add..Operations.cmp}); - END CreateOperand; - - PROCEDURE Assign(VAR target: Operations.Operand; source: Operations.Operand); - BEGIN - (*WITH source: Measure DO WITH target: Measure DO*) - WITH source: Measure DO IF target IS Measure THEN (* WITH is replaced by IS -- noch *) - (* target is already initialized but possibly to a dummy operand - by CreateOperand - *) - IF target(Measure).type = undefined THEN (* type guard introduced *) - (* init target with the scale of source *) - CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); (* need to cast *) - END; - IF target(Measure).scale # source.scale THEN - (* adapt scale type from source -- - this could lead to a type guard failure if - target is not of the appropiate type - *) - CreateMeasure(source.scale, SYS.VAL(Measure, target), source.type); - END; - IF target(Measure).type # source.type THEN - (* adapt measure type from source *) - CreateMeasure(target(Measure).scale, SYS.VAL(Measure, target), source.type); - END; - source.scale.if.assign(SYS.VAL(Measure, target), source); + VAR ok: BOOLEAN; + BEGIN + (*WITH op1: Measure DO WITH op2: Measure DO*) + IF op1 IS Measure THEN IF op2 IS Measure THEN + CASE op OF + | Operations.add: (* only abs + abs is invalid *) + ok := (op1(Measure).type = relative) OR + (op2(Measure).type = relative); + IF op1(Measure).type = op2(Measure).type THEN + (* both are relative *) + restype := relative; + ELSE + (* exactly one absolute type is involved *) + restype := absolute; + END; + | Operations.sub: (* only rel - abs is invalid *) + ok := op1(Measure).type <= op2(Measure).type; + IF op1(Measure).type # op2(Measure).type THEN + (* abs - rel *) + restype := absolute; + ELSE + (* abs - abs or rel - rel *) + restype := relative; + END; + ELSE + END; + ASSERT(ok); (* invalid operation *) END; END; - END Assign; + END CheckTypes; - PROCEDURE CheckCompatibility(op1, op2: Operations.Operand; - VAR m1, m2: Measure); - (* is needed by Op and Compare: - both operands are checked to be members of the same family; - if they have different scales of the same family a - conversion is done; - *) - VAR - scale1, scale2: Scale; - BEGIN - WITH op1: Measure DO WITH op2: Measure DO - scale1 := op1.scale; scale2 := op2.scale; - IF scale1 # scale2 THEN - ASSERT((scale1.family # NIL) & (scale1.family = scale2.family)); - (* convert both operands to the reference scale *) - CreateMeasure(scale1.family.reference, m1, op1.type); - scale1.if.scaleToReference(op1, m1); - CreateMeasure(scale2.family.reference, m2, op2.type); - scale2.if.scaleToReference(op2, m2); - ELSE - m1 := op1; - m2 := op2; - END; - END; END; - END CheckCompatibility; - - PROCEDURE Op(op: Operations.Operation; op1, op2: Operations.Operand; - VAR result: Operations.Operand); - VAR - restype: SHORTINT; (* type of result -- set by CheckTypes *) - m1, m2: Measure; - - PROCEDURE CheckTypes(VAR restype: SHORTINT); - (* check operands for correct typing; - sets restype to the correct result type; - *) - VAR ok: BOOLEAN; - BEGIN - (*WITH op1: Measure DO WITH op2: Measure DO*) - IF op1 IS Measure THEN IF op2 IS Measure THEN - CASE op OF - | Operations.add: (* only abs + abs is invalid *) - ok := (op1(Measure).type = relative) OR - (op2(Measure).type = relative); - IF op1(Measure).type = op2(Measure).type THEN - (* both are relative *) - restype := relative; - ELSE - (* exactly one absolute type is involved *) - restype := absolute; - END; - | Operations.sub: (* only rel - abs is invalid *) - ok := op1(Measure).type <= op2(Measure).type; - IF op1(Measure).type # op2(Measure).type THEN - (* abs - rel *) - restype := absolute; - ELSE - (* abs - abs or rel - rel *) - restype := relative; - END; - ELSE - END; - ASSERT(ok); (* invalid operation *) - END; END; - END CheckTypes; - - BEGIN (* Op *) - (* result is already of type Measure; this is guaranteed by Operations *) - IF result IS Measure THEN - CheckTypes(restype); - CheckCompatibility(op1, op2, m1, m2); - CreateMeasure(m1.scale, SYS.VAL(Measure, result), restype); - m1.scale.if.op(op, m1, m2, SYS.VAL(Measure, result)); - END; - END Op; - - PROCEDURE Compare(op1, op2: Operations.Operand) : INTEGER; - VAR - m1, m2: Measure; - BEGIN + BEGIN (* Op *) + (* result is already of type Measure; this is guaranteed by Operations *) + IF result IS Measure THEN + CheckTypes(restype); CheckCompatibility(op1, op2, m1, m2); - ASSERT(m1.type = m2.type); - CheckCompatibility(op1, op2, m1, m2); - RETURN m1.scale.if.compare(m1, m2) - END Compare; + CreateMeasure(m1.scale, SYS.VAL(Measure, result), restype); + m1.scale.if.op(op, m1, m2, SYS.VAL(Measure, result)); + END; + END Op; - PROCEDURE InitInterface; - BEGIN - NEW(opif); - opif.create := CreateOperand; - opif.assign := Assign; - opif.op := Op; - opif.compare := Compare; - opcaps := {Operations.add, Operations.sub, Operations.cmp}; - END InitInterface; + PROCEDURE Compare(op1, op2: Operations.Operand) : INTEGER; + VAR + m1, m2: Measure; + BEGIN + CheckCompatibility(op1, op2, m1, m2); + ASSERT(m1.type = m2.type); + CheckCompatibility(op1, op2, m1, m2); + RETURN m1.scale.if.compare(m1, m2) + END Compare; + + PROCEDURE InitInterface; + BEGIN + NEW(opif); + opif.create := CreateOperand; + opif.assign := Assign; + opif.op := Op; + opif.compare := Compare; + opcaps := {Operations.add, Operations.sub, Operations.cmp}; + END InitInterface; BEGIN - InitInterface; - PersistentObjects.RegisterType(measureType, - "Scales.Measure", "Operations.Operand", NIL); + InitInterface; + PersistentObjects.RegisterType(measureType, + "Scales.Measure", "Operations.Operand", NIL); END ulmScales. diff --git a/src/library/ulm/ulmServices.Mod b/src/library/ulm/ulmServices.Mod index 3b804e4f..7ec557df 100644 --- a/src/library/ulm/ulmServices.Mod +++ b/src/library/ulm/ulmServices.Mod @@ -1,520 +1,520 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Services.om,v 1.2 2004/09/03 09:34:24 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Services.om,v $ - Revision 1.2 2004/09/03 09:34:24 borchert - cache results of LoadService to avoid further attempts + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Services.om,v 1.2 2004/09/03 09:34:24 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Services.om,v $ + Revision 1.2 2004/09/03 09:34:24 borchert + cache results of LoadService to avoid further attempts - Revision 1.1 1995/03/03 09:32:15 borchert - Initial revision + Revision 1.1 1995/03/03 09:32:15 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmServices; - IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects; + IMPORT Disciplines := ulmDisciplines, Objects := ulmObjects; - TYPE - Type* = POINTER TO TypeRec; - ServiceList = POINTER TO ServiceListRec; - Service* = POINTER TO ServiceRec; - Object* = POINTER TO ObjectRec; - ObjectRec* = - RECORD - (Disciplines.ObjectRec) - type: Type; - installed: ServiceList; (* set of installed services *) - END; - - InstallProc = PROCEDURE (object: Object; service: Service); - - ServiceRec* = - RECORD - (Disciplines.ObjectRec) - name: ARRAY 64 OF CHAR; - next: Service; - END; - - ServiceListRec = - RECORD - service: Service; - type: Type; - install: InstallProc; - next: ServiceList; - END; - - VAR - services: Service; - (* list of services -- needed to support Seek *) - - TYPE - LoadModuleProc* = PROCEDURE (module: ARRAY OF CHAR) : BOOLEAN; - LoadServiceProc* = PROCEDURE (service, for: ARRAY OF CHAR) : BOOLEAN; - LoaderInterface* = POINTER TO LoaderInterfaceRec; - LoaderInterfaceRec* = - RECORD - loadModule*: LoadModuleProc; - loadService*: LoadServiceProc; - END; - VAR - loaderIF: LoaderInterface; - - (* ==== name tables ================================================== *) - - CONST - bufsize = 512; (* length of a name buffer in bytes *) - tabsize = 1171; - TYPE - BufferPosition = INTEGER; - Length = LONGINT; - HashValue = INTEGER; - Buffer = ARRAY bufsize OF CHAR; - NameList = POINTER TO NameListRec; - NameListRec = - RECORD - buffer: Buffer; - next: NameList; - END; - VAR - currentBuf: NameList; currentPos: BufferPosition; - TYPE - TypeRec* = - RECORD - (Disciplines.ObjectRec) - baseType: Type; - services: ServiceList; - cachedservices: ServiceList; (* of base types *) - (* table management *) - hashval: HashValue; - length: Length; - begin: NameList; - pos: BufferPosition; - next: Type; (* next type with same hash value *) - END; - BucketTable = ARRAY tabsize OF Type; - VAR - bucket: BucketTable; - - (* ==== name table management ======================================== *) - - PROCEDURE Hash(name: ARRAY OF CHAR; length: LONGINT) : HashValue; - CONST - shift = 4; - VAR - index: LONGINT; - val: LONGINT; - ch: CHAR; - ordval: INTEGER; - BEGIN - index := 0; val := length; - WHILE index < length DO - ch := name[index]; - IF ch >= " " THEN - ordval := ORD(ch) - ORD(" "); - ELSE - ordval := ORD(MAX(CHAR)) - ORD(" ") + ORD(ch); - END; - val := ASH(val, shift) + ordval; - INC(index); + TYPE + Type* = POINTER TO TypeRec; + ServiceList = POINTER TO ServiceListRec; + Service* = POINTER TO ServiceRec; + Object* = POINTER TO ObjectRec; + ObjectRec* = + RECORD + (Disciplines.ObjectRec) + type: Type; + installed: ServiceList; (* set of installed services *) END; - val := val MOD tabsize; - RETURN SHORT(val) - END Hash; - PROCEDURE CreateBuf(VAR buf: NameList); - BEGIN - NEW(buf); buf.next := NIL; - IF currentBuf # NIL THEN - currentBuf.next := buf; + InstallProc = PROCEDURE (object: Object; service: Service); + + ServiceRec* = + RECORD + (Disciplines.ObjectRec) + name: ARRAY 64 OF CHAR; + next: Service; END; - currentBuf := buf; - currentPos := 0; - END CreateBuf; - PROCEDURE StringLength(string: ARRAY OF CHAR) : LONGINT; - VAR - index: LONGINT; - BEGIN - index := 0; - WHILE (index < LEN(string)) & (string[index] # 0X) DO - INC(index); + ServiceListRec = + RECORD + service: Service; + type: Type; + install: InstallProc; + next: ServiceList; END; - RETURN index - END StringLength; - PROCEDURE InitName(name: Type; string: ARRAY OF CHAR); - VAR - index, length: LONGINT; - firstbuf, buf: NameList; - startpos: BufferPosition; - BEGIN - IF currentBuf = NIL THEN - CreateBuf(buf); + VAR + services: Service; + (* list of services -- needed to support Seek *) + + TYPE + LoadModuleProc* = PROCEDURE (module: ARRAY OF CHAR) : BOOLEAN; + LoadServiceProc* = PROCEDURE (service, for: ARRAY OF CHAR) : BOOLEAN; + LoaderInterface* = POINTER TO LoaderInterfaceRec; + LoaderInterfaceRec* = + RECORD + loadModule*: LoadModuleProc; + loadService*: LoadServiceProc; + END; + VAR + loaderIF: LoaderInterface; + + (* ==== name tables ================================================== *) + + CONST + bufsize = 512; (* length of a name buffer in bytes *) + tabsize = 1171; + TYPE + BufferPosition = INTEGER; + Length = LONGINT; + HashValue = INTEGER; + Buffer = ARRAY bufsize OF CHAR; + NameList = POINTER TO NameListRec; + NameListRec = + RECORD + buffer: Buffer; + next: NameList; + END; + VAR + currentBuf: NameList; currentPos: BufferPosition; + TYPE + TypeRec* = + RECORD + (Disciplines.ObjectRec) + baseType: Type; + services: ServiceList; + cachedservices: ServiceList; (* of base types *) + (* table management *) + hashval: HashValue; + length: Length; + begin: NameList; + pos: BufferPosition; + next: Type; (* next type with same hash value *) + END; + BucketTable = ARRAY tabsize OF Type; + VAR + bucket: BucketTable; + + (* ==== name table management ======================================== *) + + PROCEDURE Hash(name: ARRAY OF CHAR; length: LONGINT) : HashValue; + CONST + shift = 4; + VAR + index: LONGINT; + val: LONGINT; + ch: CHAR; + ordval: INTEGER; + BEGIN + index := 0; val := length; + WHILE index < length DO + ch := name[index]; + IF ch >= " " THEN + ordval := ORD(ch) - ORD(" "); ELSE - buf := currentBuf; + ordval := ORD(MAX(CHAR)) - ORD(" ") + ORD(ch); END; + val := ASH(val, shift) + ordval; + INC(index); + END; + val := val MOD tabsize; + RETURN SHORT(val) + END Hash; - firstbuf := buf; startpos := currentPos; - index := 0; - WHILE (index < LEN(string)) & (string[index] # 0X) DO - IF currentPos = bufsize THEN - CreateBuf(buf); - END; - buf.buffer[currentPos] := string[index]; INC(currentPos); - INC(index); + PROCEDURE CreateBuf(VAR buf: NameList); + BEGIN + NEW(buf); buf.next := NIL; + IF currentBuf # NIL THEN + currentBuf.next := buf; + END; + currentBuf := buf; + currentPos := 0; + END CreateBuf; + + PROCEDURE StringLength(string: ARRAY OF CHAR) : LONGINT; + VAR + index: LONGINT; + BEGIN + index := 0; + WHILE (index < LEN(string)) & (string[index] # 0X) DO + INC(index); + END; + RETURN index + END StringLength; + + PROCEDURE InitName(name: Type; string: ARRAY OF CHAR); + VAR + index, length: LONGINT; + firstbuf, buf: NameList; + startpos: BufferPosition; + BEGIN + IF currentBuf = NIL THEN + CreateBuf(buf); + ELSE + buf := currentBuf; + END; + + firstbuf := buf; startpos := currentPos; + index := 0; + WHILE (index < LEN(string)) & (string[index] # 0X) DO + IF currentPos = bufsize THEN + CreateBuf(buf); END; - length := index; + buf.buffer[currentPos] := string[index]; INC(currentPos); + INC(index); + END; + length := index; - name.hashval := Hash(string, length); - name.length := length; - name.begin := firstbuf; - name.pos := startpos; - name.next := bucket[name.hashval]; - bucket[name.hashval] := name; - END InitName; + name.hashval := Hash(string, length); + name.length := length; + name.begin := firstbuf; + name.pos := startpos; + name.next := bucket[name.hashval]; + bucket[name.hashval] := name; + END InitName; - PROCEDURE EqualName(name: Type; string: ARRAY OF CHAR) : BOOLEAN; - (* precondition: both have the same length *) + PROCEDURE EqualName(name: Type; string: ARRAY OF CHAR) : BOOLEAN; + (* precondition: both have the same length *) + VAR + index: LONGINT; + buf: NameList; + pos: INTEGER; + BEGIN + buf := name.begin; pos := name.pos; + index := 0; + WHILE index < name.length DO + IF pos = bufsize THEN + buf := buf.next; pos := 0; + END; + IF string[index] # buf.buffer[pos] THEN + RETURN FALSE + END; + INC(pos); + INC(index); + END; + RETURN TRUE + END EqualName; + + PROCEDURE SeekName(string: ARRAY OF CHAR; VAR name: Type) : BOOLEAN; + VAR + length: LONGINT; + hashval: HashValue; + p: Type; + BEGIN + length := StringLength(string); + hashval := Hash(string, length); + p := bucket[hashval]; + WHILE (p # NIL) & ((length # p.length) OR ~EqualName(p, string)) DO + p := p.next; + END; + name := p; + RETURN p # NIL + END SeekName; + + PROCEDURE ExtractName(name: Type; VAR string: ARRAY OF CHAR); + VAR + index: LONGINT; + buf: NameList; + pos: INTEGER; + BEGIN + buf := name.begin; pos := name.pos; + index := 0; + WHILE (index + 1 < LEN(string)) & (index < name.length) DO + IF pos = bufsize THEN + buf := buf.next; pos := 0; + END; + string[index] := buf.buffer[pos]; + INC(pos); + INC(index); + END; + string[index] := 0X; + END ExtractName; + + PROCEDURE LoadModule(module: ARRAY OF CHAR) : BOOLEAN; + BEGIN + IF (loaderIF # NIL) & (loaderIF.loadModule # NIL) THEN + RETURN loaderIF.loadModule(module) + ELSE + RETURN FALSE + END; + END LoadModule; + + PROCEDURE LoadService(service, for: ARRAY OF CHAR) : BOOLEAN; + BEGIN + IF (loaderIF # NIL) & (loaderIF.loadService # NIL) THEN + RETURN loaderIF.loadService(service, for) + ELSE + RETURN FALSE + END; + END LoadService; + + PROCEDURE MemberOf(list: ServiceList; service: Service; + VAR member: ServiceList) : BOOLEAN; + VAR + p: ServiceList; + BEGIN + p := list; + WHILE (p # NIL) & (p.service # service) DO + p := p.next; + END; + member := p; + RETURN p # NIL + END MemberOf; + + PROCEDURE SeekService(type: Type; service: Service; + VAR member: ServiceList; + VAR baseType: Type) : BOOLEAN; + + VAR + btype: Type; + cachedservice: ServiceList; + + PROCEDURE Seek(type: Type; service: Service; + VAR member: ServiceList) : BOOLEAN; VAR - index: LONGINT; - buf: NameList; - pos: INTEGER; - BEGIN - buf := name.begin; pos := name.pos; - index := 0; - WHILE index < name.length DO - IF pos = bufsize THEN - buf := buf.next; pos := 0; - END; - IF string[index] # buf.buffer[pos] THEN - RETURN FALSE - END; - INC(pos); - INC(index); + typeName: ARRAY 512 OF CHAR; + BEGIN + IF MemberOf(type.services, service, member) OR + MemberOf(type.cachedservices, service, member) THEN + RETURN TRUE END; + ExtractName(type, typeName); + RETURN LoadService(service.name, typeName) & + MemberOf(type.services, service, member) + END Seek; + + BEGIN (* SeekService *) + btype := type; + WHILE (btype # NIL) & ~Seek(btype, service, member) DO + btype := btype.baseType; + END; + IF (member # NIL) & (btype # type) THEN + (* cache result to avoid further tries to load + a more fitting variant dynamically + *) + NEW(cachedservice); + cachedservice.service := service; + cachedservice.type := member.type; + cachedservice.install := member.install; + cachedservice.next := type.cachedservices; + type.cachedservices := cachedservice; + baseType := member.type; RETURN TRUE - END EqualName; + END; + IF member = NIL THEN + RETURN FALSE + ELSE + baseType := member.type; + RETURN TRUE + END; + END SeekService; - PROCEDURE SeekName(string: ARRAY OF CHAR; VAR name: Type) : BOOLEAN; - VAR - length: LONGINT; - hashval: HashValue; - p: Type; - BEGIN - length := StringLength(string); - hashval := Hash(string, length); - p := bucket[hashval]; - WHILE (p # NIL) & ((length # p.length) OR ~EqualName(p, string)) DO - p := p.next; + PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); + (* get the name of the module where 'name' was defined *) + VAR + index: INTEGER; + BEGIN + index := 0; + WHILE (name[index] # ".") & (name[index] # 0X) & + (index < LEN(module)-1) DO + module[index] := name[index]; INC(index); + END; + module[index] := 0X; + END GetModule; + + (* ==== exported procedures ========================================== *) + + PROCEDURE InitLoader*(if: LoaderInterface); + BEGIN + ASSERT((loaderIF = NIL) & (if # NIL)); + loaderIF := if; + END InitLoader; + + PROCEDURE InitType*(type: Type; name, baseName: ARRAY OF CHAR); + VAR + baseType: Type; + otherType: Type; + ok: BOOLEAN; + BEGIN + IF baseName = "" THEN + baseType := NIL; + ELSE + ok := SeekName(baseName, baseType); ASSERT(ok); + END; + ASSERT(~SeekName(name, otherType)); + InitName(type, name); + type.baseType := baseType; + type.services := NIL; + type.cachedservices := NIL; + END InitType; + + PROCEDURE CreateType*(VAR type: Type; name, baseName: ARRAY OF CHAR); + BEGIN + NEW(type); InitType(type, name, baseName); + END CreateType; + + PROCEDURE Init*(object: Object; type: Type); + BEGIN + ASSERT(type # NIL); + ASSERT(object.type = NIL); + object.type := type; + object.installed := NIL; + END Init; + + PROCEDURE GetType*(object: Object; VAR type: Type); + BEGIN + type := object.type; + END GetType; + + PROCEDURE GetTypeName*(type: Type; VAR name: ARRAY OF CHAR); + BEGIN + ExtractName(type, name); + END GetTypeName; + + PROCEDURE GetBaseType*(type: Type; VAR baseType: Type); + BEGIN + baseType := type.baseType; + END GetBaseType; + + PROCEDURE IsExtensionOf*(type, baseType: Type) : BOOLEAN; + BEGIN + ASSERT(baseType # NIL); + WHILE (type # NIL) & (type # baseType) DO + type := type.baseType; + END; + RETURN type = baseType + END IsExtensionOf; + + PROCEDURE SeekType*(name: ARRAY OF CHAR; VAR type: Type); + VAR + module: ARRAY 64 OF CHAR; + BEGIN + IF ~SeekName(name, type) THEN + (* try to load the associated module *) + GetModule(name, module); + IF ~LoadModule(module) OR ~SeekName(name, type) THEN + type := NIL; END; - name := p; - RETURN p # NIL - END SeekName; + END; + END SeekType; - PROCEDURE ExtractName(name: Type; VAR string: ARRAY OF CHAR); - VAR - index: LONGINT; - buf: NameList; - pos: INTEGER; - BEGIN - buf := name.begin; pos := name.pos; - index := 0; - WHILE (index + 1 < LEN(string)) & (index < name.length) DO - IF pos = bufsize THEN - buf := buf.next; pos := 0; - END; - string[index] := buf.buffer[pos]; - INC(pos); - INC(index); - END; - string[index] := 0X; - END ExtractName; + PROCEDURE Seek*(name: ARRAY OF CHAR; VAR service: Service); + BEGIN + service := services; + WHILE (service # NIL) & (service.name # name) DO + service := service.next; + END; - PROCEDURE LoadModule(module: ARRAY OF CHAR) : BOOLEAN; - BEGIN - IF (loaderIF # NIL) & (loaderIF.loadModule # NIL) THEN - RETURN loaderIF.loadModule(module) - ELSE - RETURN FALSE - END; - END LoadModule; - - PROCEDURE LoadService(service, for: ARRAY OF CHAR) : BOOLEAN; - BEGIN - IF (loaderIF # NIL) & (loaderIF.loadService # NIL) THEN - RETURN loaderIF.loadService(service, for) - ELSE - RETURN FALSE - END; - END LoadService; - - PROCEDURE MemberOf(list: ServiceList; service: Service; - VAR member: ServiceList) : BOOLEAN; - VAR - p: ServiceList; - BEGIN - p := list; - WHILE (p # NIL) & (p.service # service) DO - p := p.next; - END; - member := p; - RETURN p # NIL - END MemberOf; - - PROCEDURE SeekService(type: Type; service: Service; - VAR member: ServiceList; - VAR baseType: Type) : BOOLEAN; - - VAR - btype: Type; - cachedservice: ServiceList; - - PROCEDURE Seek(type: Type; service: Service; - VAR member: ServiceList) : BOOLEAN; - VAR - typeName: ARRAY 512 OF CHAR; - BEGIN - IF MemberOf(type.services, service, member) OR - MemberOf(type.cachedservices, service, member) THEN - RETURN TRUE - END; - ExtractName(type, typeName); - RETURN LoadService(service.name, typeName) & - MemberOf(type.services, service, member) - END Seek; - - BEGIN (* SeekService *) - btype := type; - WHILE (btype # NIL) & ~Seek(btype, service, member) DO - btype := btype.baseType; - END; - IF (member # NIL) & (btype # type) THEN - (* cache result to avoid further tries to load - a more fitting variant dynamically - *) - NEW(cachedservice); - cachedservice.service := service; - cachedservice.type := member.type; - cachedservice.install := member.install; - cachedservice.next := type.cachedservices; - type.cachedservices := cachedservice; - baseType := member.type; - RETURN TRUE - END; - IF member = NIL THEN - RETURN FALSE - ELSE - baseType := member.type; - RETURN TRUE - END; - END SeekService; - - PROCEDURE GetModule(name: ARRAY OF CHAR; VAR module: ARRAY OF CHAR); - (* get the name of the module where 'name' was defined *) - VAR - index: INTEGER; - BEGIN - index := 0; - WHILE (name[index] # ".") & (name[index] # 0X) & - (index < LEN(module)-1) DO - module[index] := name[index]; INC(index); - END; - module[index] := 0X; - END GetModule; - - (* ==== exported procedures ========================================== *) - - PROCEDURE InitLoader*(if: LoaderInterface); - BEGIN - ASSERT((loaderIF = NIL) & (if # NIL)); - loaderIF := if; - END InitLoader; - - PROCEDURE InitType*(type: Type; name, baseName: ARRAY OF CHAR); - VAR - baseType: Type; - otherType: Type; - ok: BOOLEAN; - BEGIN - IF baseName = "" THEN - baseType := NIL; - ELSE - ok := SeekName(baseName, baseType); ASSERT(ok); - END; - ASSERT(~SeekName(name, otherType)); - InitName(type, name); - type.baseType := baseType; - type.services := NIL; - type.cachedservices := NIL; - END InitType; - - PROCEDURE CreateType*(VAR type: Type; name, baseName: ARRAY OF CHAR); - BEGIN - NEW(type); InitType(type, name, baseName); - END CreateType; - - PROCEDURE Init*(object: Object; type: Type); - BEGIN - ASSERT(type # NIL); - ASSERT(object.type = NIL); - object.type := type; - object.installed := NIL; - END Init; - - PROCEDURE GetType*(object: Object; VAR type: Type); - BEGIN - type := object.type; - END GetType; - - PROCEDURE GetTypeName*(type: Type; VAR name: ARRAY OF CHAR); - BEGIN - ExtractName(type, name); - END GetTypeName; - - PROCEDURE GetBaseType*(type: Type; VAR baseType: Type); - BEGIN - baseType := type.baseType; - END GetBaseType; - - PROCEDURE IsExtensionOf*(type, baseType: Type) : BOOLEAN; - BEGIN - ASSERT(baseType # NIL); - WHILE (type # NIL) & (type # baseType) DO - type := type.baseType; - END; - RETURN type = baseType - END IsExtensionOf; - - PROCEDURE SeekType*(name: ARRAY OF CHAR; VAR type: Type); - VAR - module: ARRAY 64 OF CHAR; - BEGIN - IF ~SeekName(name, type) THEN - (* try to load the associated module *) - GetModule(name, module); - IF ~LoadModule(module) OR ~SeekName(name, type) THEN - type := NIL; - END; - END; - END SeekType; - - PROCEDURE Seek*(name: ARRAY OF CHAR; VAR service: Service); - BEGIN + (* try to load a module named after `name', if not successful *) + IF (service = NIL) & LoadModule(name) THEN service := services; WHILE (service # NIL) & (service.name # name) DO - service := service.next; + service := service.next; END; + END; + END Seek; - (* try to load a module named after `name', if not successful *) - IF (service = NIL) & LoadModule(name) THEN - service := services; - WHILE (service # NIL) & (service.name # name) DO - service := service.next; - END; + PROCEDURE Create*(VAR service: Service; name: ARRAY OF CHAR); + + PROCEDURE Created(name: ARRAY OF CHAR) : BOOLEAN; + VAR + service: Service; + BEGIN + service := services; + WHILE (service # NIL) & (service.name # name) DO + service := service.next; END; - END Seek; + RETURN service # NIL + END Created; - PROCEDURE Create*(VAR service: Service; name: ARRAY OF CHAR); + BEGIN + ASSERT(~Created(name)); + NEW(service); + COPY(name, service.name); + service.next := services; services := service; + END Create; - PROCEDURE Created(name: ARRAY OF CHAR) : BOOLEAN; - VAR - service: Service; - BEGIN - service := services; - WHILE (service # NIL) & (service.name # name) DO - service := service.next; - END; - RETURN service # NIL - END Created; + PROCEDURE Define*(type: Type; service: Service; install: InstallProc); + VAR + member: ServiceList; + BEGIN + ASSERT(service # NIL); + (* protect against multiple definitions: *) + ASSERT(~MemberOf(type.services, service, member)); - BEGIN - ASSERT(~Created(name)); - NEW(service); - COPY(name, service.name); - service.next := services; services := service; - END Create; + NEW(member); member.service := service; + member.install := install; member.type := type; + member.next := type.services; type.services := member; + END Define; - PROCEDURE Define*(type: Type; service: Service; install: InstallProc); - VAR - member: ServiceList; - BEGIN - ASSERT(service # NIL); - (* protect against multiple definitions: *) - ASSERT(~MemberOf(type.services, service, member)); - - NEW(member); member.service := service; - member.install := install; member.type := type; - member.next := type.services; type.services := member; - END Define; - - PROCEDURE Install*(object: Object; service: Service) : BOOLEAN; - VAR - member, installed: ServiceList; - baseType: Type; - BEGIN - IF object.type = NIL THEN RETURN FALSE END; - IF ~SeekService(object.type, service, member, baseType) THEN - (* service not supported for this object type *) - RETURN FALSE + PROCEDURE Install*(object: Object; service: Service) : BOOLEAN; + VAR + member, installed: ServiceList; + baseType: Type; + BEGIN + IF object.type = NIL THEN RETURN FALSE END; + IF ~SeekService(object.type, service, member, baseType) THEN + (* service not supported for this object type *) + RETURN FALSE + END; + IF ~MemberOf(object.installed, service, installed) THEN + (* install services only once *) + IF member.install # NIL THEN + member.install(object, service); END; - IF ~MemberOf(object.installed, service, installed) THEN - (* install services only once *) - IF member.install # NIL THEN - member.install(object, service); - END; - NEW(installed); - installed.service := service; - installed.next := object.installed; - object.installed := installed; - END; - RETURN TRUE - END Install; + NEW(installed); + installed.service := service; + installed.next := object.installed; + object.installed := installed; + END; + RETURN TRUE + END Install; - PROCEDURE Supported*(object: Object; service: Service) : BOOLEAN; - VAR - member: ServiceList; - baseType: Type; - BEGIN - RETURN (object.type # NIL) & - SeekService(object.type, service, member, baseType) - END Supported; + PROCEDURE Supported*(object: Object; service: Service) : BOOLEAN; + VAR + member: ServiceList; + baseType: Type; + BEGIN + RETURN (object.type # NIL) & + SeekService(object.type, service, member, baseType) + END Supported; - PROCEDURE Installed*(object: Object; service: Service) : BOOLEAN; - VAR - member: ServiceList; - BEGIN - RETURN MemberOf(object.installed, service, member) - END Installed; + PROCEDURE Installed*(object: Object; service: Service) : BOOLEAN; + VAR + member: ServiceList; + BEGIN + RETURN MemberOf(object.installed, service, member) + END Installed; - PROCEDURE GetSupportedBaseType*(object: Object; service: Service; - VAR baseType: Type); - VAR - member: ServiceList; - BEGIN - IF ~SeekService(object.type, service, member, baseType) THEN - baseType := NIL; - END; - END GetSupportedBaseType; + PROCEDURE GetSupportedBaseType*(object: Object; service: Service; + VAR baseType: Type); + VAR + member: ServiceList; + BEGIN + IF ~SeekService(object.type, service, member, baseType) THEN + baseType := NIL; + END; + END GetSupportedBaseType; BEGIN - currentBuf := NIL; currentPos := 0; loaderIF := NIL; + currentBuf := NIL; currentPos := 0; loaderIF := NIL; END ulmServices. diff --git a/src/library/ulm/ulmStreamDisciplines.Mod b/src/library/ulm/ulmStreamDisciplines.Mod index 686214c9..522f9cda 100644 --- a/src/library/ulm/ulmStreamDisciplines.Mod +++ b/src/library/ulm/ulmStreamDisciplines.Mod @@ -1,246 +1,249 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: StreamDisci.om,v 1.2 1994/07/04 14:53:25 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: StreamDisci.om,v $ - Revision 1.2 1994/07/04 14:53:25 borchert - parameter for indentation width added + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: StreamDisci.om,v 1.2 1994/07/04 14:53:25 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: StreamDisci.om,v $ + Revision 1.2 1994/07/04 14:53:25 borchert + parameter for indentation width added - Revision 1.1 1994/02/22 20:10:34 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:34 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 10/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 10/91 + ---------------------------------------------------------------------------- *) MODULE ulmStreamDisciplines; - (* definition of general-purpose disciplines for streams *) + (* definition of general-purpose disciplines for streams *) - IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM; + IMPORT ASCII := ulmASCII, Disciplines := ulmIndirectDisciplines, Events := ulmEvents, Sets := ulmSets, Streams := ulmStreams, SYSTEM; - TYPE - LineTerminator* = ARRAY 4 OF CHAR; - VAR - badfieldsepset*: Events.EventType; + TYPE + LineTerminator* = ARRAY 4 OF CHAR; + VAR + badfieldsepset*: Events.EventType; - TYPE - StreamDiscipline = POINTER TO StreamDisciplineRec; - StreamDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - lineterm: LineTerminator; - fieldseps: Sets.CharSet; - fieldsep: CHAR; (* one of them *) - whitespace: Sets.CharSet; - indentwidth: INTEGER; - END; - - VAR - id: Disciplines.Identifier; - (* default values *) - defaultFieldSeps: Sets.CharSet; - defaultFieldSep: CHAR; - defaultLineTerm: LineTerminator; - defaultWhiteSpace: Sets.CharSet; - defaultIndentWidth: INTEGER; - - PROCEDURE InitDiscipline(VAR disc: StreamDiscipline); - BEGIN - NEW(disc); disc.id := id; - disc.fieldseps := defaultFieldSeps; - disc.fieldsep := defaultFieldSep; - disc.lineterm := defaultLineTerm; - disc.whitespace := defaultWhiteSpace; - disc.indentwidth := defaultIndentWidth; - END InitDiscipline; - - PROCEDURE SetLineTerm*(s: Streams.Stream; lineterm: LineTerminator); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); + TYPE + StreamDiscipline = POINTER TO StreamDisciplineRec; + StreamDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + lineterm: LineTerminator; + fieldseps: Sets.CharSet; + fieldsep: CHAR; (* one of them *) + whitespace: Sets.CharSet; + indentwidth: INTEGER; END; - disc.lineterm := lineterm; + + VAR + id: Disciplines.Identifier; + (* default values *) + defaultFieldSeps: Sets.CharSet; + defaultFieldSep: CHAR; + defaultLineTerm: LineTerminator; + defaultWhiteSpace: Sets.CharSet; + defaultIndentWidth: INTEGER; + + PROCEDURE InitDiscipline(VAR disc: Disciplines.Discipline); + VAR + sdisc: StreamDiscipline; + BEGIN + NEW(sdisc); sdisc.id := id; + sdisc.fieldseps := defaultFieldSeps; + sdisc.fieldsep := defaultFieldSep; + sdisc.lineterm := defaultLineTerm; + sdisc.whitespace := defaultWhiteSpace; + sdisc.indentwidth := defaultIndentWidth; + disc := sdisc + END InitDiscipline; + + PROCEDURE SetLineTerm*(s: Streams.Stream; lineterm: LineTerminator); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).lineterm := lineterm; + Disciplines.Add(s, disc); + END SetLineTerm; + + PROCEDURE GetLineTerm*(s: Streams.Stream; VAR lineterm: LineTerminator); + (* default line terminator is ASCII.nl *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + lineterm := disc(StreamDiscipline).lineterm; + ELSE + lineterm := defaultLineTerm; + END; + END GetLineTerm; + + PROCEDURE SetFieldSepSet*(s: Streams.Stream; fieldsepset: Sets.CharSet); + (* cardinality of fieldsepset must be >= 1 *) + VAR + disc: Disciplines.Discipline; + ch: CHAR; found: BOOLEAN; + fieldsep: CHAR; + event: Events.Event; + BEGIN + ch := 0X; + LOOP (* seek for the first element inside fieldsepset *) + IF Sets.CharIn(fieldsepset, ch) THEN + found := TRUE; fieldsep := ch; EXIT + END; + IF ch = MAX(CHAR) THEN + found := FALSE; EXIT + END; + ch := CHR(ORD(ch) + 1); + END; + IF ~found THEN + NEW(event); + event.message := "StreamDisciplines.SetFieldSepSet: empty fieldsepset"; + event.type := badfieldsepset; + Events.Raise(event); + RETURN + END; + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).fieldseps := fieldsepset; + disc(StreamDiscipline).fieldsep := fieldsep; + Disciplines.Add(s, disc); + END SetFieldSepSet; + + PROCEDURE GetFieldSepSet*(s: Streams.Stream; VAR fieldsepset: Sets.CharSet); + (* default field separators are ASCII.tab and ASCII.sp *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + fieldsepset := disc(StreamDiscipline).fieldseps; + ELSE + fieldsepset := defaultFieldSeps; + END; + END GetFieldSepSet; + + PROCEDURE SetFieldSep*(s: Streams.Stream; fieldsep: CHAR); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + Sets.InclChar(disc(StreamDiscipline).fieldseps, fieldsep); + disc(StreamDiscipline).fieldsep := fieldsep; + Disciplines.Add(s, disc); + END SetFieldSep; + + PROCEDURE GetFieldSep*(s: Streams.Stream; VAR fieldsep: CHAR); + (* default field separator is ASCII.tab; + if a set of field separators has been given via SetFieldSepSet, + one of them is returned + *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + fieldsep := disc(StreamDiscipline).fieldsep; + ELSE + fieldsep := defaultFieldSep; + END; + END GetFieldSep; + + PROCEDURE GetWhiteSpace*(s: Streams.Stream; VAR whitespace: Sets.CharSet); + (* default: ASCII.tab, ASCII.sp, ASCII.np and ASCII.nl *) + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + whitespace := disc(StreamDiscipline).whitespace; + ELSE + whitespace := defaultWhiteSpace; + END; + END GetWhiteSpace; + + PROCEDURE SetWhiteSpace*(s: Streams.Stream; whitespace: Sets.CharSet); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).whitespace := whitespace; + Disciplines.Add(s, disc); + END SetWhiteSpace; + + PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF indentwidth >= 0 THEN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + disc(StreamDiscipline).indentwidth := indentwidth; Disciplines.Add(s, disc); - END SetLineTerm; + END; + END SetIndentationWidth; - PROCEDURE GetLineTerm*(s: Streams.Stream; VAR lineterm: LineTerminator); - (* default line terminator is ASCII.nl *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - lineterm := disc.lineterm; - ELSE - lineterm := defaultLineTerm; - END; - END GetLineTerm; + PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF Disciplines.Seek(s, id, disc) THEN + indentwidth := disc(StreamDiscipline).indentwidth; + ELSE + indentwidth := defaultIndentWidth; + END; + END GetIndentationWidth; - PROCEDURE SetFieldSepSet*(s: Streams.Stream; fieldsepset: Sets.CharSet); - (* cardinality of fieldsepset must be >= 1 *) - VAR - disc: StreamDiscipline; - ch: CHAR; found: BOOLEAN; - fieldsep: CHAR; - event: Events.Event; - BEGIN - ch := 0X; - LOOP (* seek for the first element inside fieldsepset *) - IF Sets.CharIn(fieldsepset, ch) THEN - found := TRUE; fieldsep := ch; EXIT - END; - IF ch = MAX(CHAR) THEN - found := FALSE; EXIT - END; - ch := CHR(ORD(ch) + 1); - END; - IF ~found THEN - NEW(event); - event.message := "StreamDisciplines.SetFieldSepSet: empty fieldsepset"; - event.type := badfieldsepset; - Events.Raise(event); - RETURN - END; - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.fieldseps := fieldsepset; - disc.fieldsep := fieldsep; - Disciplines.Add(s, disc); - END SetFieldSepSet; - - PROCEDURE GetFieldSepSet*(s: Streams.Stream; VAR fieldsepset: Sets.CharSet); - (* default field separators are ASCII.tab and ASCII.sp *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - fieldsepset := disc.fieldseps; - ELSE - fieldsepset := defaultFieldSeps; - END; - END GetFieldSepSet; - - PROCEDURE SetFieldSep*(s: Streams.Stream; fieldsep: CHAR); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - Sets.InclChar(disc.fieldseps, fieldsep); - disc.fieldsep := fieldsep; - Disciplines.Add(s, disc); - END SetFieldSep; - - PROCEDURE GetFieldSep*(s: Streams.Stream; VAR fieldsep: CHAR); - (* default field separator is ASCII.tab; - if a set of field separators has been given via SetFieldSepSet, - one of them is returned - *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - fieldsep := disc.fieldsep; - ELSE - fieldsep := defaultFieldSep; - END; - END GetFieldSep; - - PROCEDURE GetWhiteSpace*(s: Streams.Stream; VAR whitespace: Sets.CharSet); - (* default: ASCII.tab, ASCII.sp, ASCII.np and ASCII.nl *) - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - whitespace := disc.whitespace; - ELSE - whitespace := defaultWhiteSpace; - END; - END GetWhiteSpace; - - PROCEDURE SetWhiteSpace*(s: Streams.Stream; whitespace: Sets.CharSet); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.whitespace := whitespace; - Disciplines.Add(s, disc); - END SetWhiteSpace; - - PROCEDURE SetIndentationWidth*(s: Streams.Stream; indentwidth: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF indentwidth >= 0 THEN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - disc.indentwidth := indentwidth; - Disciplines.Add(s, disc); - END; - END SetIndentationWidth; - - PROCEDURE GetIndentationWidth*(s: Streams.Stream; VAR indentwidth: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - indentwidth := disc.indentwidth; - ELSE - indentwidth := defaultIndentWidth; - END; - END GetIndentationWidth; - - PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: INTEGER); - VAR - disc: StreamDiscipline; - BEGIN - IF ~Disciplines.Seek(s, id, SYSTEM.VAL(Disciplines.Discipline, disc)) THEN - InitDiscipline(disc); - END; - IF disc.indentwidth + incr >= 0 THEN - INC(disc.indentwidth, incr);; - END; - Disciplines.Add(s, disc); - END IncrIndentationWidth; + PROCEDURE IncrIndentationWidth*(s: Streams.Stream; incr: INTEGER); + VAR + disc: Disciplines.Discipline; + BEGIN + IF ~Disciplines.Seek(s, id, disc) THEN + InitDiscipline(disc); + END; + IF disc(StreamDiscipline).indentwidth + incr >= 0 THEN + INC(disc(StreamDiscipline).indentwidth, incr);; + END; + Disciplines.Add(s, disc); + END IncrIndentationWidth; BEGIN - Events.Define(badfieldsepset); + Events.Define(badfieldsepset); - id := Disciplines.Unique(); - Sets.InitSet(defaultFieldSeps); - Sets.InclChar(defaultFieldSeps, ASCII.tab); - Sets.InclChar(defaultFieldSeps, ASCII.sp); - defaultFieldSep := ASCII.tab; - defaultLineTerm[0] := ASCII.nl; defaultLineTerm[1] := 0X; - Sets.InitSet(defaultWhiteSpace); - Sets.InclChar(defaultWhiteSpace, ASCII.tab); - Sets.InclChar(defaultWhiteSpace, ASCII.sp); - Sets.InclChar(defaultWhiteSpace, ASCII.np); - Sets.InclChar(defaultWhiteSpace, ASCII.nl); - defaultIndentWidth := 0; + id := Disciplines.Unique(); + Sets.InitSet(defaultFieldSeps); + Sets.InclChar(defaultFieldSeps, ASCII.tab); + Sets.InclChar(defaultFieldSeps, ASCII.sp); + defaultFieldSep := ASCII.tab; + defaultLineTerm[0] := ASCII.nl; defaultLineTerm[1] := 0X; + Sets.InitSet(defaultWhiteSpace); + Sets.InclChar(defaultWhiteSpace, ASCII.tab); + Sets.InclChar(defaultWhiteSpace, ASCII.sp); + Sets.InclChar(defaultWhiteSpace, ASCII.np); + Sets.InclChar(defaultWhiteSpace, ASCII.nl); + defaultIndentWidth := 0; END ulmStreamDisciplines. diff --git a/src/library/ulm/ulmStreams.Mod b/src/library/ulm/ulmStreams.Mod index 149b1220..bb55c3e6 100644 --- a/src/library/ulm/ulmStreams.Mod +++ b/src/library/ulm/ulmStreams.Mod @@ -1,2150 +1,2150 @@ (* Ulm's Oberon Library - Copyright (C) 1989-2001 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-2001 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Streams.om,v 1.13 2005/02/14 23:36:35 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Streams.om,v $ - Revision 1.13 2005/02/14 23:36:35 borchert - bug fix: WritePart called InternalFlush without considering - that s.pos may be implicitly changed - (this assumption was wrong since revision 1.11) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Streams.om,v 1.13 2005/02/14 23:36:35 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Streams.om,v $ + Revision 1.13 2005/02/14 23:36:35 borchert + bug fix: WritePart called InternalFlush without considering + that s.pos may be implicitly changed + (this assumption was wrong since revision 1.11) - Revision 1.12 2004/05/20 09:52:43 borchert - performance improvements: - - WritePart and Write take now the buffer by reference - - ReadByteFromBuf replaced by ReadBytesFromBuf - (contributed by Christian Ehrhardt) + Revision 1.12 2004/05/20 09:52:43 borchert + performance improvements: + - WritePart and Write take now the buffer by reference + - ReadByteFromBuf replaced by ReadBytesFromBuf + (contributed by Christian Ehrhardt) - Revision 1.11 2001/05/03 15:17:58 borchert - InternalFlush adapted for unidirectional pipelines to avoid - unintentional flushes due to buffer boundaries + Revision 1.11 2001/05/03 15:17:58 borchert + InternalFlush adapted for unidirectional pipelines to avoid + unintentional flushes due to buffer boundaries - Revision 1.10 2000/04/25 21:41:47 borchert - Streams.ReadPart loops now for unbuffered streams to collect input - until cnt is reached + Revision 1.10 2000/04/25 21:41:47 borchert + Streams.ReadPart loops now for unbuffered streams to collect input + until cnt is reached - Revision 1.9 1998/03/31 11:13:05 borchert - bug fix: NotificationHandler just reacted on Resources.unreferenced - but not on Resources.terminated + Revision 1.9 1998/03/31 11:13:05 borchert + bug fix: NotificationHandler just reacted on Resources.unreferenced + but not on Resources.terminated - Revision 1.8 1998/03/24 22:58:28 borchert - bug fix in Copy: left was computed incorrectly in case of - copies with fixed length (# -1) + Revision 1.8 1998/03/24 22:58:28 borchert + bug fix in Copy: left was computed incorrectly in case of + copies with fixed length (# -1) - Revision 1.7 1997/04/02 07:50:05 borchert - Copy replaced by a slightly more efficient variant + Revision 1.7 1997/04/02 07:50:05 borchert + Copy replaced by a slightly more efficient variant - Revision 1.6 1996/09/18 07:43:51 borchert - qualified references to own module (i.e. Streams.XXX) removed + Revision 1.6 1996/09/18 07:43:51 borchert + qualified references to own module (i.e. Streams.XXX) removed - Revision 1.5 1996/01/04 16:43:57 borchert - some bug fixes in the updates of read and write regions + Revision 1.5 1996/01/04 16:43:57 borchert + some bug fixes in the updates of read and write regions - Revision 1.4 1995/10/11 09:46:41 borchert - - closeEvent re-introduced (because it gets raised *before* - the actual close) - - bug fix: s.write was diminished in ReadPart but the write region - not properly adjusted - - bug fix: InternalSeek was setting s.left to negative values in - a special case + Revision 1.4 1995/10/11 09:46:41 borchert + - closeEvent re-introduced (because it gets raised *before* + the actual close) + - bug fix: s.write was diminished in ReadPart but the write region + not properly adjusted + - bug fix: InternalSeek was setting s.left to negative values in + a special case - Revision 1.3 1995/04/18 12:17:12 borchert - - Streams.Stream is now an extension of Services.Object - - Library variant of assertions replaced by ASSERT - - support of Resources added - - EnableClose, PreventClose & closeEvent removed + Revision 1.3 1995/04/18 12:17:12 borchert + - Streams.Stream is now an extension of Services.Object + - Library variant of assertions replaced by ASSERT + - support of Resources added + - EnableClose, PreventClose & closeEvent removed - Revision 1.2 1994/07/05 12:45:57 borchert - some minor bug fixes & enhancements: - - ReadPacket added - - streams which don't require cleanup are now subject to the GC - even if Close will never be called for them - - line buffered streams w/o bufio/addrio capability fill now buffer - up to the next line terminator only instead of trying to fill the - whole buffer - - ReadPart didn't set count correctly in all cases - - Touch calls now the flush interface procedure + Revision 1.2 1994/07/05 12:45:57 borchert + some minor bug fixes & enhancements: + - ReadPacket added + - streams which don't require cleanup are now subject to the GC + even if Close will never be called for them + - line buffered streams w/o bufio/addrio capability fill now buffer + up to the next line terminator only instead of trying to fill the + whole buffer + - ReadPart didn't set count correctly in all cases + - Touch calls now the flush interface procedure - Revision 1.1 1994/02/22 20:10:45 borchert - Initial revision + Revision 1.1 1994/02/22 20:10:45 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 6/89 - Major Revision: AFB 1/92: bufpool - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 6/89 + Major Revision: AFB 1/92: bufpool + ---------------------------------------------------------------------------- *) MODULE ulmStreams; - IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Resources := ulmResources, - Services := ulmServices, SYS := ulmSYSTEM, SYSTEM, Types := ulmTypes; + IMPORT Events := ulmEvents, Objects := ulmObjects, Priorities := ulmPriorities, Process := ulmProcess, RelatedEvents := ulmRelatedEvents, Resources := ulmResources, + Services := ulmServices, SYS := ulmSYSTEM, SYSTEM, Types := ulmTypes; - CONST - (* 3rd parameter of Seek *) - (* Whence = (fromStart, fromPos, fromEnd); *) - fromStart* = 0; fromPos* = 1; fromEnd* = 2; + CONST + (* 3rd parameter of Seek *) + (* Whence = (fromStart, fromPos, fromEnd); *) + fromStart* = 0; fromPos* = 1; fromEnd* = 2; - (* capabilities of a stream *) - (* Capability = (read, write, addrio, bufio, seek, tell, trunc, close, - holes, handler); + (* capabilities of a stream *) + (* Capability = (read, write, addrio, bufio, seek, tell, trunc, close, + holes, handler); + *) + read* = 0; write* = 1; addrio* = 2; bufio* = 3; seek* = 4; tell* = 5; + trunc* = 6; flush* = 7; close* = 8; holes* = 9; handler* = 10; + + (* BufMode = (nobuf, linebuf, onebuf, bufpool); *) + nobuf* = 0; linebuf* = 1; onebuf* = 2; bufpool* = 3; + + (* ErrorCode = (NoHandlerDefined, CannotRead, CannotSeek, CloseFailed, + NotLineBuffered, SeekFailed, TellFailed, BadWhence, + CannotTell, WriteFailed, CannotWrite, ReadFailed, + Unbuffered, BadParameters, CannotTrunc, TruncFailed, + NestedCall, FlushFailed); + *) + NoHandlerDefined* = 0; (* no handler defined *) + CannotRead* = 1; (* stream is write only *) + CannotSeek* = 2; (* stream is not capable of seeking *) + CloseFailed* = 3; (* Flush or Close failed *) + NotLineBuffered* = 4; (* LineTerm must not be called *) + SeekFailed* = 5; (* seek operation failed *) + TellFailed* = 6; (* tell operation failed *) + BadWhence* = 7; (* whence value out of [fromStart..fromEnd] *) + CannotTell* = 8; (* stream does not have a current position *) + WriteFailed* = 9; (* write error *) + CannotWrite* = 10; (* stream is read only *) + ReadFailed* = 11; (* read error *) + Unbuffered* = 12; (* operation isn't valid for unbuff'd streams *) + BadParameters* = 13; (* e.g. wrong count or offset values *) + CannotTrunc* = 14; (* stream is not capable of truncating *) + TruncFailed* = 15; (* trunc operation failed *) + NestedCall* = 16; (* nested stream operation *) + FlushFailed* = 17; (* flush operation failed *) + errorcodes* = 18; (* number of error codes *) + + (* === private constants ======================================= *) + bufsize = 8192; (* should be the file system block size *) + defaulttermch = 0AX; (* default line terminator (for linebuf) *) + + TYPE + Address* = Types.Address; + Count* = Types.Count; + Byte* = Types.Byte; + Whence* = SHORTINT; (* Whence = (fromStart, fromPos, fromEnd); *) + CapabilitySet* = SET; (* OF Capability; *) + BufMode* = SHORTINT; + ErrorCode* = SHORTINT; + Stream* = POINTER TO StreamRec; + Message* = RECORD (Objects.ObjectRec) END; + + (* the buffering system: + + buffers are always on bufsize-boundaries + + ok: the other components are defined + pos: file position of cont[0] (pos MOD bufsize = 0) + cont: valid data: cont[rbegin]..cont[rend-1] (read-region) + written data: cont[wbegin]..cont[wend-1] (write-region) + + both regions are maintained (even for non-rw streams) + *) + Buffer = POINTER TO BufferRec; + BufferRec = + RECORD + ok: BOOLEAN; (* TRUE if other components are valid *) + pos: Count; (* file position which corresponds to cont[0] *) + rbegin: Count; (* read-region: starting index *) + rend: Count; (* read-region: ending index *) + wbegin: Count; (* write-region: starting index of dirty region *) + wend: Count; (* write-region: ending index *) + cont: ARRAY bufsize OF Byte; (* buffer contents *) + nextfree: Buffer; (* only needed for released buffers *) + (* components for buffers which are members of a buffer pool *) + prevh, nexth: Buffer; (* next buffer with same the hash value *) + preva, nexta: Buffer; (* sorted list of buffers (access time) *) + END; + + CONST + hashtabsize = 128; (* size of bucket table *) + TYPE + BucketTable = ARRAY hashtabsize OF Buffer; + BufferPool = POINTER TO BufferPoolRec; + BufferPoolRec = + RECORD + maxbuf: INTEGER; (* maximal number of buffers to be used *) + nbuf: INTEGER; (* number of buffers in use *) + bucket: BucketTable; + (* list of all buffers sorted after the last access time; + tail points to the buffer most recently accessed + *) + head, tail: Buffer; + END; + + TYPE + AddrIOProc* = PROCEDURE (s: Stream; ptr: Address; cnt: Count) : Count; + BufIOProc* = PROCEDURE (s: Stream; VAR buf: ARRAY OF Byte; + off, cnt: Count) : Count; + SeekProc* = PROCEDURE (s: Stream; cnt: Count; whence: Whence) : BOOLEAN; + TellProc* = PROCEDURE (s: Stream; VAR cnt: Count) : BOOLEAN; + ReadProc* = PROCEDURE (s: Stream; VAR byte: Byte) : BOOLEAN; + WriteProc* = PROCEDURE (s: Stream; byte: Byte) : BOOLEAN; + TruncProc* = PROCEDURE (s: Stream; cnt: Count) : BOOLEAN; + FlushProc* = PROCEDURE (s: Stream) : BOOLEAN; + CloseProc* = PROCEDURE (s: Stream) : BOOLEAN; + HandlerProc* = PROCEDURE (s: Stream; VAR msg: Message); + + Interface* = POINTER TO InterfaceRec; + InterfaceRec* = + RECORD + (Objects.ObjectRec) + addrread*: AddrIOProc; (* read, addrio *) + addrwrite*: AddrIOProc; (* write, addrio *) + bufread*: BufIOProc; (* read, bufio *) + bufwrite*: BufIOProc; (* write, bufio *) + read*: ReadProc; (* read *) + write*: WriteProc; (* write *) + seek*: SeekProc; (* seek *) + tell*: TellProc; (* tell *) + trunc*: TruncProc; (* trunc *) + flush*: FlushProc; (* flush *) + close*: CloseProc; (* close *) + handler*: HandlerProc; (* handler *) + END; + + StreamRec* = + RECORD + (Services.ObjectRec) + (* following components are set after i/o-operations *) + count*: Count; (* resulting count of last operation *) + errors*: INTEGER; (* incremented for each error; may be set to 0 *) + error*: BOOLEAN; (* last operation successful? *) + lasterror*: ErrorCode; (* error code of last error *) + eof*: BOOLEAN; (* last read-operation with count=0 returned *) + (* === private part ============================================ *) + prev, next: Stream; (* list of open streams *) + if: Interface; caps: CapabilitySet; + bufmode: BufMode; (* buffering mode *) + bidirect: BOOLEAN; (* bidirectional buffering? *) + termch: Byte; (* flush on termch (linebuf only) *) + inlist: BOOLEAN; (* member of the list of opened streams? *) + tiedStream: Stream; (* to be flushed before read operations *) + buf: Buffer; (* current buffer; = NIL for unbuffered streams *) + wbuf: Buffer; (* buffer for writing (only if bidirect = TRUE) *) + bufpool: BufferPool; (* only if bufmode = bufpool *) + validpos: BOOLEAN; (* pos valid? *) + pos: Count; (* current position in stream *) + maxpos: Count; (* maximal position until now (only if buf # NIL) *) + left: Count; (* number of bytes left in buf (after pos) *) + write: Count; (* number of bytes which can be written in buf *) + rpos: Count; (* current position of if.tell *) + wextensible: BOOLEAN; (* write region extensible? *) + eofFound: BOOLEAN; (* eof seen yet? temporary use only *) + lock: BOOLEAN; (* avoid recursive operations *) + flushEvent: Events.EventType; (* valid if # NIL *) + closeEvent: Events.EventType; (* valid if # NIL *) + END; + VAR + type: Services.Type; + + TYPE + (* each error causes an event; + the error number is stored in event.errorcode; + the associated text can be taken from event.message + *) + Event* = POINTER TO EventRec; + EventRec* = + RECORD + (Events.EventRec) + stream*: Stream; + errorcode*: ErrorCode; + END; + + VAR + null*: Stream; (* accepts any output; does not return input *) + (* these streams are set by other modules; + after initialization of Streams they equal `null'; + so, connections with the standard UNIX streams must be + done by other modules + *) + stdin*, stdout*, stderr*: Stream; + errormsg*: ARRAY errorcodes OF Events.Message; + error*: Events.EventType; + + (* === private variables ========================================== *) + + opened: Stream; (* list of opened streams *) + (* this list has been reduced to the set of streams which + need to be cleaned up explicitly; + all other streams are subject to the garbage collection + even if Close has never been called for them *) - read* = 0; write* = 1; addrio* = 2; bufio* = 3; seek* = 4; tell* = 5; - trunc* = 6; flush* = 7; close* = 8; holes* = 9; handler* = 10; + freelist: Buffer; (* list of free buffers *) + nullif: Interface; (* interface of null-devices *) - (* BufMode = (nobuf, linebuf, onebuf, bufpool); *) - nobuf* = 0; linebuf* = 1; onebuf* = 2; bufpool* = 3; + (* === private procedures ========================================= *) - (* ErrorCode = (NoHandlerDefined, CannotRead, CannotSeek, CloseFailed, - NotLineBuffered, SeekFailed, TellFailed, BadWhence, - CannotTell, WriteFailed, CannotWrite, ReadFailed, - Unbuffered, BadParameters, CannotTrunc, TruncFailed, - NestedCall, FlushFailed); + PROCEDURE NewStream(s: Stream); + BEGIN + IF s.inlist THEN + s.prev := NIL; + s.next := opened; + IF opened # NIL THEN + opened.prev := s; + END; + opened := s; + END; + END NewStream; + + PROCEDURE OldStream(s: Stream); + BEGIN + IF s.inlist THEN + IF s.prev # NIL THEN + s.prev.next := s.next; + ELSE + opened := s.next; + END; + IF s.next # NIL THEN + s.next.prev := s.prev; + END; + END; + END OldStream; + + PROCEDURE NewBuffer(VAR b: Buffer); + BEGIN + IF freelist # NIL THEN + b := freelist; + freelist := freelist.nextfree; + ELSE + NEW(b); + END; + b.nextfree := NIL; + b.ok := FALSE; + END NewBuffer; + + PROCEDURE OldBuffer(VAR b: Buffer); + BEGIN + b.nextfree := freelist; + freelist := b; + b := NIL; + END OldBuffer; + + PROCEDURE Error(s: Stream; code: ErrorCode); + VAR + event: Event; + BEGIN + IF s # NIL THEN + INC(s.errors); + s.error := TRUE; + s.lasterror := code; + + (* generate error event *) + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.stream := s; + event.errorcode := code; + RelatedEvents.Raise(s, event); + END; + END Error; + + PROCEDURE ^ InternalFlush(s: Stream) : BOOLEAN; + + (* ===== management of buffer pool ================================== *) + + PROCEDURE InitBufPool(s: Stream); + VAR + index: INTEGER; + BEGIN + s.bufpool.maxbuf := 16; (* default size *) + s.bufpool.nbuf := 0; (* currently, no buffers are allocated *) + s.bufpool.head := NIL; s.bufpool.tail := NIL; + index := 0; + WHILE index < hashtabsize DO + s.bufpool.bucket[index] := NIL; + INC(index); + END; + END InitBufPool; + + PROCEDURE HashValue(pos: Count) : INTEGER; + (* HashValue returns a hash value for pos *) + BEGIN + RETURN SHORT(pos DIV bufsize) MOD hashtabsize + END HashValue; + + PROCEDURE FindBuffer(s: Stream; pos: Count; VAR buf: Buffer) : BOOLEAN; + VAR + index: INTEGER; + bp: Buffer; + BEGIN + index := HashValue(pos); + bp := s.bufpool.bucket[index]; + WHILE bp # NIL DO + IF bp.pos = pos THEN + buf := bp; RETURN TRUE + END; + bp := bp.nexth; (* next buffer with same hash value *) + END; + buf := NIL; + RETURN FALSE + END FindBuffer; + + PROCEDURE GetBuffer(s: Stream); + (* look for buffer for s.pos and make it to the current buffer; + set s.left and s.write in dependance of s.pos + *) + VAR + buf: Buffer; + pos: Count; (* buffer boundary for s.pos *) + posindex: Count; (* buf[posindex] corresponds to s.pos *) + index: INTEGER; (* index into bucket table of the buffer pool *) + + PROCEDURE InitBuf(buf: Buffer); + VAR + index: INTEGER; (* of bucket table *) + BEGIN + buf.ok := TRUE; + buf.pos := pos; + buf.rbegin := posindex; buf.rend := posindex; s.left := 0; + buf.wbegin := posindex; buf.wend := posindex; + s.write := bufsize - posindex; + buf.nextfree := NIL; + + (* insert buf into hash list *) + index := HashValue(pos); + buf.prevh := NIL; + buf.nexth := s.bufpool.bucket[index]; + IF buf.nexth # NIL THEN + buf.nexth.prevh := buf; + END; + s.bufpool.bucket[index] := buf; + + (* buf is already at the end of the sorted list if we + re-use an old buffer *) - NoHandlerDefined* = 0; (* no handler defined *) - CannotRead* = 1; (* stream is write only *) - CannotSeek* = 2; (* stream is not capable of seeking *) - CloseFailed* = 3; (* Flush or Close failed *) - NotLineBuffered* = 4; (* LineTerm must not be called *) - SeekFailed* = 5; (* seek operation failed *) - TellFailed* = 6; (* tell operation failed *) - BadWhence* = 7; (* whence value out of [fromStart..fromEnd] *) - CannotTell* = 8; (* stream does not have a current position *) - WriteFailed* = 9; (* write error *) - CannotWrite* = 10; (* stream is read only *) - ReadFailed* = 11; (* read error *) - Unbuffered* = 12; (* operation isn't valid for unbuff'd streams *) - BadParameters* = 13; (* e.g. wrong count or offset values *) - CannotTrunc* = 14; (* stream is not capable of truncating *) - TruncFailed* = 15; (* trunc operation failed *) - NestedCall* = 16; (* nested stream operation *) - FlushFailed* = 17; (* flush operation failed *) - errorcodes* = 18; (* number of error codes *) + IF s.bufpool.tail # buf THEN + (* append buf to the sorted list *) + buf.nexta := NIL; + IF s.bufpool.tail = NIL THEN + s.bufpool.head := buf; + buf.preva := NIL; + ELSE + s.bufpool.tail.nexta := buf; + buf.preva := s.bufpool.tail; + END; + s.bufpool.tail := buf; + END; + END InitBuf; - (* === private constants ======================================= *) - bufsize = 8192; (* should be the file system block size *) - defaulttermch = 0AX; (* default line terminator (for linebuf) *) + PROCEDURE UseBuffer(s: Stream; buf: Buffer); + (* make buf to the current buffer of s *) + BEGIN + IF s.buf # buf THEN + (* remove buf from sorted list *) + IF buf.preva # NIL THEN + buf.preva.nexta := buf.nexta; + ELSE + s.bufpool.head := buf.nexta; + END; + IF buf.nexta # NIL THEN + buf.nexta.preva := buf.preva; + ELSE + s.bufpool.tail := buf.preva; + END; - TYPE - Address* = Types.Address; - Count* = Types.Count; - Byte* = Types.Byte; - Whence* = SHORTINT; (* Whence = (fromStart, fromPos, fromEnd); *) - CapabilitySet* = SET; (* OF Capability; *) - BufMode* = SHORTINT; - ErrorCode* = SHORTINT; - Stream* = POINTER TO StreamRec; - Message* = RECORD (Objects.ObjectRec) END; + (* append buf to sorted list *) + buf.nexta := NIL; + IF s.bufpool.tail = NIL THEN + s.bufpool.head := buf; + buf.preva := NIL; + ELSE + s.bufpool.tail.nexta := buf; + buf.preva := s.bufpool.tail; + END; + s.bufpool.tail := buf; - (* the buffering system: + (* set current buf of s to buf *) + s.buf := buf; - buffers are always on bufsize-boundaries + (* update s.left and s.write *) + IF buf.rbegin = buf.rend THEN + buf.rbegin := posindex; buf.rend := posindex; s.left := 0; + ELSIF (posindex >= buf.rbegin) & (posindex < buf.rend) THEN + s.left := buf.rend - posindex; + ELSE + s.left := 0; + END; + IF buf.wbegin = buf.wend THEN + buf.wbegin := posindex; buf.wend := posindex; + s.write := bufsize - posindex; + ELSIF (posindex >= buf.wbegin) & (posindex < buf.wend) THEN + s.write := bufsize - posindex; + ELSE + s.write := 0; + END; + END; + END UseBuffer; - ok: the other components are defined - pos: file position of cont[0] (pos MOD bufsize = 0) - cont: valid data: cont[rbegin]..cont[rend-1] (read-region) - written data: cont[wbegin]..cont[wend-1] (write-region) + BEGIN (* GetBuffer *) + posindex := s.pos MOD bufsize; + pos := s.pos - posindex; - both regions are maintained (even for non-rw streams) - *) - Buffer = POINTER TO BufferRec; - BufferRec = - RECORD - ok: BOOLEAN; (* TRUE if other components are valid *) - pos: Count; (* file position which corresponds to cont[0] *) - rbegin: Count; (* read-region: starting index *) - rend: Count; (* read-region: ending index *) - wbegin: Count; (* write-region: starting index of dirty region *) - wend: Count; (* write-region: ending index *) - cont: ARRAY bufsize OF Byte; (* buffer contents *) - nextfree: Buffer; (* only needed for released buffers *) - (* components for buffers which are members of a buffer pool *) - prevh, nexth: Buffer; (* next buffer with same the hash value *) - preva, nexta: Buffer; (* sorted list of buffers (access time) *) - END; + IF ~s.buf.ok THEN + (* init first allocated buffer which has not been used until now *) + InitBuf(s.buf); + INC(s.bufpool.nbuf); + ELSIF s.buf.pos # pos THEN + IF FindBuffer(s, pos, buf) THEN + UseBuffer(s, buf); + ELSE + IF s.bufpool.nbuf >= s.bufpool.maxbuf THEN + (* re-use already allocated buffer *) + buf := s.bufpool.head; + UseBuffer(s, buf); + IF buf.wbegin # buf.wend THEN + IF ~InternalFlush(s) THEN END; + END; - CONST - hashtabsize = 128; (* size of bucket table *) - TYPE - BucketTable = ARRAY hashtabsize OF Buffer; - BufferPool = POINTER TO BufferPoolRec; - BufferPoolRec = - RECORD - maxbuf: INTEGER; (* maximal number of buffers to be used *) - nbuf: INTEGER; (* number of buffers in use *) - bucket: BucketTable; - (* list of all buffers sorted after the last access time; - tail points to the buffer most recently accessed - *) - head, tail: Buffer; - END; + (* remove buf from hash list *) + IF buf.prevh # NIL THEN + buf.prevh.nexth := buf.nexth; + ELSE + index := HashValue(buf.pos); + s.bufpool.bucket[index] := buf.nexth; + END; + IF buf.nexth # NIL THEN + buf.nexth.prevh := buf.prevh; + END; - TYPE - AddrIOProc* = PROCEDURE (s: Stream; ptr: Address; cnt: Count) : Count; - BufIOProc* = PROCEDURE (s: Stream; VAR buf: ARRAY OF Byte; - off, cnt: Count) : Count; - SeekProc* = PROCEDURE (s: Stream; cnt: Count; whence: Whence) : BOOLEAN; - TellProc* = PROCEDURE (s: Stream; VAR cnt: Count) : BOOLEAN; - ReadProc* = PROCEDURE (s: Stream; VAR byte: Byte) : BOOLEAN; - WriteProc* = PROCEDURE (s: Stream; byte: Byte) : BOOLEAN; - TruncProc* = PROCEDURE (s: Stream; cnt: Count) : BOOLEAN; - FlushProc* = PROCEDURE (s: Stream) : BOOLEAN; - CloseProc* = PROCEDURE (s: Stream) : BOOLEAN; - HandlerProc* = PROCEDURE (s: Stream; VAR msg: Message); + InitBuf(buf); + ELSE + (* allocate and initialize new buffer *) + NewBuffer(buf); + InitBuf(buf); + INC(s.bufpool.nbuf); + END; + s.buf := buf; + END; + END; + END GetBuffer; - Interface* = POINTER TO InterfaceRec; - InterfaceRec* = - RECORD - (Objects.ObjectRec) - addrread*: AddrIOProc; (* read, addrio *) - addrwrite*: AddrIOProc; (* write, addrio *) - bufread*: BufIOProc; (* read, bufio *) - bufwrite*: BufIOProc; (* write, bufio *) - read*: ReadProc; (* read *) - write*: WriteProc; (* write *) - seek*: SeekProc; (* seek *) - tell*: TellProc; (* tell *) - trunc*: TruncProc; (* trunc *) - flush*: FlushProc; (* flush *) - close*: CloseProc; (* close *) - handler*: HandlerProc; (* handler *) - END; + PROCEDURE FlushBufPool(s: Stream) : BOOLEAN; + VAR + buf: Buffer; + ok: BOOLEAN; + BEGIN + ok := TRUE; + IF s.bufpool.nbuf > 0 THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + s.buf := buf; + ok := InternalFlush(s) & ok; + buf := buf.nexta; + END; + END; + RETURN ok + END FlushBufPool; - StreamRec* = - RECORD - (Services.ObjectRec) - (* following components are set after i/o-operations *) - count*: Count; (* resulting count of last operation *) - errors*: INTEGER; (* incremented for each error; may be set to 0 *) - error*: BOOLEAN; (* last operation successful? *) - lasterror*: ErrorCode; (* error code of last error *) - eof*: BOOLEAN; (* last read-operation with count=0 returned *) - (* === private part ============================================ *) - prev, next: Stream; (* list of open streams *) - if: Interface; caps: CapabilitySet; - bufmode: BufMode; (* buffering mode *) - bidirect: BOOLEAN; (* bidirectional buffering? *) - termch: Byte; (* flush on termch (linebuf only) *) - inlist: BOOLEAN; (* member of the list of opened streams? *) - tiedStream: Stream; (* to be flushed before read operations *) - buf: Buffer; (* current buffer; = NIL for unbuffered streams *) - wbuf: Buffer; (* buffer for writing (only if bidirect = TRUE) *) - bufpool: BufferPool; (* only if bufmode = bufpool *) - validpos: BOOLEAN; (* pos valid? *) - pos: Count; (* current position in stream *) - maxpos: Count; (* maximal position until now (only if buf # NIL) *) - left: Count; (* number of bytes left in buf (after pos) *) - write: Count; (* number of bytes which can be written in buf *) - rpos: Count; (* current position of if.tell *) - wextensible: BOOLEAN; (* write region extensible? *) - eofFound: BOOLEAN; (* eof seen yet? temporary use only *) - lock: BOOLEAN; (* avoid recursive operations *) - flushEvent: Events.EventType; (* valid if # NIL *) - closeEvent: Events.EventType; (* valid if # NIL *) - END; - VAR + PROCEDURE ReleaseBufPool(s: Stream); + (* precondition: all buffers are flushed *) + VAR + buf: Buffer; + BEGIN + IF s.bufpool.nbuf > 0 THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + s.buf := buf; + OldBuffer(s.buf); + buf := buf.nexta; + END; + END; + NewBuffer(s.buf); + InitBufPool(s); + END ReleaseBufPool; + + (* ================================================================== *) + + PROCEDURE GetBufMode*(s: Stream) : BufMode; + BEGIN + RETURN s.bufmode + END GetBufMode; + + PROCEDURE LineTerm*(s: Stream; termch: Byte); + (* set line terminator of `s' (linebuf) to `termch' *) + BEGIN + s.error := FALSE; + IF s.bufmode = linebuf THEN + s.termch := termch; + ELSE + Error(s, NotLineBuffered); + END; + END LineTerm; + + PROCEDURE Tie*(in, out: Stream); + (* PRE: `in' is an line buffered input stream, + `out' an output stream, + and `in' # `out'; + causes `out' to be flushed before reading from `in'; + `out' may be NIL to undo the effect + *) + BEGIN + in.error := FALSE; + IF in.bufmode # linebuf THEN + Error(in, NotLineBuffered); RETURN + END; + IF (in = out) OR ~(read IN in.caps) OR + (out # NIL) & ~(write IN out.caps) THEN + Error(in, BadParameters); RETURN + END; + in.tiedStream := out; + END Tie; + + PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: INTEGER); + BEGIN + s.error := FALSE; + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN + END; + IF (s.bufmode = bufpool) & (nbuf >= 1) THEN + s.bufpool.maxbuf := nbuf; + END; + s.lock := FALSE; + END SetBufferPoolSize; + + PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: INTEGER); + BEGIN + s.error := FALSE; + CASE s.bufmode OF + | nobuf: nbuf := 0; + | linebuf: nbuf := 1; + | onebuf: nbuf := 1; + | bufpool: nbuf := s.bufpool.maxbuf; + ELSE (* Explicitly ignore unhandled values of s.bufmode *) + END; + END GetBufferPoolSize; + + PROCEDURE Capabilities*(s: Stream) : CapabilitySet; + BEGIN + s.error := FALSE; + RETURN s.caps + END Capabilities; + + PROCEDURE GetFlushEvent*(s: Stream; VAR type: Events.EventType); + (* `type' will be raised BEFORE every flush operation *) + BEGIN + s.error := FALSE; + IF s.flushEvent = NIL THEN + Events.Define(s.flushEvent); + END; + type := s.flushEvent; + END GetFlushEvent; + + PROCEDURE GetCloseEvent*(s: Stream; VAR type: Events.EventType); + (* `type' will be raised BEFORE the stream gets closed; + that means write operations etc. are legal + *) + BEGIN + s.error := FALSE; + IF s.closeEvent = NIL THEN + Events.Define(s.closeEvent); + END; + type := s.closeEvent; + END GetCloseEvent; + + PROCEDURE Close*(s: Stream) : BOOLEAN; + VAR + event: Event; + type: Events.EventType; + otherStream: Stream; + BEGIN + s.error := FALSE; + + IF (s.closeEvent # NIL) & ~SYS.TAS(s.lock) THEN + type := s.closeEvent; s.closeEvent := NIL; + s.lock := FALSE; + Events.SetPriority(type, Events.GetPriority() + 1); + NEW(event); + event.type := type; + event.message := "close event of Streams"; + event.stream := s; + Events.Raise(event); + END; + + IF ~SYS.TAS(s.lock) THEN + IF write IN s.caps THEN + IF s.bufmode = bufpool THEN + IF ~FlushBufPool(s) THEN END; + ELSE + IF ~InternalFlush(s) THEN END; + END; + END; + IF close IN s.caps THEN + IF ~s.if.close(s) THEN + Error(s, CloseFailed); + END; + END; + IF s.buf # NIL THEN + IF s.bufmode = bufpool THEN + ReleaseBufPool(s); + END; + OldBuffer(s.buf); + END; + OldStream(s); + + (* check if this stream has been tied to another stream *) + otherStream := opened; + WHILE otherStream # NIL DO + IF otherStream.tiedStream = s THEN + otherStream.tiedStream := NIL; (* undo tie operation *) + END; + otherStream := otherStream.next; + END; + (* s.lock remains TRUE to prevent further operations *) + Resources.Notify(s, Resources.terminated); + RETURN ~s.error + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Close; + + PROCEDURE Release*(s: Stream); + BEGIN + IF ~Close(s) THEN END; + END Release; + + PROCEDURE CloseAll*; + BEGIN + WHILE opened # NIL DO + (* that's no endless loop; see Close/OldStream *) + Release(opened); + END; + END CloseAll; + + PROCEDURE NotificationHandler(event: Events.Event); + VAR + s: Stream; + BEGIN + IF ~(event IS Resources.Event) THEN RETURN END; + WITH event: Resources.Event DO + IF ~(event.resource IS Stream) THEN RETURN END; + s := event.resource(Stream); + IF event.change IN {Resources.unreferenced, Resources.terminated} THEN + IF ~s.lock THEN + Release(s); + END; + END; + END; + END NotificationHandler; + + PROCEDURE Init*(s: Stream; if: Interface; caps: CapabilitySet; + bufmode: BufMode); + + VAR + eventType: Events.EventType; type: Services.Type; - TYPE - (* each error causes an event; - the error number is stored in event.errorcode; - the associated text can be taken from event.message - *) - Event* = POINTER TO EventRec; - EventRec* = - RECORD - (Events.EventRec) - stream*: Stream; - errorcode*: ErrorCode; - END; + PROCEDURE InitBidirectionalBuffering(s: Stream); + BEGIN + s.validpos := TRUE; + s.pos := 0; + NewBuffer(s.wbuf); + s.buf.ok := TRUE; s.buf.rbegin := 0; s.buf.rend := 0; s.buf.pos := 0; + s.wbuf.ok := TRUE; s.wbuf.wbegin := 0; s.wbuf.wend := 0; + s.wbuf.pos := 0; + s.left := 0; s.write := bufsize; + END InitBidirectionalBuffering; - VAR - null*: Stream; (* accepts any output; does not return input *) - (* these streams are set by other modules; - after initialization of Streams they equal `null'; - so, connections with the standard UNIX streams must be - done by other modules - *) - stdin*, stdout*, stderr*: Stream; - errormsg*: ARRAY errorcodes OF Events.Message; - error*: Events.EventType; - - (* === private variables ========================================== *) - - opened: Stream; (* list of opened streams *) - (* this list has been reduced to the set of streams which - need to be cleaned up explicitly; - all other streams are subject to the garbage collection - even if Close has never been called for them - *) - freelist: Buffer; (* list of free buffers *) - nullif: Interface; (* interface of null-devices *) - - (* === private procedures ========================================= *) - - PROCEDURE NewStream(s: Stream); - BEGIN - IF s.inlist THEN - s.prev := NIL; - s.next := opened; - IF opened # NIL THEN - opened.prev := s; - END; - opened := s; - END; - END NewStream; - - PROCEDURE OldStream(s: Stream); - BEGIN - IF s.inlist THEN - IF s.prev # NIL THEN - s.prev.next := s.next; - ELSE - opened := s.next; - END; - IF s.next # NIL THEN - s.next.prev := s.prev; - END; - END; - END OldStream; - - PROCEDURE NewBuffer(VAR b: Buffer); - BEGIN - IF freelist # NIL THEN - b := freelist; - freelist := freelist.nextfree; - ELSE - NEW(b); - END; - b.nextfree := NIL; - b.ok := FALSE; - END NewBuffer; - - PROCEDURE OldBuffer(VAR b: Buffer); - BEGIN - b.nextfree := freelist; - freelist := b; - b := NIL; - END OldBuffer; - - PROCEDURE Error(s: Stream; code: ErrorCode); - VAR - event: Event; - BEGIN - IF s # NIL THEN - INC(s.errors); - s.error := TRUE; - s.lasterror := code; - - (* generate error event *) - NEW(event); - event.type := error; - event.message := errormsg[code]; - event.stream := s; - event.errorcode := code; - RelatedEvents.Raise(s, event); - END; - END Error; - - PROCEDURE ^ InternalFlush(s: Stream) : BOOLEAN; - - (* ===== management of buffer pool ================================== *) - - PROCEDURE InitBufPool(s: Stream); - VAR - index: INTEGER; - BEGIN - s.bufpool.maxbuf := 16; (* default size *) - s.bufpool.nbuf := 0; (* currently, no buffers are allocated *) - s.bufpool.head := NIL; s.bufpool.tail := NIL; - index := 0; - WHILE index < hashtabsize DO - s.bufpool.bucket[index] := NIL; - INC(index); - END; - END InitBufPool; - - PROCEDURE HashValue(pos: Count) : INTEGER; - (* HashValue returns a hash value for pos *) - BEGIN - RETURN SHORT(pos DIV bufsize) MOD hashtabsize - END HashValue; - - PROCEDURE FindBuffer(s: Stream; pos: Count; VAR buf: Buffer) : BOOLEAN; - VAR - index: INTEGER; - bp: Buffer; - BEGIN - index := HashValue(pos); - bp := s.bufpool.bucket[index]; - WHILE bp # NIL DO - IF bp.pos = pos THEN - buf := bp; RETURN TRUE - END; - bp := bp.nexth; (* next buffer with same hash value *) - END; - buf := NIL; - RETURN FALSE - END FindBuffer; - - PROCEDURE GetBuffer(s: Stream); - (* look for buffer for s.pos and make it to the current buffer; - set s.left and s.write in dependance of s.pos - *) - VAR - buf: Buffer; - pos: Count; (* buffer boundary for s.pos *) - posindex: Count; (* buf[posindex] corresponds to s.pos *) - index: INTEGER; (* index into bucket table of the buffer pool *) - - PROCEDURE InitBuf(buf: Buffer); - VAR - index: INTEGER; (* of bucket table *) - BEGIN - buf.ok := TRUE; - buf.pos := pos; - buf.rbegin := posindex; buf.rend := posindex; s.left := 0; - buf.wbegin := posindex; buf.wend := posindex; - s.write := bufsize - posindex; - buf.nextfree := NIL; - - (* insert buf into hash list *) - index := HashValue(pos); - buf.prevh := NIL; - buf.nexth := s.bufpool.bucket[index]; - IF buf.nexth # NIL THEN - buf.nexth.prevh := buf; - END; - s.bufpool.bucket[index] := buf; - - (* buf is already at the end of the sorted list if we - re-use an old buffer - *) - IF s.bufpool.tail # buf THEN - (* append buf to the sorted list *) - buf.nexta := NIL; - IF s.bufpool.tail = NIL THEN - s.bufpool.head := buf; - buf.preva := NIL; - ELSE - s.bufpool.tail.nexta := buf; - buf.preva := s.bufpool.tail; - END; - s.bufpool.tail := buf; - END; - END InitBuf; - - PROCEDURE UseBuffer(s: Stream; buf: Buffer); - (* make buf to the current buffer of s *) - BEGIN - IF s.buf # buf THEN - (* remove buf from sorted list *) - IF buf.preva # NIL THEN - buf.preva.nexta := buf.nexta; - ELSE - s.bufpool.head := buf.nexta; - END; - IF buf.nexta # NIL THEN - buf.nexta.preva := buf.preva; - ELSE - s.bufpool.tail := buf.preva; - END; - - (* append buf to sorted list *) - buf.nexta := NIL; - IF s.bufpool.tail = NIL THEN - s.bufpool.head := buf; - buf.preva := NIL; - ELSE - s.bufpool.tail.nexta := buf; - buf.preva := s.bufpool.tail; - END; - s.bufpool.tail := buf; - - (* set current buf of s to buf *) - s.buf := buf; - - (* update s.left and s.write *) - IF buf.rbegin = buf.rend THEN - buf.rbegin := posindex; buf.rend := posindex; s.left := 0; - ELSIF (posindex >= buf.rbegin) & (posindex < buf.rend) THEN - s.left := buf.rend - posindex; - ELSE - s.left := 0; - END; - IF buf.wbegin = buf.wend THEN - buf.wbegin := posindex; buf.wend := posindex; - s.write := bufsize - posindex; - ELSIF (posindex >= buf.wbegin) & (posindex < buf.wend) THEN - s.write := bufsize - posindex; - ELSE - s.write := 0; - END; - END; - END UseBuffer; - - BEGIN (* GetBuffer *) - posindex := s.pos MOD bufsize; - pos := s.pos - posindex; - - IF ~s.buf.ok THEN - (* init first allocated buffer which has not been used until now *) - InitBuf(s.buf); - INC(s.bufpool.nbuf); - ELSIF s.buf.pos # pos THEN - IF FindBuffer(s, pos, buf) THEN - UseBuffer(s, buf); - ELSE - IF s.bufpool.nbuf >= s.bufpool.maxbuf THEN - (* re-use already allocated buffer *) - buf := s.bufpool.head; - UseBuffer(s, buf); - IF buf.wbegin # buf.wend THEN - IF ~InternalFlush(s) THEN END; - END; - - (* remove buf from hash list *) - IF buf.prevh # NIL THEN - buf.prevh.nexth := buf.nexth; - ELSE - index := HashValue(buf.pos); - s.bufpool.bucket[index] := buf.nexth; - END; - IF buf.nexth # NIL THEN - buf.nexth.prevh := buf.prevh; - END; - - InitBuf(buf); - ELSE - (* allocate and initialize new buffer *) - NewBuffer(buf); - InitBuf(buf); - INC(s.bufpool.nbuf); - END; - s.buf := buf; - END; - END; - END GetBuffer; - - PROCEDURE FlushBufPool(s: Stream) : BOOLEAN; - VAR - buf: Buffer; - ok: BOOLEAN; - BEGIN - ok := TRUE; - IF s.bufpool.nbuf > 0 THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - s.buf := buf; - ok := InternalFlush(s) & ok; - buf := buf.nexta; - END; - END; - RETURN ok - END FlushBufPool; - - PROCEDURE ReleaseBufPool(s: Stream); - (* precondition: all buffers are flushed *) - VAR - buf: Buffer; - BEGIN - IF s.bufpool.nbuf > 0 THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - s.buf := buf; - OldBuffer(s.buf); - buf := buf.nexta; - END; - END; + BEGIN + ASSERT((s # NIL) & (if # NIL) & ({read, write} * caps # {})); + Services.GetType(s, type); ASSERT(type # NIL); + s.inlist := (close IN caps) OR (bufmode # nobuf) & (write IN caps); + NewStream(s); + (* initialize public part *) + s.count := 0; + s.errors := 0; + s.error := FALSE; + s.lasterror := 0; + s.eof := FALSE; + (* private part *) + s.if := if; s.caps := caps; + s.bufmode := bufmode; + s.validpos := FALSE; + s.left := 0; s.write := 0; + s.tiedStream := NIL; + IF bufmode IN {linebuf, onebuf, bufpool} THEN NewBuffer(s.buf); - InitBufPool(s); - END ReleaseBufPool; - - (* ================================================================== *) - - PROCEDURE GetBufMode*(s: Stream) : BufMode; - BEGIN - RETURN s.bufmode - END GetBufMode; - - PROCEDURE LineTerm*(s: Stream; termch: Byte); - (* set line terminator of `s' (linebuf) to `termch' *) - BEGIN - s.error := FALSE; - IF s.bufmode = linebuf THEN - s.termch := termch; + IF (bufmode = bufpool) & ~(seek IN caps) THEN + bufmode := onebuf; + END; + CASE bufmode OF + | linebuf: s.termch := defaulttermch; + | bufpool: NEW(s.bufpool); InitBufPool(s); ELSE - Error(s, NotLineBuffered); END; - END LineTerm; + s.maxpos := 0; + s.wextensible := {read, write, seek, tell, holes} * caps = + {read, write, seek, tell}; + s.bidirect := {read, write, seek, tell, trunc} * caps = {read, write}; + IF s.bidirect THEN + InitBidirectionalBuffering(s); + ELSE + s.wbuf := NIL; + END; + ELSE + s.buf := NIL; + s.wbuf := NIL; + s.wextensible := FALSE; + s.bidirect := FALSE; + END; + s.flushEvent := NIL; + s.closeEvent := NIL; + Resources.TakeInterest(s, eventType); + Events.Handler(eventType, NotificationHandler); + s.lock := FALSE; + END Init; - PROCEDURE Tie*(in, out: Stream); - (* PRE: `in' is an line buffered input stream, - `out' an output stream, - and `in' # `out'; - causes `out' to be flushed before reading from `in'; - `out' may be NIL to undo the effect - *) - BEGIN - in.error := FALSE; - IF in.bufmode # linebuf THEN - Error(in, NotLineBuffered); RETURN - END; - IF (in = out) OR ~(read IN in.caps) OR - (out # NIL) & ~(write IN out.caps) THEN - Error(in, BadParameters); RETURN - END; - in.tiedStream := out; - END Tie; - - PROCEDURE SetBufferPoolSize*(s: Stream; nbuf: INTEGER); - BEGIN - s.error := FALSE; - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN - END; - IF (s.bufmode = bufpool) & (nbuf >= 1) THEN - s.bufpool.maxbuf := nbuf; + PROCEDURE Send*(s: Stream; VAR message: Message); + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF handler IN s.caps THEN + s.if.handler(s, message); + ELSE + Error(s, NoHandlerDefined); END; s.lock := FALSE; - END SetBufferPoolSize; + ELSE + Error(s, NestedCall); + END; + END Send; - PROCEDURE GetBufferPoolSize*(s: Stream; VAR nbuf: INTEGER); - BEGIN - s.error := FALSE; - CASE s.bufmode OF - | nobuf: nbuf := 0; - | linebuf: nbuf := 1; - | onebuf: nbuf := 1; - | bufpool: nbuf := s.bufpool.maxbuf; - ELSE (* Explicitly ignore unhandled values of s.bufmode *) + (* === private i/o procedures ================================= *) + + PROCEDURE ValidPos(s: Stream); + BEGIN + IF ~s.validpos THEN + IF tell IN s.caps THEN + IF ~s.if.tell(s, s.pos) OR (s.pos < 0) THEN + Error(s, TellFailed); + s.pos := 0; + END; + ELSE + s.pos := 0; END; - END GetBufferPoolSize; + s.rpos := s.pos; + s.validpos := TRUE; + s.left := 0; + s.write := 0; + END; + END ValidPos; - PROCEDURE Capabilities*(s: Stream) : CapabilitySet; - BEGIN - s.error := FALSE; - RETURN s.caps - END Capabilities; + PROCEDURE InitBuf(s: Stream); + BEGIN + IF s.bufmode = bufpool THEN + GetBuffer(s); + ELSE + s.buf.pos := s.pos - s.pos MOD bufsize; + s.buf.wbegin := s.pos MOD bufsize; + s.write := bufsize - s.buf.wbegin; + s.buf.wend := s.buf.wbegin; + s.buf.rbegin := s.buf.wbegin; + s.buf.rend := s.buf.wbegin; + s.left := 0; + s.buf.ok := TRUE; + END; + END InitBuf; - PROCEDURE GetFlushEvent*(s: Stream; VAR type: Events.EventType); - (* `type' will be raised BEFORE every flush operation *) - BEGIN - s.error := FALSE; - IF s.flushEvent = NIL THEN - Events.Define(s.flushEvent); - END; - type := s.flushEvent; - END GetFlushEvent; + PROCEDURE FillBuf(s: Stream) : BOOLEAN; + (* return FALSE on EOF or errors *) + VAR + offset, count: Count; + posindex: Count; (* s.pos MOD bufsize *) - PROCEDURE GetCloseEvent*(s: Stream; VAR type: Events.EventType); - (* `type' will be raised BEFORE the stream gets closed; - that means write operations etc. are legal + PROCEDURE Fill(s: Stream; VAR offset, count: Count) : BOOLEAN; + (* try to fill buf.cont[offset]..buf.cont[offset+count-1]; + return FALSE on EOF; + Fill always extends a read region: + s.buf.rend is set to offset + the number of bytes read *) - BEGIN - s.error := FALSE; - IF s.closeEvent = NIL THEN - Events.Define(s.closeEvent); - END; - type := s.closeEvent; - END GetCloseEvent; - - PROCEDURE Close*(s: Stream) : BOOLEAN; VAR - event: Event; - type: Events.EventType; - otherStream: Stream; - BEGIN - s.error := FALSE; - - IF (s.closeEvent # NIL) & ~SYS.TAS(s.lock) THEN - type := s.closeEvent; s.closeEvent := NIL; - s.lock := FALSE; - Events.SetPriority(type, Events.GetPriority() + 1); - NEW(event); - event.type := type; - event.message := "close event of Streams"; - event.stream := s; - Events.Raise(event); + linetermseen: BOOLEAN; + byte: Byte; + BEGIN + IF s.eofFound THEN + RETURN FALSE END; - - IF ~SYS.TAS(s.lock) THEN - IF write IN s.caps THEN - IF s.bufmode = bufpool THEN - IF ~FlushBufPool(s) THEN END; - ELSE - IF ~InternalFlush(s) THEN END; - END; - END; - IF close IN s.caps THEN - IF ~s.if.close(s) THEN - Error(s, CloseFailed); - END; - END; - IF s.buf # NIL THEN - IF s.bufmode = bufpool THEN - ReleaseBufPool(s); - END; - OldBuffer(s.buf); - END; - OldStream(s); - - (* check if this stream has been tied to another stream *) - otherStream := opened; - WHILE otherStream # NIL DO - IF otherStream.tiedStream = s THEN - otherStream.tiedStream := NIL; (* undo tie operation *) - END; - otherStream := otherStream.next; - END; - (* s.lock remains TRUE to prevent further operations *) - Resources.Notify(s, Resources.terminated); - RETURN ~s.error - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Close; - - PROCEDURE Release*(s: Stream); - BEGIN - IF ~Close(s) THEN END; - END Release; - - PROCEDURE CloseAll*; - BEGIN - WHILE opened # NIL DO - (* that's no endless loop; see Close/OldStream *) - Release(opened); - END; - END CloseAll; - - PROCEDURE NotificationHandler(event: Events.Event); - VAR - s: Stream; - BEGIN - IF ~(event IS Resources.Event) THEN RETURN END; - WITH event: Resources.Event DO - IF ~(event.resource IS Stream) THEN RETURN END; - s := event.resource(Stream); - IF event.change IN {Resources.unreferenced, Resources.terminated} THEN - IF ~s.lock THEN - Release(s); - END; - END; - END; - END NotificationHandler; - - PROCEDURE Init*(s: Stream; if: Interface; caps: CapabilitySet; - bufmode: BufMode); - - VAR - eventType: Events.EventType; - type: Services.Type; - - PROCEDURE InitBidirectionalBuffering(s: Stream); - BEGIN - s.validpos := TRUE; - s.pos := 0; - NewBuffer(s.wbuf); - s.buf.ok := TRUE; s.buf.rbegin := 0; s.buf.rend := 0; s.buf.pos := 0; - s.wbuf.ok := TRUE; s.wbuf.wbegin := 0; s.wbuf.wend := 0; - s.wbuf.pos := 0; - s.left := 0; s.write := bufsize; - END InitBidirectionalBuffering; - - BEGIN - ASSERT((s # NIL) & (if # NIL) & ({read, write} * caps # {})); - Services.GetType(s, type); ASSERT(type # NIL); - s.inlist := (close IN caps) OR (bufmode # nobuf) & (write IN caps); - NewStream(s); - (* initialize public part *) - s.count := 0; - s.errors := 0; - s.error := FALSE; - s.lasterror := 0; - s.eof := FALSE; - (* private part *) - s.if := if; s.caps := caps; - s.bufmode := bufmode; - s.validpos := FALSE; - s.left := 0; s.write := 0; - s.tiedStream := NIL; - IF bufmode IN {linebuf, onebuf, bufpool} THEN - NewBuffer(s.buf); - IF (bufmode = bufpool) & ~(seek IN caps) THEN - bufmode := onebuf; - END; - CASE bufmode OF - | linebuf: s.termch := defaulttermch; - | bufpool: NEW(s.bufpool); InitBufPool(s); - ELSE - END; - s.maxpos := 0; - s.wextensible := {read, write, seek, tell, holes} * caps = - {read, write, seek, tell}; - s.bidirect := {read, write, seek, tell, trunc} * caps = {read, write}; - IF s.bidirect THEN - InitBidirectionalBuffering(s); - ELSE - s.wbuf := NIL; - END; - ELSE - s.buf := NIL; - s.wbuf := NIL; - s.wextensible := FALSE; - s.bidirect := FALSE; - END; - s.flushEvent := NIL; - s.closeEvent := NIL; - Resources.TakeInterest(s, eventType); - Events.Handler(eventType, NotificationHandler); - s.lock := FALSE; - END Init; - - PROCEDURE Send*(s: Stream; VAR message: Message); - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF handler IN s.caps THEN - s.if.handler(s, message); - ELSE - Error(s, NoHandlerDefined); - END; - s.lock := FALSE; - ELSE - Error(s, NestedCall); - END; - END Send; - - (* === private i/o procedures ================================= *) - - PROCEDURE ValidPos(s: Stream); - BEGIN - IF ~s.validpos THEN - IF tell IN s.caps THEN - IF ~s.if.tell(s, s.pos) OR (s.pos < 0) THEN - Error(s, TellFailed); - s.pos := 0; - END; - ELSE - s.pos := 0; - END; - s.rpos := s.pos; - s.validpos := TRUE; - s.left := 0; - s.write := 0; - END; - END ValidPos; - - PROCEDURE InitBuf(s: Stream); - BEGIN - IF s.bufmode = bufpool THEN - GetBuffer(s); - ELSE - s.buf.pos := s.pos - s.pos MOD bufsize; - s.buf.wbegin := s.pos MOD bufsize; - s.write := bufsize - s.buf.wbegin; - s.buf.wend := s.buf.wbegin; - s.buf.rbegin := s.buf.wbegin; - s.buf.rend := s.buf.wbegin; - s.left := 0; - s.buf.ok := TRUE; - END; - END InitBuf; - - PROCEDURE FillBuf(s: Stream) : BOOLEAN; - (* return FALSE on EOF or errors *) - VAR - offset, count: Count; - posindex: Count; (* s.pos MOD bufsize *) - - PROCEDURE Fill(s: Stream; VAR offset, count: Count) : BOOLEAN; - (* try to fill buf.cont[offset]..buf.cont[offset+count-1]; - return FALSE on EOF; - Fill always extends a read region: - s.buf.rend is set to offset + the number of bytes read - *) - VAR - linetermseen: BOOLEAN; - byte: Byte; - BEGIN - IF s.eofFound THEN - RETURN FALSE - END; - IF addrio IN s.caps THEN - s.buf.rend := s.if.addrread(s, SYSTEM.ADR(s.buf.cont[offset]), count) + - offset; - ELSIF bufio IN s.caps THEN - s.buf.rend := s.if.bufread(s, s.buf.cont, offset, count) + offset; - ELSIF s.bufmode = linebuf THEN - s.buf.rend := offset; linetermseen := FALSE; - WHILE ~linetermseen & (s.buf.rend < offset+count) & - s.if.read(s, byte) DO - s.buf.cont[s.buf.rend] := byte; INC(s.buf.rend); - linetermseen := byte = s.termch; - END; - s.eofFound := ~linetermseen & - (s.buf.rend < offset+count); (* s.if.read failed? *) - ELSE - s.buf.rend := offset; - WHILE (s.buf.rend < offset+count) & - s.if.read(s, s.buf.cont[s.buf.rend]) DO - INC(s.buf.rend); - END; - s.eofFound := s.buf.rend < offset+count; (* s.if.read failed? *) - END; - (* negative counts of addrread or bufread indicate read errors *) - IF s.buf.rend < offset THEN - (* note error and recover s.buf.rend *) - Error(s, ReadFailed); - s.buf.rend := offset; - END; - INC(s.rpos, s.buf.rend - offset); - IF s.buf.rend > offset THEN - DEC(count, s.buf.rend - offset); - offset := s.buf.rend; - RETURN TRUE - ELSE - s.eofFound := TRUE; - RETURN FALSE - END; - END Fill; - - BEGIN (* FillBuf *) - ValidPos(s); - posindex := s.pos MOD bufsize; - s.eofFound := FALSE; - - (* flush associated output streams (line buffered streams only) *) - IF s.bufmode = linebuf THEN - IF write IN s.caps THEN - IF ~InternalFlush(s) THEN END; - END; - IF (s.tiedStream # NIL) & ~SYS.TAS(s.tiedStream.lock) THEN - IF ~InternalFlush(s.tiedStream) THEN END; - s.tiedStream.lock := FALSE; - END; - END; - - (* get a valid buffer and set - offset and count to the buffer range which is to be filled; - on default, we want to fill the whole buffer - *) - offset := 0; count := bufsize; (* default *) - IF ~s.buf.ok THEN - InitBuf(s); - ELSIF s.bidirect THEN - s.buf.rbegin := 0; s.buf.rend := 0; s.pos := 0; posindex := 0; - ELSE - IF s.bufmode = bufpool THEN - GetBuffer(s); - IF s.left > 0 THEN - (* buffer is already filled *) - s.eof := FALSE; RETURN TRUE - END; - ELSIF s.buf.pos # s.pos - posindex THEN - (* reuse filled buffer *) - IF write IN s.caps THEN - IF ~InternalFlush(s) THEN END; - END; - InitBuf(s); - END; - IF s.buf.rbegin # s.buf.rend THEN - IF (write IN s.caps) & - (s.buf.wbegin <= posindex) & (s.buf.wend > posindex) THEN - (* set read region to write region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.wend - posindex; - s.eof := FALSE; RETURN TRUE - ELSIF s.buf.rend = posindex THEN - (* stream position equals end of read region *) - offset := s.buf.rend; count := bufsize - offset; - END; - END; - - (* take care of the write region by limiting count; - note that s.pos does *not* point into the write region; - this is guaranteed by WritePart and other operations - which would have extended the read region in such a case - *) - IF (write IN s.caps) & (s.buf.wbegin # s.buf.wend) THEN - IF s.buf.wbegin >= offset THEN - IF s.buf.wbegin > posindex THEN - (* write-region behind current position *) - count := s.buf.wbegin - offset; - ELSE - (* write-region before current position *) - offset := s.buf.wend; count := bufsize - offset; - END; - END; - IF (s.buf.pos + s.buf.wbegin = s.rpos) & ~(seek IN s.caps) THEN - (* flush if the start of write region corresponds to real - file position and we are not able to change the position - *) - IF ~InternalFlush(s) THEN END; - END; - END; - END; - - (* set the real position to the position we want to read from *) - IF ~s.bidirect & (s.buf.pos + offset # s.rpos) THEN - IF (seek IN s.caps) & s.if.seek(s, s.buf.pos+offset, fromStart) THEN - s.rpos := s.buf.pos + offset; - ELSIF s.pos = s.rpos THEN - DEC(count, posindex - offset); - offset := posindex; - ELSIF seek IN s.caps THEN - Error(s, SeekFailed); RETURN FALSE - ELSE - Error(s, CannotSeek); RETURN FALSE - END; - END; - - (* try to fill buf[offset..offset+count-1]; - and set s.buf.rbegin & s.buf.rend to the new read region - *) - IF s.buf.rend # offset THEN - (* forget old read region if we cannot extend it *) - s.buf.rbegin := offset; s.buf.rend := offset; - END; - WHILE Fill(s, offset, count) & (posindex >= s.buf.rend) DO END; - - IF posindex >= s.buf.rend THEN - (* read operation failed *) - IF (s.pos > s.rpos) & - (seek IN s.caps) & s.if.seek(s, s.pos, fromStart) THEN - s.rpos := s.pos; - (* second try: we were not able to fill the whole buffer - but perhaps we are able to read what we were requested for - *) - DEC(count, posindex - offset); - offset := posindex; - s.buf.rbegin := offset; s.buf.rend := offset; - s.eofFound := FALSE; (* retry it *) - s.eof := ~Fill(s, offset, count); - ELSE - s.eof := TRUE; - END; - ELSE - s.eof := FALSE; - END; - - IF s.eof THEN - s.left := 0; - ELSE - s.left := s.buf.rend - posindex; - END; - - RETURN ~s.eof - END FillBuf; - - - (* ==== i/o operations ============================================== *) - - PROCEDURE ReadPart*(s: Stream; VAR buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* fill buf[off..off+cnt-1] *) - - VAR - pos: Count; - partcnt: Count; - - PROCEDURE ReadBytesFromBuf(s: Stream; - VAR to: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - VAR - bytes, max, spos: Count; - BEGIN - IF s.left = 0 THEN - IF s.eofFound OR ~FillBuf(s) THEN RETURN FALSE END; - END; - spos := s.pos MOD bufsize; - max := s.left; - IF max > cnt THEN - max := cnt; - END; - bytes := 0; - WHILE bytes < max DO - to[off] := s.buf.cont[spos]; - INC(off); INC(spos); INC(bytes); - END; - INC(s.pos, bytes); DEC(s.left, bytes); INC(s.count, bytes); - IF ~s.bidirect THEN - IF s.write >= bytes THEN - DEC(s.write, bytes); - ELSE - s.write := 0; - END; - END; - RETURN TRUE - END ReadBytesFromBuf; - - BEGIN (* ReadPart *) - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - RETURN FALSE - END; - s.error := FALSE; s.count := 0; - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); RETURN FALSE - ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); RETURN FALSE - END; - IF cnt = 0 THEN s.lock := FALSE; RETURN TRUE END; - IF s.buf # NIL THEN - s.eofFound := FALSE; - WHILE (s.count < cnt) & - ReadBytesFromBuf(s, buf, s.count + off, cnt - s.count) DO - (* s.count is already incremented by ReadBytesFromBuf *) - END; - (* extend write region, if necessary *) - IF ~s.bidirect THEN - pos := s.pos MOD bufsize; - IF (s.write > 0) & (s.buf.wend < pos) THEN - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; - END; - s.buf.wend := pos; - END; - END; - ELSE - IF addrio IN s.caps THEN - s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), cnt); - IF (s.count > 0) & (s.count < cnt) THEN - LOOP - partcnt := s.if.addrread(s, - SYSTEM.ADR(buf[off + s.count]), cnt - s.count); - IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; - ASSERT(partcnt <= cnt - s.count); - INC(s.count, partcnt); - IF s.count = cnt THEN EXIT END; - END; - END; - ELSIF bufio IN s.caps THEN - s.count := s.if.bufread(s, buf, off, cnt); - IF (s.count > 0) & (s.count < cnt) THEN - LOOP - partcnt := s.if.bufread(s, buf, off + s.count, cnt - s.count); - IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; - ASSERT(partcnt <= cnt - s.count); - INC(s.count, partcnt); - IF s.count = cnt THEN EXIT END; - END; - END; - ELSE - s.count := 0; - WHILE (s.count < cnt) & s.if.read(s, buf[s.count+off]) DO - INC(s.count); - END; - END; - IF s.count < 0 THEN - s.count := 0; - Error(s, ReadFailed); - ELSE - s.eof := s.count = 0; - END; - END; - s.lock := FALSE; - RETURN s.count = cnt - END ReadPart; - - PROCEDURE Read*(s: Stream; VAR buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN ReadPart(s, buf, 0, LEN(buf)) - END Read; - - PROCEDURE ReadByte*(s: Stream; VAR byte: Byte) : BOOLEAN; - VAR - ok: BOOLEAN; - pos: Count; - BEGIN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN FALSE - END; - s.error := FALSE; - IF s.left = 0 THEN - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN FALSE - END; - IF s.buf # NIL THEN - IF ~FillBuf(s) THEN - (* FillBuf sets s.eof *) - s.lock := FALSE; - s.count := 0; - RETURN FALSE - END; - ELSE - ok := s.if.read(s, byte); - IF ok THEN - s.count := 1; - ELSE - s.count := 0; - END; - s.eof := ~ok; - s.lock := FALSE; - RETURN ok - END; - END; - (* s.left > 0 *) - s.count := 1; - byte := s.buf.cont[s.pos MOD bufsize]; - INC(s.pos); DEC(s.left); - IF ~s.bidirect & (s.write # 0) THEN - DEC(s.write); - pos := s.pos MOD bufsize; - IF s.buf.wend < pos THEN - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; - END; - s.buf.wend := pos; - END; - END; - (* s.eof has been set by FillBuf *) - s.lock := FALSE; - RETURN TRUE - END ReadByte; - - PROCEDURE ReadPacket*(s: Stream; VAR buf: ARRAY OF Byte; - off, maxcnt: Count) : Count; - (* fill buf[off..] with next packet *) - BEGIN - IF s.left > 0 THEN - IF maxcnt > s.left THEN - maxcnt := s.left; - END; - IF ReadPart(s, buf, off, maxcnt) THEN END; - RETURN s.count - END; - - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - s.count := 0; - RETURN 0 - END; - s.error := FALSE; s.count := 0; - IF ~(read IN s.caps) THEN - s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN 0 - ELSIF (off < 0) OR (off+maxcnt > LEN(buf)) OR (maxcnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); s.count := 0; RETURN 0 - END; - IF maxcnt = 0 THEN s.lock := FALSE; RETURN 0 END; - - IF s.buf # NIL THEN - (* s.left = 0 *) - IF ~FillBuf(s) THEN - (* FillBuf sets s.eof *) - s.lock := FALSE; - RETURN 0 - END; - s.lock := FALSE; - IF maxcnt > s.left THEN - maxcnt := s.left; - END; - IF ReadPart(s, buf, off, maxcnt) THEN END; - RETURN s.count - END; - - (* s.buf = NIL *) IF addrio IN s.caps THEN - s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), maxcnt); + s.buf.rend := s.if.addrread(s, SYSTEM.ADR(s.buf.cont[offset]), count) + + offset; ELSIF bufio IN s.caps THEN - s.count := s.if.bufread(s, buf, off, maxcnt); + s.buf.rend := s.if.bufread(s, s.buf.cont, offset, count) + offset; + ELSIF s.bufmode = linebuf THEN + s.buf.rend := offset; linetermseen := FALSE; + WHILE ~linetermseen & (s.buf.rend < offset+count) & + s.if.read(s, byte) DO + s.buf.cont[s.buf.rend] := byte; INC(s.buf.rend); + linetermseen := byte = s.termch; + END; + s.eofFound := ~linetermseen & + (s.buf.rend < offset+count); (* s.if.read failed? *) ELSE - s.count := 0; - WHILE (s.count < maxcnt) & s.if.read(s, buf[s.count+off]) DO - INC(s.count); - END; + s.buf.rend := offset; + WHILE (s.buf.rend < offset+count) & + s.if.read(s, s.buf.cont[s.buf.rend]) DO + INC(s.buf.rend); + END; + s.eofFound := s.buf.rend < offset+count; (* s.if.read failed? *) + END; + (* negative counts of addrread or bufread indicate read errors *) + IF s.buf.rend < offset THEN + (* note error and recover s.buf.rend *) + Error(s, ReadFailed); + s.buf.rend := offset; + END; + INC(s.rpos, s.buf.rend - offset); + IF s.buf.rend > offset THEN + DEC(count, s.buf.rend - offset); + offset := s.buf.rend; + RETURN TRUE + ELSE + s.eofFound := TRUE; + RETURN FALSE + END; + END Fill; + + BEGIN (* FillBuf *) + ValidPos(s); + posindex := s.pos MOD bufsize; + s.eofFound := FALSE; + + (* flush associated output streams (line buffered streams only) *) + IF s.bufmode = linebuf THEN + IF write IN s.caps THEN + IF ~InternalFlush(s) THEN END; + END; + IF (s.tiedStream # NIL) & ~SYS.TAS(s.tiedStream.lock) THEN + IF ~InternalFlush(s.tiedStream) THEN END; + s.tiedStream.lock := FALSE; + END; + END; + + (* get a valid buffer and set + offset and count to the buffer range which is to be filled; + on default, we want to fill the whole buffer + *) + offset := 0; count := bufsize; (* default *) + IF ~s.buf.ok THEN + InitBuf(s); + ELSIF s.bidirect THEN + s.buf.rbegin := 0; s.buf.rend := 0; s.pos := 0; posindex := 0; + ELSE + IF s.bufmode = bufpool THEN + GetBuffer(s); + IF s.left > 0 THEN + (* buffer is already filled *) + s.eof := FALSE; RETURN TRUE + END; + ELSIF s.buf.pos # s.pos - posindex THEN + (* reuse filled buffer *) + IF write IN s.caps THEN + IF ~InternalFlush(s) THEN END; + END; + InitBuf(s); + END; + IF s.buf.rbegin # s.buf.rend THEN + IF (write IN s.caps) & + (s.buf.wbegin <= posindex) & (s.buf.wend > posindex) THEN + (* set read region to write region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.wend - posindex; + s.eof := FALSE; RETURN TRUE + ELSIF s.buf.rend = posindex THEN + (* stream position equals end of read region *) + offset := s.buf.rend; count := bufsize - offset; + END; + END; + + (* take care of the write region by limiting count; + note that s.pos does *not* point into the write region; + this is guaranteed by WritePart and other operations + which would have extended the read region in such a case + *) + IF (write IN s.caps) & (s.buf.wbegin # s.buf.wend) THEN + IF s.buf.wbegin >= offset THEN + IF s.buf.wbegin > posindex THEN + (* write-region behind current position *) + count := s.buf.wbegin - offset; + ELSE + (* write-region before current position *) + offset := s.buf.wend; count := bufsize - offset; + END; + END; + IF (s.buf.pos + s.buf.wbegin = s.rpos) & ~(seek IN s.caps) THEN + (* flush if the start of write region corresponds to real + file position and we are not able to change the position + *) + IF ~InternalFlush(s) THEN END; + END; + END; + END; + + (* set the real position to the position we want to read from *) + IF ~s.bidirect & (s.buf.pos + offset # s.rpos) THEN + IF (seek IN s.caps) & s.if.seek(s, s.buf.pos+offset, fromStart) THEN + s.rpos := s.buf.pos + offset; + ELSIF s.pos = s.rpos THEN + DEC(count, posindex - offset); + offset := posindex; + ELSIF seek IN s.caps THEN + Error(s, SeekFailed); RETURN FALSE + ELSE + Error(s, CannotSeek); RETURN FALSE + END; + END; + + (* try to fill buf[offset..offset+count-1]; + and set s.buf.rbegin & s.buf.rend to the new read region + *) + IF s.buf.rend # offset THEN + (* forget old read region if we cannot extend it *) + s.buf.rbegin := offset; s.buf.rend := offset; + END; + WHILE Fill(s, offset, count) & (posindex >= s.buf.rend) DO END; + + IF posindex >= s.buf.rend THEN + (* read operation failed *) + IF (s.pos > s.rpos) & + (seek IN s.caps) & s.if.seek(s, s.pos, fromStart) THEN + s.rpos := s.pos; + (* second try: we were not able to fill the whole buffer + but perhaps we are able to read what we were requested for + *) + DEC(count, posindex - offset); + offset := posindex; + s.buf.rbegin := offset; s.buf.rend := offset; + s.eofFound := FALSE; (* retry it *) + s.eof := ~Fill(s, offset, count); + ELSE + s.eof := TRUE; + END; + ELSE + s.eof := FALSE; + END; + + IF s.eof THEN + s.left := 0; + ELSE + s.left := s.buf.rend - posindex; + END; + + RETURN ~s.eof + END FillBuf; + + + (* ==== i/o operations ============================================== *) + + PROCEDURE ReadPart*(s: Stream; VAR buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* fill buf[off..off+cnt-1] *) + + VAR + pos: Count; + partcnt: Count; + + PROCEDURE ReadBytesFromBuf(s: Stream; + VAR to: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + VAR + bytes, max, spos: Count; + BEGIN + IF s.left = 0 THEN + IF s.eofFound OR ~FillBuf(s) THEN RETURN FALSE END; + END; + spos := s.pos MOD bufsize; + max := s.left; + IF max > cnt THEN + max := cnt; + END; + bytes := 0; + WHILE bytes < max DO + to[off] := s.buf.cont[spos]; + INC(off); INC(spos); INC(bytes); + END; + INC(s.pos, bytes); DEC(s.left, bytes); INC(s.count, bytes); + IF ~s.bidirect THEN + IF s.write >= bytes THEN + DEC(s.write, bytes); + ELSE + s.write := 0; + END; + END; + RETURN TRUE + END ReadBytesFromBuf; + + BEGIN (* ReadPart *) + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + RETURN FALSE + END; + s.error := FALSE; s.count := 0; + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); RETURN FALSE + ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); RETURN FALSE + END; + IF cnt = 0 THEN s.lock := FALSE; RETURN TRUE END; + IF s.buf # NIL THEN + s.eofFound := FALSE; + WHILE (s.count < cnt) & + ReadBytesFromBuf(s, buf, s.count + off, cnt - s.count) DO + (* s.count is already incremented by ReadBytesFromBuf *) + END; + (* extend write region, if necessary *) + IF ~s.bidirect THEN + pos := s.pos MOD bufsize; + IF (s.write > 0) & (s.buf.wend < pos) THEN + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; + END; + s.buf.wend := pos; + END; + END; + ELSE + IF addrio IN s.caps THEN + s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), cnt); + IF (s.count > 0) & (s.count < cnt) THEN + LOOP + partcnt := s.if.addrread(s, + SYSTEM.ADR(buf[off + s.count]), cnt - s.count); + IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; + ASSERT(partcnt <= cnt - s.count); + INC(s.count, partcnt); + IF s.count = cnt THEN EXIT END; + END; + END; + ELSIF bufio IN s.caps THEN + s.count := s.if.bufread(s, buf, off, cnt); + IF (s.count > 0) & (s.count < cnt) THEN + LOOP + partcnt := s.if.bufread(s, buf, off + s.count, cnt - s.count); + IF (partcnt < 0) OR (partcnt = 0) THEN EXIT END; + ASSERT(partcnt <= cnt - s.count); + INC(s.count, partcnt); + IF s.count = cnt THEN EXIT END; + END; + END; + ELSE + s.count := 0; + WHILE (s.count < cnt) & s.if.read(s, buf[s.count+off]) DO + INC(s.count); + END; END; IF s.count < 0 THEN - s.count := 0; - Error(s, ReadFailed); + s.count := 0; + Error(s, ReadFailed); ELSE - s.eof := s.count = 0; + s.eof := s.count = 0; END; - s.lock := FALSE; - RETURN s.count - END ReadPacket; + END; + s.lock := FALSE; + RETURN s.count = cnt + END ReadPart; - PROCEDURE WritePart*(s: Stream; - (* read-only *) VAR buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* write buf[off..off+cnt-1] to s *) - VAR - posindex: Count; + PROCEDURE Read*(s: Stream; VAR buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN ReadPart(s, buf, 0, LEN(buf)) + END Read; - PROCEDURE NewBuffer(s: Stream) : BOOLEAN; - (* flush and get new buffer *) - BEGIN - IF s.pos - posindex # s.buf.pos THEN - IF s.bufmode # bufpool THEN - IF ~InternalFlush(s) THEN RETURN FALSE END; - END; - InitBuf(s); - IF s.write # 0 THEN RETURN TRUE END; - END; - IF s.buf.wbegin = s.buf.wend THEN - (* nothing written into this buffer until now *) - s.buf.wbegin := posindex; s.buf.wend := posindex; - s.write := bufsize - posindex; - ELSIF s.wextensible & (s.buf.rbegin # s.buf.rend) THEN - (* check if the write region may be extended - over parts of the read region - *) - IF s.buf.wend < posindex THEN - (* write region before current position *) - IF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend >= posindex) THEN - s.buf.wend := posindex; - s.write := bufsize - posindex; - END; - ELSE (* s.wbegin > posindex *) - (* write region after current position *) - IF (s.buf.rbegin <= posindex) & (s.buf.rend >= s.buf.wbegin) THEN - s.buf.wbegin := posindex; - s.write := bufsize - posindex; - END; - END; - END; - IF (* still *) s.write = 0 THEN - (* Flush necessary *) - IF ~InternalFlush(s) THEN RETURN FALSE END; - s.buf.wbegin := posindex; s.buf.wend := posindex; - s.write := bufsize - posindex; - END; - RETURN TRUE - END NewBuffer; - - PROCEDURE UpdateReadRegion(s: Stream); - BEGIN - (* update s.left and extend read region, if possible *) - IF s.buf.rbegin = s.buf.rend THEN - (* set read region to write region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.rend - posindex; - ELSIF (s.buf.rbegin < s.buf.wbegin) & (s.buf.rend >= s.buf.wbegin) THEN - (* forward extension of read region possible *) - IF s.buf.rend < s.buf.wend THEN - s.buf.rend := s.buf.wend; - END; - s.left := s.buf.rend - posindex; - ELSIF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend > s.buf.wend) THEN - (* backward extension of read region possible *) - IF s.buf.rbegin > s.buf.wbegin THEN - s.buf.rbegin := s.buf.wend; - END; - s.left := s.buf.rend - posindex; - ELSE - (* posindex does not fall into [s.buf.rbegin..s.buf.rend-1] *) - s.left := 0; - END; - IF s.pos = s.buf.pos + bufsize THEN - s.left := 0; - END; - END UpdateReadRegion; - - BEGIN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); RETURN FALSE + PROCEDURE ReadByte*(s: Stream; VAR byte: Byte) : BOOLEAN; + VAR + ok: BOOLEAN; + pos: Count; + BEGIN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN FALSE + END; + s.error := FALSE; + IF s.left = 0 THEN + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN FALSE END; - s.error := FALSE; s.count := 0; - IF ~(write IN s.caps) THEN - s.lock := FALSE; Error(s, CannotWrite); RETURN FALSE - ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN - s.lock := FALSE; Error(s, BadParameters); RETURN FALSE - ELSIF cnt = 0 THEN - s.lock := FALSE; RETURN TRUE - END; - IF s.buf # NIL THEN - IF s.bidirect THEN - WHILE s.count < cnt DO - IF (s.write = 0) & ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - s.wbuf.cont[s.wbuf.wend] := buf[off + s.count]; - INC(s.wbuf.wend); INC(s.count); DEC(s.write); - IF (s.bufmode = linebuf) & - (buf[s.count+off-1] = s.termch) THEN - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - END; - END; - ELSE - ValidPos(s); - posindex := s.pos MOD bufsize; - IF ~s.buf.ok THEN - InitBuf(s); - END; + IF ~FillBuf(s) THEN + (* FillBuf sets s.eof *) + s.lock := FALSE; + s.count := 0; + RETURN FALSE + END; + ELSE + ok := s.if.read(s, byte); + IF ok THEN + s.count := 1; + ELSE + s.count := 0; + END; + s.eof := ~ok; + s.lock := FALSE; + RETURN ok + END; + END; + (* s.left > 0 *) + s.count := 1; + byte := s.buf.cont[s.pos MOD bufsize]; + INC(s.pos); DEC(s.left); + IF ~s.bidirect & (s.write # 0) THEN + DEC(s.write); + pos := s.pos MOD bufsize; + IF s.buf.wend < pos THEN + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; + END; + s.buf.wend := pos; + END; + END; + (* s.eof has been set by FillBuf *) + s.lock := FALSE; + RETURN TRUE + END ReadByte; - (* copy from buf to s.buf *) - WHILE s.count < cnt DO - IF s.write = 0 THEN - posindex := s.pos MOD bufsize; - IF s.count > 0 THEN - UpdateReadRegion(s); - END; - IF ~NewBuffer(s) THEN - s.lock := FALSE; RETURN FALSE - END; - END; - s.buf.cont[posindex] := buf[off + s.count]; - IF s.buf.wend = posindex THEN - INC(s.buf.wend); - END; - INC(s.count); INC(s.pos); DEC(s.write); INC(posindex); - IF (s.bufmode = linebuf) & - (buf[s.count+off-1] = s.termch) THEN - UpdateReadRegion(s); - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - (* s.pos can be changed by InternalFlush *) - posindex := s.pos MOD bufsize; - END; - END; - UpdateReadRegion(s); - END; - ELSE (* unbuffered stream *) - IF addrio IN s.caps THEN - s.count := s.if.addrwrite(s, SYSTEM.ADR(buf[off]), cnt); - ELSIF bufio IN s.caps THEN - s.count := s.if.bufwrite(s, buf, off, cnt); - ELSE - s.count := 0; - WHILE (s.count < cnt) & s.if.write(s, buf[off+s.count]) DO - INC(s.count); - END; - END; - IF s.count # cnt THEN - Error(s, WriteFailed); - END; + PROCEDURE ReadPacket*(s: Stream; VAR buf: ARRAY OF Byte; + off, maxcnt: Count) : Count; + (* fill buf[off..] with next packet *) + BEGIN + IF s.left > 0 THEN + IF maxcnt > s.left THEN + maxcnt := s.left; + END; + IF ReadPart(s, buf, off, maxcnt) THEN END; + RETURN s.count + END; + + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + s.count := 0; + RETURN 0 + END; + s.error := FALSE; s.count := 0; + IF ~(read IN s.caps) THEN + s.lock := FALSE; Error(s, CannotRead); s.count := 0; RETURN 0 + ELSIF (off < 0) OR (off+maxcnt > LEN(buf)) OR (maxcnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); s.count := 0; RETURN 0 + END; + IF maxcnt = 0 THEN s.lock := FALSE; RETURN 0 END; + + IF s.buf # NIL THEN + (* s.left = 0 *) + IF ~FillBuf(s) THEN + (* FillBuf sets s.eof *) + s.lock := FALSE; + RETURN 0 END; s.lock := FALSE; - RETURN s.count = cnt - END WritePart; - - PROCEDURE Write*(s: Stream; - (* read-only *) VAR buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN WritePart(s, buf, 0, LEN(buf)) - END Write; - - PROCEDURE WritePartC*(s: Stream; buf: ARRAY OF Byte; - off, cnt: Count) : BOOLEAN; - (* write buf[off..off+cnt-1] to s *) - BEGIN - RETURN WritePart(s, buf, off, cnt) - END WritePartC; - - PROCEDURE WriteC*(s: Stream; buf: ARRAY OF Byte) : BOOLEAN; - BEGIN - RETURN WritePart(s, buf, 0, LEN(buf)) - END WriteC; - - PROCEDURE WriteByte*(s: Stream; byte: Byte) : BOOLEAN; - VAR - posindex: Count; - BEGIN - IF (s.write > 0) & ~SYS.TAS(s.lock) THEN - s.error := FALSE; s.count := 1; - - IF s.bidirect THEN - s.wbuf.cont[s.wbuf.wend] := byte; INC(s.wbuf.wend); DEC(s.write); - ELSE - (* put byte into s.buf *) - posindex := s.pos MOD bufsize; - s.buf.cont[posindex] := byte; - IF s.buf.wend = posindex THEN - INC(s.buf.wend); - END; - DEC(s.write); - - (* update s.buf.rend and s.left, if necessary *) - IF s.buf.rend = posindex THEN - INC(s.buf.rend); - END; - IF s.left # 0 THEN - DEC(s.left); - ELSIF s.buf.rbegin = s.buf.rend THEN - (* set read-region to write-region *) - s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; - s.left := s.buf.wend - posindex; - END; - - INC(s.pos); - END; - - IF (s.bufmode = linebuf) & (byte = s.termch) THEN - IF ~InternalFlush(s) THEN - s.lock := FALSE; RETURN FALSE - END; - IF ~s.bidirect THEN - s.buf.wbegin := s.pos MOD bufsize; - END; - END; - - s.lock := FALSE; RETURN TRUE - ELSE - RETURN WritePart(s, byte, 0, 1) + IF maxcnt > s.left THEN + maxcnt := s.left; END; - END WriteByte; + IF ReadPart(s, buf, off, maxcnt) THEN END; + RETURN s.count + END; - PROCEDURE InternalSeek(s: Stream; offset: Count; whence: Whence) : BOOLEAN; - VAR - oldpos: Count; pos: Count; - BEGIN - s.error := FALSE; + (* s.buf = NIL *) + IF addrio IN s.caps THEN + s.count := s.if.addrread(s, SYSTEM.ADR(buf[off]), maxcnt); + ELSIF bufio IN s.caps THEN + s.count := s.if.bufread(s, buf, off, maxcnt); + ELSE + s.count := 0; + WHILE (s.count < maxcnt) & s.if.read(s, buf[s.count+off]) DO + INC(s.count); + END; + END; + IF s.count < 0 THEN + s.count := 0; + Error(s, ReadFailed); + ELSE + s.eof := s.count = 0; + END; + s.lock := FALSE; + RETURN s.count + END ReadPacket; + + PROCEDURE WritePart*(s: Stream; + (* read-only *) VAR buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* write buf[off..off+cnt-1] to s *) + VAR + posindex: Count; + + PROCEDURE NewBuffer(s: Stream) : BOOLEAN; + (* flush and get new buffer *) + BEGIN + IF s.pos - posindex # s.buf.pos THEN + IF s.bufmode # bufpool THEN + IF ~InternalFlush(s) THEN RETURN FALSE END; + END; + InitBuf(s); + IF s.write # 0 THEN RETURN TRUE END; + END; + IF s.buf.wbegin = s.buf.wend THEN + (* nothing written into this buffer until now *) + s.buf.wbegin := posindex; s.buf.wend := posindex; + s.write := bufsize - posindex; + ELSIF s.wextensible & (s.buf.rbegin # s.buf.rend) THEN + (* check if the write region may be extended + over parts of the read region + *) + IF s.buf.wend < posindex THEN + (* write region before current position *) + IF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend >= posindex) THEN + s.buf.wend := posindex; + s.write := bufsize - posindex; + END; + ELSE (* s.wbegin > posindex *) + (* write region after current position *) + IF (s.buf.rbegin <= posindex) & (s.buf.rend >= s.buf.wbegin) THEN + s.buf.wbegin := posindex; + s.write := bufsize - posindex; + END; + END; + END; + IF (* still *) s.write = 0 THEN + (* Flush necessary *) + IF ~InternalFlush(s) THEN RETURN FALSE END; + s.buf.wbegin := posindex; s.buf.wend := posindex; + s.write := bufsize - posindex; + END; + RETURN TRUE + END NewBuffer; + + PROCEDURE UpdateReadRegion(s: Stream); + BEGIN + (* update s.left and extend read region, if possible *) + IF s.buf.rbegin = s.buf.rend THEN + (* set read region to write region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.rend - posindex; + ELSIF (s.buf.rbegin < s.buf.wbegin) & (s.buf.rend >= s.buf.wbegin) THEN + (* forward extension of read region possible *) + IF s.buf.rend < s.buf.wend THEN + s.buf.rend := s.buf.wend; + END; + s.left := s.buf.rend - posindex; + ELSIF (s.buf.rbegin <= s.buf.wend) & (s.buf.rend > s.buf.wend) THEN + (* backward extension of read region possible *) + IF s.buf.rbegin > s.buf.wbegin THEN + s.buf.rbegin := s.buf.wend; + END; + s.left := s.buf.rend - posindex; + ELSE + (* posindex does not fall into [s.buf.rbegin..s.buf.rend-1] *) + s.left := 0; + END; + IF s.pos = s.buf.pos + bufsize THEN + s.left := 0; + END; + END UpdateReadRegion; + + BEGIN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); RETURN FALSE + END; + s.error := FALSE; s.count := 0; + IF ~(write IN s.caps) THEN + s.lock := FALSE; Error(s, CannotWrite); RETURN FALSE + ELSIF (off < 0) OR (off+cnt > LEN(buf)) OR (cnt < 0) THEN + s.lock := FALSE; Error(s, BadParameters); RETURN FALSE + ELSIF cnt = 0 THEN + s.lock := FALSE; RETURN TRUE + END; + + IF s.buf # NIL THEN IF s.bidirect THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF s.buf = NIL THEN - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; + WHILE s.count < cnt DO + IF (s.write = 0) & ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + s.wbuf.cont[s.wbuf.wend] := buf[off + s.count]; + INC(s.wbuf.wend); INC(s.count); DEC(s.write); + IF (s.bufmode = linebuf) & + (buf[s.count+off-1] = s.termch) THEN + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + END; + END; ELSE - IF ~s.validpos & (seek IN s.caps) THEN - IF (write IN s.caps) & ~InternalFlush(s) THEN END; - IF ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; - IF whence = fromStart THEN - s.validpos := TRUE; - s.pos := offset; s.rpos := offset; - END; - ELSE - ValidPos(s); oldpos := s.pos; - IF s.pos > s.maxpos THEN - s.maxpos := s.pos; - END; - CASE whence OF - | fromStart: IF offset < 0 THEN - Error(s, SeekFailed); RETURN FALSE - END; - s.pos := offset; - | fromPos: IF s.pos + offset < 0 THEN - Error(s, SeekFailed); RETURN FALSE - END; - INC(s.pos, offset); - | fromEnd: IF (write IN s.caps) & ~InternalFlush(s) THEN END; - IF ~(seek IN s.caps) OR - ~s.if.seek(s, offset, whence) THEN - Error(s, SeekFailed); RETURN FALSE - END; - s.validpos := FALSE; ValidPos(s); - ELSE - Error(s, BadWhence); RETURN FALSE - END; - IF ~(holes IN s.caps) & (s.pos > s.maxpos) THEN - (* if holes are not permitted - we need to check the new position - *) - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); RETURN FALSE - ELSIF s.if.seek(s, s.pos, fromStart) THEN - s.rpos := s.pos; s.maxpos := s.pos; - ELSE - Error(s, SeekFailed); RETURN FALSE - END; - END; - IF s.buf.ok & (s.pos # oldpos) THEN - (* set s.left and s.write *) - IF (s.pos < s.buf.pos) OR (s.pos >= s.buf.pos + bufsize) THEN - s.left := 0; s.write := 0; - ELSE - pos := s.pos MOD bufsize; - IF s.buf.rbegin = s.buf.rend THEN - s.buf.rbegin := pos; s.buf.rend := pos; - END; - IF s.buf.wbegin = s.buf.wend THEN - s.buf.wbegin := pos; s.buf.wend := pos; - END; - IF s.pos > oldpos THEN - IF (pos >= s.buf.rbegin) & (pos < s.buf.rend) THEN - s.left := s.buf.rend - pos; - ELSE - s.left := 0; - END; - IF (pos >= s.buf.wbegin) & (pos <= s.buf.wend) THEN - s.write := bufsize - pos; - ELSE - s.write := 0; - END; - IF s.wextensible & - (s.write < s.left) & (s.buf.wbegin # s.buf.wend) THEN - (* s.write = 0 (else s.write >= s.left); - try to extend write-region to avoid - an unnecessary flush operation - *) - IF (s.buf.wbegin < pos) & - (s.buf.wend >= s.buf.rbegin) THEN - (* write-region is followed by read-region *) - s.buf.wend := pos; s.write := bufsize - pos; - ELSIF (pos < s.buf.wbegin) & - (s.buf.wbegin >= s.buf.rend) THEN - (* read-region is followed by write-region *) - s.buf.wbegin := pos; s.write := bufsize - pos; - END; - END; - ELSE (* s.pos < oldpos *) - IF (pos < s.buf.rbegin) OR (pos > s.buf.rend) THEN - s.left := 0; - ELSE - s.left := s.buf.rend - pos; - END; - IF (pos < s.buf.wbegin) OR (pos > s.buf.wend) THEN - s.write := 0; - ELSE - s.write := bufsize - pos; - END; - END; - END; - END; - END; - END; - IF s.left > 0 THEN - s.eof := FALSE; - END; - RETURN TRUE - END InternalSeek; + ValidPos(s); + posindex := s.pos MOD bufsize; + IF ~s.buf.ok THEN + InitBuf(s); + END; - PROCEDURE Seek*(s: Stream; offset: Count; whence: Whence) : BOOLEAN; - VAR - rval: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - rval := InternalSeek(s, offset, whence); - s.lock := FALSE; - RETURN rval + (* copy from buf to s.buf *) + WHILE s.count < cnt DO + IF s.write = 0 THEN + posindex := s.pos MOD bufsize; + IF s.count > 0 THEN + UpdateReadRegion(s); + END; + IF ~NewBuffer(s) THEN + s.lock := FALSE; RETURN FALSE + END; + END; + s.buf.cont[posindex] := buf[off + s.count]; + IF s.buf.wend = posindex THEN + INC(s.buf.wend); + END; + INC(s.count); INC(s.pos); DEC(s.write); INC(posindex); + IF (s.bufmode = linebuf) & + (buf[s.count+off-1] = s.termch) THEN + UpdateReadRegion(s); + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + (* s.pos can be changed by InternalFlush *) + posindex := s.pos MOD bufsize; + END; + END; + UpdateReadRegion(s); + END; + ELSE (* unbuffered stream *) + IF addrio IN s.caps THEN + s.count := s.if.addrwrite(s, SYSTEM.ADR(buf[off]), cnt); + ELSIF bufio IN s.caps THEN + s.count := s.if.bufwrite(s, buf, off, cnt); ELSE - Error(s, NestedCall); - RETURN FALSE + s.count := 0; + WHILE (s.count < cnt) & s.if.write(s, buf[off+s.count]) DO + INC(s.count); + END; END; - END Seek; + IF s.count # cnt THEN + Error(s, WriteFailed); + END; + END; + s.lock := FALSE; + RETURN s.count = cnt + END WritePart; - PROCEDURE Tell*(s: Stream; VAR offset: Count) : BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF tell IN s.caps THEN - IF s.buf # NIL THEN - IF s.validpos THEN - offset := s.pos; - ELSIF s.if.tell(s, s.rpos) THEN - s.validpos := TRUE; - s.pos := s.rpos; - offset := s.pos; - ELSE - s.lock := FALSE; - Error(s, TellFailed); - END; - ELSIF ~s.if.tell(s, offset) THEN - s.lock := FALSE; - Error(s, TellFailed); - END; - ELSE - s.lock := FALSE; - Error(s, CannotTell); - END; - s.lock := FALSE; + PROCEDURE Write*(s: Stream; + (* read-only *) VAR buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN WritePart(s, buf, 0, LEN(buf)) + END Write; + + PROCEDURE WritePartC*(s: Stream; buf: ARRAY OF Byte; + off, cnt: Count) : BOOLEAN; + (* write buf[off..off+cnt-1] to s *) + BEGIN + RETURN WritePart(s, buf, off, cnt) + END WritePartC; + + PROCEDURE WriteC*(s: Stream; buf: ARRAY OF Byte) : BOOLEAN; + BEGIN + RETURN WritePart(s, buf, 0, LEN(buf)) + END WriteC; + + PROCEDURE WriteByte*(s: Stream; byte: Byte) : BOOLEAN; + VAR + posindex: Count; + BEGIN + IF (s.write > 0) & ~SYS.TAS(s.lock) THEN + s.error := FALSE; s.count := 1; + + IF s.bidirect THEN + s.wbuf.cont[s.wbuf.wend] := byte; INC(s.wbuf.wend); DEC(s.write); ELSE - Error(s, NestedCall); + (* put byte into s.buf *) + posindex := s.pos MOD bufsize; + s.buf.cont[posindex] := byte; + IF s.buf.wend = posindex THEN + INC(s.buf.wend); + END; + DEC(s.write); + + (* update s.buf.rend and s.left, if necessary *) + IF s.buf.rend = posindex THEN + INC(s.buf.rend); + END; + IF s.left # 0 THEN + DEC(s.left); + ELSIF s.buf.rbegin = s.buf.rend THEN + (* set read-region to write-region *) + s.buf.rbegin := s.buf.wbegin; s.buf.rend := s.buf.wend; + s.left := s.buf.wend - posindex; + END; + + INC(s.pos); END; - RETURN ~s.error - END Tell; - PROCEDURE GetPos*(s: Stream; VAR offset: Count); - (* IF ~Tell(s, offset) THEN offset := internal position END; *) - BEGIN - IF ~Tell(s, offset) THEN - IF SYS.TAS(s.lock) THEN - Error(s, NestedCall); - ELSE - ValidPos(s); - offset := s.pos; - s.lock := FALSE; - END; + IF (s.bufmode = linebuf) & (byte = s.termch) THEN + IF ~InternalFlush(s) THEN + s.lock := FALSE; RETURN FALSE + END; + IF ~s.bidirect THEN + s.buf.wbegin := s.pos MOD bufsize; + END; END; - END GetPos; - PROCEDURE SetPos*(s: Stream; offset: Count); - (* IF ~Seek(s, offset, fromStart) THEN END; *) - BEGIN - IF ~Seek(s, offset, fromStart) THEN END; - END SetPos; + s.lock := FALSE; RETURN TRUE + ELSE + RETURN WritePart(s, byte, 0, 1) + END; + END WriteByte; - PROCEDURE ^ Touch*(s: Stream); - - PROCEDURE Trunc*(s: Stream; length: Count) : BOOLEAN; - (* truncate `s' to a total length of `length'; - following holds if holes are permitted: - (1) the current position remains unchanged - (2) the contents between `length' and - the current position is undefined - this call fails if holes are not permitted and the - current position is beyond `length' - *) - VAR - ok: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF (trunc IN s.caps) & (length >= 0) THEN - s.error := FALSE; ok := TRUE; - IF s.buf # NIL THEN - ValidPos(s); - IF ~(holes IN s.caps) & (s.pos > length) THEN - ok := FALSE; - ELSIF (s.bufmode = bufpool) OR s.buf.ok & - (s.buf.pos DIV bufsize >= length DIV bufsize) THEN - Touch(s); - END; - END; - IF ~ok OR ~s.if.trunc(s, length) THEN - s.lock := FALSE; Error(s, TruncFailed); - END; - ELSE - s.lock := FALSE; Error(s, CannotTrunc); - END; - s.lock := FALSE; + PROCEDURE InternalSeek(s: Stream; offset: Count; whence: Whence) : BOOLEAN; + VAR + oldpos: Count; pos: Count; + BEGIN + s.error := FALSE; + IF s.bidirect THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF s.buf = NIL THEN + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + ELSE + IF ~s.validpos & (seek IN s.caps) THEN + IF (write IN s.caps) & ~InternalFlush(s) THEN END; + IF ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + IF whence = fromStart THEN + s.validpos := TRUE; + s.pos := offset; s.rpos := offset; + END; ELSE - Error(s, NestedCall); + ValidPos(s); oldpos := s.pos; + IF s.pos > s.maxpos THEN + s.maxpos := s.pos; + END; + CASE whence OF + | fromStart: IF offset < 0 THEN + Error(s, SeekFailed); RETURN FALSE + END; + s.pos := offset; + | fromPos: IF s.pos + offset < 0 THEN + Error(s, SeekFailed); RETURN FALSE + END; + INC(s.pos, offset); + | fromEnd: IF (write IN s.caps) & ~InternalFlush(s) THEN END; + IF ~(seek IN s.caps) OR + ~s.if.seek(s, offset, whence) THEN + Error(s, SeekFailed); RETURN FALSE + END; + s.validpos := FALSE; ValidPos(s); + ELSE + Error(s, BadWhence); RETURN FALSE + END; + IF ~(holes IN s.caps) & (s.pos > s.maxpos) THEN + (* if holes are not permitted + we need to check the new position + *) + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); RETURN FALSE + ELSIF s.if.seek(s, s.pos, fromStart) THEN + s.rpos := s.pos; s.maxpos := s.pos; + ELSE + Error(s, SeekFailed); RETURN FALSE + END; + END; + IF s.buf.ok & (s.pos # oldpos) THEN + (* set s.left and s.write *) + IF (s.pos < s.buf.pos) OR (s.pos >= s.buf.pos + bufsize) THEN + s.left := 0; s.write := 0; + ELSE + pos := s.pos MOD bufsize; + IF s.buf.rbegin = s.buf.rend THEN + s.buf.rbegin := pos; s.buf.rend := pos; + END; + IF s.buf.wbegin = s.buf.wend THEN + s.buf.wbegin := pos; s.buf.wend := pos; + END; + IF s.pos > oldpos THEN + IF (pos >= s.buf.rbegin) & (pos < s.buf.rend) THEN + s.left := s.buf.rend - pos; + ELSE + s.left := 0; + END; + IF (pos >= s.buf.wbegin) & (pos <= s.buf.wend) THEN + s.write := bufsize - pos; + ELSE + s.write := 0; + END; + IF s.wextensible & + (s.write < s.left) & (s.buf.wbegin # s.buf.wend) THEN + (* s.write = 0 (else s.write >= s.left); + try to extend write-region to avoid + an unnecessary flush operation + *) + IF (s.buf.wbegin < pos) & + (s.buf.wend >= s.buf.rbegin) THEN + (* write-region is followed by read-region *) + s.buf.wend := pos; s.write := bufsize - pos; + ELSIF (pos < s.buf.wbegin) & + (s.buf.wbegin >= s.buf.rend) THEN + (* read-region is followed by write-region *) + s.buf.wbegin := pos; s.write := bufsize - pos; + END; + END; + ELSE (* s.pos < oldpos *) + IF (pos < s.buf.rbegin) OR (pos > s.buf.rend) THEN + s.left := 0; + ELSE + s.left := s.buf.rend - pos; + END; + IF (pos < s.buf.wbegin) OR (pos > s.buf.wend) THEN + s.write := 0; + ELSE + s.write := bufsize - pos; + END; + END; + END; + END; END; - RETURN ~s.error - END Trunc; + END; + IF s.left > 0 THEN + s.eof := FALSE; + END; + RETURN TRUE + END InternalSeek; - PROCEDURE Back*(s: Stream) : BOOLEAN; - (* undo last read operation (one byte); - because of the delayed buffer filling - Back is always successful for buffered streams - immediately after read-operations - *) - VAR - rval: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF read IN s.caps THEN - IF seek IN s.caps THEN - (* fails if s.pos = 0 *) - rval := InternalSeek(s, -1, 1) - ELSIF s.bidirect & s.buf.ok THEN - IF s.pos > 0 THEN - DEC(s.pos); INC(s.left); - rval := TRUE; - ELSE - rval := FALSE; - END; - ELSIF (s.buf # NIL) & s.buf.ok THEN - rval := InternalSeek(s, -1, 1) & (s.left > 0) - ELSE - rval := FALSE - END; - ELSE - s.lock := FALSE; Error(s, CannotRead); - rval := FALSE - END; - s.lock := FALSE; - RETURN rval - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Back; - - PROCEDURE Insert*(s: Stream; byte: Byte) : BOOLEAN; - (* return `byte' on next read-operation *) - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF read IN s.caps THEN - IF s.buf # NIL THEN - (* seek in buffer possible? *) - IF s.bidirect THEN - IF s.pos > 0 THEN - DEC(s.pos); s.buf.cont[s.pos] := byte; - RETURN TRUE - ELSE - RETURN FALSE - END; - ELSIF s.buf.ok & - (s.pos > s.buf.pos+s.buf.rbegin) & - (s.pos < s.buf.pos+s.buf.rend) & - InternalSeek(s, -1, 1) THEN - s.buf.cont[s.pos MOD bufsize] := byte; - s.lock := FALSE; - RETURN TRUE - ELSE - s.lock := FALSE; - RETURN FALSE - END; - ELSE - s.lock := FALSE; Error(s, Unbuffered); RETURN FALSE - END; - ELSE - s.lock := FALSE; Error(s, CannotRead); RETURN FALSE - END; - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Insert; - - PROCEDURE InternalFlush(s: Stream) : BOOLEAN; - - PROCEDURE Write(s: Stream; buf: Buffer) : BOOLEAN; - - VAR - count: Count; - BEGIN - IF addrio IN s.caps THEN - count := s.if.addrwrite(s, SYSTEM.ADR(buf.cont[buf.wbegin]), - buf.wend-buf.wbegin); - ELSIF bufio IN s.caps THEN - count := s.if.bufwrite(s, buf.cont, - buf.wbegin, buf.wend-buf.wbegin); - ELSIF s.if.write(s, buf.cont[buf.wbegin]) THEN - count := 1; - ELSE - count := 0; - END; - IF count < 0 THEN - count := 0; - END; - INC(buf.wbegin, count); INC(s.rpos, count); - RETURN count > 0 - END Write; - - PROCEDURE FlushEvent; - VAR - event: Event; - BEGIN - IF s.flushEvent # NIL THEN - NEW(event); - event.type := s.flushEvent; - event.message := "flush event of Streams"; - event.stream := s; - Events.Raise(event); - END; - END FlushEvent; - - BEGIN - s.error := FALSE; - IF (write IN s.caps) & (s.buf # NIL) & s.buf.ok THEN - IF s.bidirect & (s.wbuf.wend > s.wbuf.wbegin) THEN - FlushEvent; - WHILE (s.wbuf.wend > s.wbuf.wbegin) & Write(s, s.wbuf) DO END; - IF s.wbuf.wend > s.wbuf.wbegin THEN - s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; - Error(s, WriteFailed); RETURN FALSE - END; - s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; - ELSIF ~s.bidirect & (s.buf.wend > s.buf.wbegin) THEN - FlushEvent; - ValidPos(s); - IF s.buf.pos + s.buf.wbegin # s.rpos THEN - IF ~(seek IN s.caps) THEN - Error(s, CannotSeek); - (* write in this case at the current position - else there is no easy way to write anyhow - *) - ELSIF ~s.if.seek(s, s.buf.pos + s.buf.wbegin, fromStart) THEN - s.buf.wend := s.buf.wbegin; s.write := 0; - Error(s, SeekFailed); RETURN FALSE - END; - s.rpos := s.buf.pos + s.buf.wbegin; - END; - WHILE (s.buf.wend > s.buf.wbegin) & Write(s, s.buf) DO END; - IF s.buf.wend > s.buf.wbegin THEN - s.buf.wend := s.buf.wbegin; s.write := bufsize - s.buf.wbegin; - Error(s, WriteFailed); RETURN FALSE - END; - IF {seek, tell, trunc} * s.caps = {} THEN - (* unidirectional pipeline; reset s.pos to avoid - unintentional flushes due to buffer boundaries - *) - s.pos := 0; s.rpos := 0; s.buf.pos := 0; - s.buf.wbegin := 0; s.buf.wend := 0; s.write := bufsize; - ELSE - IF (s.pos >= s.buf.pos) & (s.pos < s.buf.pos + bufsize) THEN - s.buf.wbegin := s.pos MOD bufsize; - s.buf.wend := s.buf.wbegin; - s.write := bufsize - s.buf.wbegin; - ELSE - s.write := 0; - END; - END; - END; - END; - RETURN TRUE - END InternalFlush; - - PROCEDURE Flush*(s: Stream) : BOOLEAN; - VAR - ok: BOOLEAN; - BEGIN - IF ~SYS.TAS(s.lock) THEN - IF s.bufmode = bufpool THEN - ok := FlushBufPool(s); - ELSE - ok := InternalFlush(s); - END; - IF ok & (flush IN s.caps) THEN - ok := s.if.flush(s); - IF ~ok THEN - Error(s, FlushFailed); - END; - END; - s.lock := FALSE; - RETURN ok - ELSE - Error(s, NestedCall); - RETURN FALSE - END; - END Flush; - - PROCEDURE InputInBuffer*(s: Stream) : BOOLEAN; - (* returns TRUE if the next byte to be read is buffered *) - VAR - buf: Buffer; - pos: Count; - BEGIN - IF s.bufmode = bufpool THEN - IF ~s.buf.ok THEN RETURN FALSE END; - pos := s.pos - s.pos MOD bufsize; - IF s.buf.pos # pos THEN - IF ~FindBuffer(s, pos, buf) THEN - RETURN FALSE - END; - pos := s.pos - buf.pos; - RETURN (pos >= buf.rbegin) & (pos < buf.rend) - END; - ELSIF s.bidirect THEN - RETURN s.left > 0 - END; - pos := s.pos MOD bufsize; - RETURN (read IN s.caps) & (s.buf # NIL) & s.buf.ok & - ((s.left > 0) OR - (write IN s.caps) & (s.buf.wbegin <= pos) & (s.buf.wend > pos)) - END InputInBuffer; - - PROCEDURE OutputInBuffer*(s: Stream) : BOOLEAN; - (* returns TRUE if Flush would lead to a write-operation *) - VAR - buf: Buffer; - BEGIN - IF s.bufmode = bufpool THEN - buf := s.bufpool.head; - WHILE buf # NIL DO - IF buf.wbegin # buf.wend THEN RETURN TRUE END; - buf := buf.nexta; - END; - RETURN FALSE - ELSIF s.bidirect THEN - RETURN s.wbuf.wend > s.wbuf.wbegin - ELSE - RETURN (write IN s.caps) & (s.buf # NIL) & s.buf.ok & - (s.buf.wend > s.buf.wbegin) - END; - END OutputInBuffer; - - PROCEDURE OutputWillBeBuffered*(s: Stream) : BOOLEAN; - (* returns TRUE if the next written byte will be buffered *) - VAR - buf: Buffer; - pos: Count; - BEGIN - IF s.bufmode = bufpool THEN - IF s.bufpool.nbuf < s.bufpool.maxbuf THEN RETURN TRUE END; - pos := s.pos - s.pos MOD bufsize; - IF s.buf.pos # pos THEN - IF ~FindBuffer(s, pos, buf) THEN RETURN FALSE END; - IF s.buf.wbegin = s.buf.wend THEN RETURN TRUE END; - pos := s.pos - buf.pos; - RETURN (pos >= buf.wbegin) & (pos <= buf.wend) OR - (buf.wbegin > 0) & (pos + 1 = buf.wbegin) - END; - ELSIF s.bidirect THEN - RETURN s.write > 0 - END; - RETURN (write IN s.caps) & (s.buf # NIL) & - ((s.write > 0) OR ~s.buf.ok) - END OutputWillBeBuffered; - - PROCEDURE Touch*(s: Stream); - (* forget any buffer contents *) - BEGIN - IF ~SYS.TAS(s.lock) THEN - s.error := FALSE; - IF write IN s.caps THEN - IF s.bufmode = bufpool THEN - IF ~FlushBufPool(s) THEN END; - ReleaseBufPool(s); - ELSE - IF ~InternalFlush(s) THEN END; - END; - END; - IF flush IN s.caps THEN - IF ~s.if.flush(s) THEN - Error(s, FlushFailed); - END; - END; - IF s.bidirect THEN - s.buf.rbegin := 0; s.buf.rend := 0; s.left := 0; - ELSE - s.validpos := FALSE; - IF s.buf # NIL THEN - s.buf.ok := FALSE; - s.left := 0; - s.write := 0; - s.eofFound := FALSE; - END; - END; - s.lock := FALSE; - ELSE - Error(s, NestedCall); - END; - END Touch; - - PROCEDURE Copy*(source, dest: Stream; maxcnt: Count) : BOOLEAN; - (* more efficient variants are possible *) - VAR - left, count, copied, read, written: Count; - buffer: ARRAY bufsize OF Byte; - ok: BOOLEAN; - BEGIN - IF maxcnt >= 0 THEN - read := 0; written := 0; ok := TRUE; - left := maxcnt; - LOOP - IF left = 0 THEN - EXIT - END; - ASSERT(left > 0); - IF left > bufsize THEN - count := bufsize; - ELSE - count := left; - END; - - ok := ReadPacket(source, buffer, 0, count) > 0; - ASSERT(source.count <= count); - INC(read, source.count); - IF ~ok THEN EXIT END; - - ok := WritePart(dest, buffer, 0, source.count); - ASSERT(dest.count <= source.count); - INC(written, dest.count); - IF ~ok THEN EXIT END; - - DEC(left, dest.count); - END; - source.count := read; dest.count := written; - RETURN ok - ELSE - copied := 0; - WHILE (ReadPacket(source, buffer, 0, bufsize) > 0) & - WritePart(dest, buffer, 0, source.count) DO - INC(copied, source.count); - END; - source.count := copied; dest.count := copied; - RETURN ~source.error & ~dest.error - END; - END Copy; - - (* === nulldev procedures ========================================== *) - - PROCEDURE NulldevRead(s: Stream; VAR byte: Byte) : BOOLEAN; - BEGIN - byte := 0X; + PROCEDURE Seek*(s: Stream; offset: Count; whence: Whence) : BOOLEAN; + VAR + rval: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + rval := InternalSeek(s, offset, whence); + s.lock := FALSE; + RETURN rval + ELSE + Error(s, NestedCall); RETURN FALSE - END NulldevRead; + END; + END Seek; - PROCEDURE NulldevWrite(s: Stream; byte: Byte) : BOOLEAN; - BEGIN - RETURN TRUE - END NulldevWrite; - - PROCEDURE InitNullIf(VAR nullif: Interface); - BEGIN - NEW(nullif); - nullif.read := NulldevRead; - nullif.write := NulldevWrite; - END InitNullIf; - - PROCEDURE OpenNulldev(VAR s: Stream); - BEGIN - NEW(s); - Services.Init(s, type); - Init(s, nullif, {read, write}, nobuf); - END OpenNulldev; - - PROCEDURE ExitHandler(event: Events.Event); - (* flush all streams on exit; - we do not close them to allow output by other exit event handlers - *) - VAR s: Stream; - BEGIN - s := opened; - WHILE s # NIL DO - IF (s.bufmode # nobuf) & (write IN s.caps) THEN - IF ~Flush(s) THEN END; - END; - s := s.next; + PROCEDURE Tell*(s: Stream; VAR offset: Count) : BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF tell IN s.caps THEN + IF s.buf # NIL THEN + IF s.validpos THEN + offset := s.pos; + ELSIF s.if.tell(s, s.rpos) THEN + s.validpos := TRUE; + s.pos := s.rpos; + offset := s.pos; + ELSE + s.lock := FALSE; + Error(s, TellFailed); + END; + ELSIF ~s.if.tell(s, offset) THEN + s.lock := FALSE; + Error(s, TellFailed); + END; + ELSE + s.lock := FALSE; + Error(s, CannotTell); END; - END ExitHandler; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + RETURN ~s.error + END Tell; - PROCEDURE FreeHandler(event: Events.Event); - (* set all free lists to NIL to return the associated storage - to the garbage collector - *) - BEGIN - freelist := NIL; - END FreeHandler; + PROCEDURE GetPos*(s: Stream; VAR offset: Count); + (* IF ~Tell(s, offset) THEN offset := internal position END; *) + BEGIN + IF ~Tell(s, offset) THEN + IF SYS.TAS(s.lock) THEN + Error(s, NestedCall); + ELSE + ValidPos(s); + offset := s.pos; + s.lock := FALSE; + END; + END; + END GetPos; + + PROCEDURE SetPos*(s: Stream; offset: Count); + (* IF ~Seek(s, offset, fromStart) THEN END; *) + BEGIN + IF ~Seek(s, offset, fromStart) THEN END; + END SetPos; + + PROCEDURE ^ Touch*(s: Stream); + + PROCEDURE Trunc*(s: Stream; length: Count) : BOOLEAN; + (* truncate `s' to a total length of `length'; + following holds if holes are permitted: + (1) the current position remains unchanged + (2) the contents between `length' and + the current position is undefined + this call fails if holes are not permitted and the + current position is beyond `length' + *) + VAR + ok: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF (trunc IN s.caps) & (length >= 0) THEN + s.error := FALSE; ok := TRUE; + IF s.buf # NIL THEN + ValidPos(s); + IF ~(holes IN s.caps) & (s.pos > length) THEN + ok := FALSE; + ELSIF (s.bufmode = bufpool) OR s.buf.ok & + (s.buf.pos DIV bufsize >= length DIV bufsize) THEN + Touch(s); + END; + END; + IF ~ok OR ~s.if.trunc(s, length) THEN + s.lock := FALSE; Error(s, TruncFailed); + END; + ELSE + s.lock := FALSE; Error(s, CannotTrunc); + END; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + RETURN ~s.error + END Trunc; + + PROCEDURE Back*(s: Stream) : BOOLEAN; + (* undo last read operation (one byte); + because of the delayed buffer filling + Back is always successful for buffered streams + immediately after read-operations + *) + VAR + rval: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF read IN s.caps THEN + IF seek IN s.caps THEN + (* fails if s.pos = 0 *) + rval := InternalSeek(s, -1, 1) + ELSIF s.bidirect & s.buf.ok THEN + IF s.pos > 0 THEN + DEC(s.pos); INC(s.left); + rval := TRUE; + ELSE + rval := FALSE; + END; + ELSIF (s.buf # NIL) & s.buf.ok THEN + rval := InternalSeek(s, -1, 1) & (s.left > 0) + ELSE + rval := FALSE + END; + ELSE + s.lock := FALSE; Error(s, CannotRead); + rval := FALSE + END; + s.lock := FALSE; + RETURN rval + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Back; + + PROCEDURE Insert*(s: Stream; byte: Byte) : BOOLEAN; + (* return `byte' on next read-operation *) + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF read IN s.caps THEN + IF s.buf # NIL THEN + (* seek in buffer possible? *) + IF s.bidirect THEN + IF s.pos > 0 THEN + DEC(s.pos); s.buf.cont[s.pos] := byte; + RETURN TRUE + ELSE + RETURN FALSE + END; + ELSIF s.buf.ok & + (s.pos > s.buf.pos+s.buf.rbegin) & + (s.pos < s.buf.pos+s.buf.rend) & + InternalSeek(s, -1, 1) THEN + s.buf.cont[s.pos MOD bufsize] := byte; + s.lock := FALSE; + RETURN TRUE + ELSE + s.lock := FALSE; + RETURN FALSE + END; + ELSE + s.lock := FALSE; Error(s, Unbuffered); RETURN FALSE + END; + ELSE + s.lock := FALSE; Error(s, CannotRead); RETURN FALSE + END; + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Insert; + + PROCEDURE InternalFlush(s: Stream) : BOOLEAN; + + PROCEDURE Write(s: Stream; buf: Buffer) : BOOLEAN; + + VAR + count: Count; + BEGIN + IF addrio IN s.caps THEN + count := s.if.addrwrite(s, SYSTEM.ADR(buf.cont[buf.wbegin]), + buf.wend-buf.wbegin); + ELSIF bufio IN s.caps THEN + count := s.if.bufwrite(s, buf.cont, + buf.wbegin, buf.wend-buf.wbegin); + ELSIF s.if.write(s, buf.cont[buf.wbegin]) THEN + count := 1; + ELSE + count := 0; + END; + IF count < 0 THEN + count := 0; + END; + INC(buf.wbegin, count); INC(s.rpos, count); + RETURN count > 0 + END Write; + + PROCEDURE FlushEvent; + VAR + event: Event; + BEGIN + IF s.flushEvent # NIL THEN + NEW(event); + event.type := s.flushEvent; + event.message := "flush event of Streams"; + event.stream := s; + Events.Raise(event); + END; + END FlushEvent; + + BEGIN + s.error := FALSE; + IF (write IN s.caps) & (s.buf # NIL) & s.buf.ok THEN + IF s.bidirect & (s.wbuf.wend > s.wbuf.wbegin) THEN + FlushEvent; + WHILE (s.wbuf.wend > s.wbuf.wbegin) & Write(s, s.wbuf) DO END; + IF s.wbuf.wend > s.wbuf.wbegin THEN + s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; + Error(s, WriteFailed); RETURN FALSE + END; + s.wbuf.wbegin := 0; s.wbuf.wend := 0; s.write := bufsize; + ELSIF ~s.bidirect & (s.buf.wend > s.buf.wbegin) THEN + FlushEvent; + ValidPos(s); + IF s.buf.pos + s.buf.wbegin # s.rpos THEN + IF ~(seek IN s.caps) THEN + Error(s, CannotSeek); + (* write in this case at the current position + else there is no easy way to write anyhow + *) + ELSIF ~s.if.seek(s, s.buf.pos + s.buf.wbegin, fromStart) THEN + s.buf.wend := s.buf.wbegin; s.write := 0; + Error(s, SeekFailed); RETURN FALSE + END; + s.rpos := s.buf.pos + s.buf.wbegin; + END; + WHILE (s.buf.wend > s.buf.wbegin) & Write(s, s.buf) DO END; + IF s.buf.wend > s.buf.wbegin THEN + s.buf.wend := s.buf.wbegin; s.write := bufsize - s.buf.wbegin; + Error(s, WriteFailed); RETURN FALSE + END; + IF {seek, tell, trunc} * s.caps = {} THEN + (* unidirectional pipeline; reset s.pos to avoid + unintentional flushes due to buffer boundaries + *) + s.pos := 0; s.rpos := 0; s.buf.pos := 0; + s.buf.wbegin := 0; s.buf.wend := 0; s.write := bufsize; + ELSE + IF (s.pos >= s.buf.pos) & (s.pos < s.buf.pos + bufsize) THEN + s.buf.wbegin := s.pos MOD bufsize; + s.buf.wend := s.buf.wbegin; + s.write := bufsize - s.buf.wbegin; + ELSE + s.write := 0; + END; + END; + END; + END; + RETURN TRUE + END InternalFlush; + + PROCEDURE Flush*(s: Stream) : BOOLEAN; + VAR + ok: BOOLEAN; + BEGIN + IF ~SYS.TAS(s.lock) THEN + IF s.bufmode = bufpool THEN + ok := FlushBufPool(s); + ELSE + ok := InternalFlush(s); + END; + IF ok & (flush IN s.caps) THEN + ok := s.if.flush(s); + IF ~ok THEN + Error(s, FlushFailed); + END; + END; + s.lock := FALSE; + RETURN ok + ELSE + Error(s, NestedCall); + RETURN FALSE + END; + END Flush; + + PROCEDURE InputInBuffer*(s: Stream) : BOOLEAN; + (* returns TRUE if the next byte to be read is buffered *) + VAR + buf: Buffer; + pos: Count; + BEGIN + IF s.bufmode = bufpool THEN + IF ~s.buf.ok THEN RETURN FALSE END; + pos := s.pos - s.pos MOD bufsize; + IF s.buf.pos # pos THEN + IF ~FindBuffer(s, pos, buf) THEN + RETURN FALSE + END; + pos := s.pos - buf.pos; + RETURN (pos >= buf.rbegin) & (pos < buf.rend) + END; + ELSIF s.bidirect THEN + RETURN s.left > 0 + END; + pos := s.pos MOD bufsize; + RETURN (read IN s.caps) & (s.buf # NIL) & s.buf.ok & + ((s.left > 0) OR + (write IN s.caps) & (s.buf.wbegin <= pos) & (s.buf.wend > pos)) + END InputInBuffer; + + PROCEDURE OutputInBuffer*(s: Stream) : BOOLEAN; + (* returns TRUE if Flush would lead to a write-operation *) + VAR + buf: Buffer; + BEGIN + IF s.bufmode = bufpool THEN + buf := s.bufpool.head; + WHILE buf # NIL DO + IF buf.wbegin # buf.wend THEN RETURN TRUE END; + buf := buf.nexta; + END; + RETURN FALSE + ELSIF s.bidirect THEN + RETURN s.wbuf.wend > s.wbuf.wbegin + ELSE + RETURN (write IN s.caps) & (s.buf # NIL) & s.buf.ok & + (s.buf.wend > s.buf.wbegin) + END; + END OutputInBuffer; + + PROCEDURE OutputWillBeBuffered*(s: Stream) : BOOLEAN; + (* returns TRUE if the next written byte will be buffered *) + VAR + buf: Buffer; + pos: Count; + BEGIN + IF s.bufmode = bufpool THEN + IF s.bufpool.nbuf < s.bufpool.maxbuf THEN RETURN TRUE END; + pos := s.pos - s.pos MOD bufsize; + IF s.buf.pos # pos THEN + IF ~FindBuffer(s, pos, buf) THEN RETURN FALSE END; + IF s.buf.wbegin = s.buf.wend THEN RETURN TRUE END; + pos := s.pos - buf.pos; + RETURN (pos >= buf.wbegin) & (pos <= buf.wend) OR + (buf.wbegin > 0) & (pos + 1 = buf.wbegin) + END; + ELSIF s.bidirect THEN + RETURN s.write > 0 + END; + RETURN (write IN s.caps) & (s.buf # NIL) & + ((s.write > 0) OR ~s.buf.ok) + END OutputWillBeBuffered; + + PROCEDURE Touch*(s: Stream); + (* forget any buffer contents *) + BEGIN + IF ~SYS.TAS(s.lock) THEN + s.error := FALSE; + IF write IN s.caps THEN + IF s.bufmode = bufpool THEN + IF ~FlushBufPool(s) THEN END; + ReleaseBufPool(s); + ELSE + IF ~InternalFlush(s) THEN END; + END; + END; + IF flush IN s.caps THEN + IF ~s.if.flush(s) THEN + Error(s, FlushFailed); + END; + END; + IF s.bidirect THEN + s.buf.rbegin := 0; s.buf.rend := 0; s.left := 0; + ELSE + s.validpos := FALSE; + IF s.buf # NIL THEN + s.buf.ok := FALSE; + s.left := 0; + s.write := 0; + s.eofFound := FALSE; + END; + END; + s.lock := FALSE; + ELSE + Error(s, NestedCall); + END; + END Touch; + + PROCEDURE Copy*(source, dest: Stream; maxcnt: Count) : BOOLEAN; + (* more efficient variants are possible *) + VAR + left, count, copied, read, written: Count; + buffer: ARRAY bufsize OF Byte; + ok: BOOLEAN; + BEGIN + IF maxcnt >= 0 THEN + read := 0; written := 0; ok := TRUE; + left := maxcnt; + LOOP + IF left = 0 THEN + EXIT + END; + ASSERT(left > 0); + IF left > bufsize THEN + count := bufsize; + ELSE + count := left; + END; + + ok := ReadPacket(source, buffer, 0, count) > 0; + ASSERT(source.count <= count); + INC(read, source.count); + IF ~ok THEN EXIT END; + + ok := WritePart(dest, buffer, 0, source.count); + ASSERT(dest.count <= source.count); + INC(written, dest.count); + IF ~ok THEN EXIT END; + + DEC(left, dest.count); + END; + source.count := read; dest.count := written; + RETURN ok + ELSE + copied := 0; + WHILE (ReadPacket(source, buffer, 0, bufsize) > 0) & + WritePart(dest, buffer, 0, source.count) DO + INC(copied, source.count); + END; + source.count := copied; dest.count := copied; + RETURN ~source.error & ~dest.error + END; + END Copy; + + (* === nulldev procedures ========================================== *) + + PROCEDURE NulldevRead(s: Stream; VAR byte: Byte) : BOOLEAN; + BEGIN + byte := 0X; + RETURN FALSE + END NulldevRead; + + PROCEDURE NulldevWrite(s: Stream; byte: Byte) : BOOLEAN; + BEGIN + RETURN TRUE + END NulldevWrite; + + PROCEDURE InitNullIf(VAR nullif: Interface); + BEGIN + NEW(nullif); + nullif.read := NulldevRead; + nullif.write := NulldevWrite; + END InitNullIf; + + PROCEDURE OpenNulldev(VAR s: Stream); + BEGIN + NEW(s); + Services.Init(s, type); + Init(s, nullif, {read, write}, nobuf); + END OpenNulldev; + + PROCEDURE ExitHandler(event: Events.Event); + (* flush all streams on exit; + we do not close them to allow output by other exit event handlers + *) + VAR s: Stream; + BEGIN + s := opened; + WHILE s # NIL DO + IF (s.bufmode # nobuf) & (write IN s.caps) THEN + IF ~Flush(s) THEN END; + END; + s := s.next; + END; + END ExitHandler; + + PROCEDURE FreeHandler(event: Events.Event); + (* set all free lists to NIL to return the associated storage + to the garbage collector + *) + BEGIN + freelist := NIL; + END FreeHandler; BEGIN - Services.CreateType(type, "Streams.Stream", ""); + Services.CreateType(type, "Streams.Stream", ""); - errormsg[NoHandlerDefined] := "no handler defined"; - errormsg[CannotRead] := "not opened for reading"; - errormsg[CannotSeek] := "not capable of seeking"; - errormsg[CloseFailed] := "close operation failed"; - errormsg[NotLineBuffered] := "stream is not line buffered"; - errormsg[SeekFailed] := "seek operation failed"; - errormsg[TellFailed] := "tell operation failed"; - errormsg[BadWhence] := "bad value of whence parameter"; - errormsg[CannotTell] := "not capable of telling current position"; - errormsg[WriteFailed] := "write operation failed"; - errormsg[CannotWrite] := "not opened for writing"; - errormsg[ReadFailed] := "read operation failed"; - errormsg[Unbuffered] := "operation is not valid for unbuffered streams"; - errormsg[BadParameters] := "bad parameter values"; - errormsg[CannotTrunc] := "not capable of truncating"; - errormsg[TruncFailed] := "trunc operation failed"; - errormsg[NestedCall] := "nested stream operation"; - errormsg[FlushFailed] := "flush operation failed"; + errormsg[NoHandlerDefined] := "no handler defined"; + errormsg[CannotRead] := "not opened for reading"; + errormsg[CannotSeek] := "not capable of seeking"; + errormsg[CloseFailed] := "close operation failed"; + errormsg[NotLineBuffered] := "stream is not line buffered"; + errormsg[SeekFailed] := "seek operation failed"; + errormsg[TellFailed] := "tell operation failed"; + errormsg[BadWhence] := "bad value of whence parameter"; + errormsg[CannotTell] := "not capable of telling current position"; + errormsg[WriteFailed] := "write operation failed"; + errormsg[CannotWrite] := "not opened for writing"; + errormsg[ReadFailed] := "read operation failed"; + errormsg[Unbuffered] := "operation is not valid for unbuffered streams"; + errormsg[BadParameters] := "bad parameter values"; + errormsg[CannotTrunc] := "not capable of truncating"; + errormsg[TruncFailed] := "trunc operation failed"; + errormsg[NestedCall] := "nested stream operation"; + errormsg[FlushFailed] := "flush operation failed"; - Events.Define(error); Events.SetPriority(error, Priorities.liberrors); - Events.Ignore(error); + Events.Define(error); Events.SetPriority(error, Priorities.liberrors); + Events.Ignore(error); - opened := NIL; - InitNullIf(nullif); - OpenNulldev(null); stdin := null; stdout := null; stderr := null; + opened := NIL; + InitNullIf(nullif); + OpenNulldev(null); stdin := null; stdout := null; stderr := null; - Events.Handler(Process.termination, ExitHandler); - Events.Handler(Process.startOfGarbageCollection, FreeHandler); + Events.Handler(Process.termination, ExitHandler); + Events.Handler(Process.startOfGarbageCollection, FreeHandler); END ulmStreams. diff --git a/src/library/ulm/ulmSysIO.Mod b/src/library/ulm/ulmSysIO.Mod index a961f64d..2a22d29f 100644 --- a/src/library/ulm/ulmSysIO.Mod +++ b/src/library/ulm/ulmSysIO.Mod @@ -30,7 +30,10 @@ MODULE ulmSysIO; - IMPORT RelatedEvents := ulmRelatedEvents, Sys := ulmSys, SYS := SYSTEM, ulmSYSTEM, SysErrors := ulmSysErrors, SysTypes := ulmSysTypes; + IMPORT RelatedEvents := ulmRelatedEvents, + Sys := ulmSys, SYS := SYSTEM, ulmSYSTEM, + SysErrors := ulmSysErrors, SysTypes := ulmSysTypes, + Platform; CONST (* file control options: arguments of Fcntl and Open *) @@ -86,20 +89,20 @@ MODULE ulmSysIO; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; (* the filename must be 0X-terminated *) VAR - d0, d1: (*INTEGER*)LONGINT; + error: Platform.ErrorCode; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.open, d0, d1, - SYS.ADR(filename), SYS.VAL(LONGINT, options), protection) THEN - fd := d0; - RETURN TRUE + IF options * creat # {} THEN error := Platform.New(filename, fd) + ELSIF options * (rdwr+wronly) # {} THEN error := Platform.OldRW(filename, fd) + ELSE error := Platform.OldRO(filename, fd) END; + IF error = 0 THEN RETURN TRUE ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.open, filename); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.open, filename); RETURN FALSE END; END; @@ -119,21 +122,18 @@ MODULE ulmSysIO; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; VAR - d0, d1: LONGINT; - a0, a1 : LONGINT; (* just to match UNIXCALL interface *) + error: Platform.ErrorCode; BEGIN interrupted := FALSE; - a0 := 0; a1 := 0; (* Initialised to disable compiler warning. *) LOOP - IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd, a0, a1) THEN - (*IF ulmSYSTEM.UNIXCALL(Sys.close, d0, d1, fd) THEN*) - RETURN TRUE + error := Platform.Close(fd); + IF error = 0 THEN RETURN TRUE ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.close, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.close, ""); RETURN FALSE END; END; @@ -148,18 +148,19 @@ MODULE ulmSysIO; >0: number of bytes read *) VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; + bytesread: Count; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.read, d0, d1, fd, buf, cnt) THEN - RETURN d0 + error := Platform.Read(fd, buf, cnt, bytesread); + IF error = 0 THEN RETURN bytesread ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.read, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.read, ""); RETURN -1 END; END; @@ -173,18 +174,19 @@ MODULE ulmSysIO; >=0: number of bytes written *) VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; + byteswritten: Count; BEGIN interrupted := FALSE; LOOP - IF ulmSYSTEM.UNIXCALL(Sys.write, d0, d1, fd, buf, cnt) THEN - RETURN d0 + error := Platform.Write(fd, buf, cnt); + IF error = 0 THEN RETURN cnt (* todo: Upfate Platform.Write to return actual length written. *) ELSE - IF d0 = SysErrors.intr THEN + IF Platform.Interrupted(error) THEN interrupted := TRUE; END; - IF (d0 # SysErrors.intr) OR ~retry THEN - SysErrors.Raise(errors, d0, Sys.write, ""); + IF ~Platform.Interrupted(error) OR ~retry THEN + SysErrors.Raise(errors, error, Sys.write, ""); RETURN -1 END; END; @@ -194,16 +196,23 @@ MODULE ulmSysIO; PROCEDURE Seek*(fd: File; offset: Count; whence: Whence; errors: RelatedEvents.Object) : BOOLEAN; VAR - d0, d1: LONGINT; + error: Platform.ErrorCode; relativity: INTEGER; BEGIN - IF ulmSYSTEM.UNIXCALL(Sys.lseek, d0, d1, fd, offset, whence) THEN - RETURN TRUE + CASE whence OF + |fromPos: relativity := Platform.SeekCur + |fromEnd: relativity := Platform.SeekEnd + ELSE relativity := Platform.SeekSet + END; + error := Platform.Seek(fd, offset, relativity); + IF error = 0 THEN RETURN TRUE ELSE - SysErrors.Raise(errors, d0, Sys.lseek, ""); + SysErrors.Raise(errors, error, Sys.lseek, ""); RETURN FALSE END; END Seek; +(* + PROCEDURE Tell*(fd: File; VAR offset: Count; errors: RelatedEvents.Object) : BOOLEAN; VAR @@ -229,7 +238,6 @@ MODULE ulmSysIO; (* following system call fails for non-tty's *) RETURN ulmSYSTEM.UNIXCALL(Sys.ioctl, d0, d1, fd, tcgeta, SYS.ADR(buf)) END Isatty; - PROCEDURE Fcntl*(fd: File; request: INTEGER; VAR arg: LONGINT; errors: RelatedEvents.Object; retry: BOOLEAN; VAR interrupted: BOOLEAN) : BOOLEAN; @@ -343,5 +351,6 @@ MODULE ulmSysIO; RETURN FALSE END; END Pipe; +*) END ulmSysIO. diff --git a/src/library/ulm/ulmSysTypes.Mod b/src/library/ulm/ulmSysTypes.Mod index 174140e7..6d16ab4b 100644 --- a/src/library/ulm/ulmSysTypes.Mod +++ b/src/library/ulm/ulmSysTypes.Mod @@ -30,7 +30,7 @@ MODULE ulmSysTypes; - IMPORT Types := ulmTypes; + IMPORT Types := ulmTypes, Platform; TYPE Address* = Types.Address; @@ -39,17 +39,17 @@ MODULE ulmSysTypes; Size* = Types.Size; Byte* = Types.Byte; - File* = (*INTEGER*)LONGINT; (* in ulm's system both INTEGER and LONGINT are 4 bytes long *) + File* = Platform.FileHandle; Offset* = LONGINT; Device* = LONGINT; - Inode* = LONGINT; - Time* = LONGINT; + Inode* = LONGINT; + Time* = LONGINT; - Word* = INTEGER; (* must have the size of C's int-type *) + Word* = INTEGER; (* must have the size of C's int-type *) (* Note: linux supports wait4 but not waitid, i.e. these * constants aren't needed. *) - (* + (* CONST (* possible values of the idtype parameter (4 bytes), see diff --git a/src/library/ulm/ulmTCrypt.Mod b/src/library/ulm/ulmTCrypt.Mod index 4003eaf0..c35c7809 100644 --- a/src/library/ulm/ulmTCrypt.Mod +++ b/src/library/ulm/ulmTCrypt.Mod @@ -1,1764 +1,1770 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1997 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1997 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: TCrypt.om,v 1.1 1997/04/02 11:54:02 borchert Exp borchert $ - ---------------------------------------------------------------------------- - $Log: TCrypt.om,v $ - Revision 1.1 1997/04/02 11:54:02 borchert - Initial revision + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: TCrypt.om,v 1.1 1997/04/02 11:54:02 borchert Exp borchert $ + ---------------------------------------------------------------------------- + $Log: TCrypt.om,v $ + Revision 1.1 1997/04/02 11:54:02 borchert + Initial revision - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- *) MODULE ulmTCrypt; (* Michael Szczuka *) - (* Trautner's association method for key exchange *) + (* Trautner's association method for key exchange *) - IMPORT AsymmetricCiphers := ulmAsymmetricCiphers, BlockCiphers := ulmBlockCiphers, Ciphers := ulmCiphers, Conclusions := ulmConclusions, Events := ulmEvents, - NetIO := ulmNetIO, PersistentObjects := ulmPersistentObjects, Random := ulmRandomGenerators, RelatedEvents := ulmRelatedEvents, - Services := ulmServices, Streams := ulmStreams, SYS := SYSTEM; + IMPORT + AsymmetricCiphers := ulmAsymmetricCiphers, BlockCiphers := ulmBlockCiphers, + Ciphers := ulmCiphers, Conclusions := ulmConclusions, + Events := ulmEvents, NetIO := ulmNetIO, + PersistentObjects := ulmPersistentObjects, Random := ulmRandomGenerators, + RelatedEvents := ulmRelatedEvents, Services := ulmServices, + Streams := ulmStreams, SYS := SYSTEM; - CONST - M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) - MaxVar = 8; (* number of variables of a polynomial *) - MaxNrExp = 4; (* maxiumum number of different exponts used during - initialisaton *) - Dim = 2; (* dimension of the linear recursion *) - Rounds = 16; (* length of the linear recursion in rounds *) - LastRounds = 4; (* use the last LastRounds polynomial vectors as - the composed function eta *) - reg = 1; sing = 2; random = 3; - LIST = TRUE; NOLIST = FALSE; - MaxTerms = 1000; + CONST + M = 16; (* size of an element of CC(M) [ring of Circular Convolution] *) + MaxVar = 8; (* number of variables of a polynomial *) + MaxNrExp = 4; (* maxiumum number of different exponts used during + initialisaton *) + Dim = 2; (* dimension of the linear recursion *) + Rounds = 16; (* length of the linear recursion in rounds *) + LastRounds = 4; (* use the last LastRounds polynomial vectors as + the composed function eta *) + reg = 1; sing = 2; random = 3; + LIST = TRUE; NOLIST = FALSE; + MaxTerms = 1000; - CONST - writeSetFailed = 0; - readSetFailed = 1; - notRegular = 2; - errorcodes = 3; + CONST + writeSetFailed = 0; + readSetFailed = 1; + notRegular = 2; + errorcodes = 3; - TYPE - (* an element out of CC(M) *) - CCMElement = SET; - Exponent = ARRAY MaxVar OF SHORTINT; + TYPE + (* an element out of CC(M) *) + CCMElement = SET; + Exponent = ARRAY MaxVar OF SHORTINT; - TYPE - (* a polynomial with coefficients out of CC(M) *) - Polynom = POINTER TO PolynomRec; - PolynomRec = RECORD - koeff : CCMElement; - exp : Exponent; - next : Polynom; + TYPE + (* a polynomial with coefficients out of CC(M) *) + Polynom = POINTER TO PolynomRec; + PolynomRec = RECORD + koeff : CCMElement; + exp : Exponent; + next : Polynom; + END; + + TYPE + VektorCCM = ARRAY Dim OF CCMElement; + VektorPolynom = ARRAY Dim OF Polynom; + MatCCM = ARRAY Dim, Dim OF CCMElement; + MatPolynom = ARRAY Dim, Dim OF Polynom; + ListCCM = ARRAY Rounds OF CCMElement; + ListPolynom = ARRAY Rounds OF Polynom; + ChainCCM = ARRAY Rounds OF VektorCCM; + ChainPolynom = ARRAY Rounds OF VektorPolynom; + (* to increase the performance of the algorithm there shouldn't be too + many different exponents to start with *) + ListExp = ARRAY MaxNrExp OF Exponent; + + TYPE + (* this type is the input of the TCrypt method *) + TCryptInput = POINTER TO TCryptInputRec; + TCryptInputRec = RECORD + arg : ARRAY MaxVar OF CCMElement; + END; + + TYPE + (* result type after encryption with the public key *) + TCryptTmp = POINTER TO TCryptTmpRec; + TCryptTmpRec = RECORD + numerator : ChainCCM; + denominator : ListCCM; + END; + + TYPE + (* result type of the algorithm *) + TCryptRes = POINTER TO TCryptResRec; + TCryptResRec = RECORD + arg : ARRAY LastRounds OF VektorCCM; + END; + + TYPE + (* this type represents the public function f resp. phi *) + Phi = POINTER TO PhiRec; + PhiRec = RECORD + num : ChainPolynom; + denom : ListPolynom; + END; + + TYPE + (* the private/secret function g resp. psi consisting of an inital matrix + and a permutation *) + Psi = POINTER TO PsiRec; + PsiRec = RECORD + (* although the inital matrix consists only of elements out of CC(M) + this generalization is useful since all other matrces consist of + polynomials *) + initialmatrix : MatCCM; + (* correcting factors *) + korrNum : ChainCCM; + korrDenom : ListCCM; + END; + + (* the public function h resp. eta being the composition of f/phi + and g/psi *) + TYPE + Eta = POINTER TO EtaRec; + EtaRec = RECORD + p : ARRAY LastRounds OF VektorPolynom; + END; + + TYPE + (* the declaration of a basic type which PublicCipher and PrivateCipher + are descendents from seems a good idea ... at least to me :) *) + Cipher* = POINTER TO CipherRec; + CipherRec* = RECORD (AsymmetricCiphers.CipherRec) END; + (* the specific format of a public key for Trautner's technique *) + PublicCipher = POINTER TO PublicCipherRec; + PublicCipherRec = RECORD + (CipherRec) + phi : Phi; + eta : Eta; + END; + (* the specific format of a key for Trautner's technique *) + PrivateCipher = POINTER TO PrivateCipherRec; + PrivateCipherRec = RECORD + (CipherRec) + phi : Phi; + psi : Psi; + eta : Eta; + END; + + TYPE + ErrorEvent = POINTER TO ErrorEventRec; + ErrorEventRec = RECORD + (Events.EventRec) + errorcode : SHORTINT; + END; + + VAR + pubType, privType, cipherType : Services.Type; + pubIf, privIf, cipherIf : PersistentObjects.Interface; + NullCCM, EinsCCM : CCMElement; (* the zero and unit of CC(M) *) + NullExp : Exponent; (* consists of zero exponents *) + NullExpList : ListExp; (* a pseudo list for CreatePolynom *) + GlobalExpList : ListExp; (* contains the exponents which should be used + when calling CreatePolynom *) + NullPolynom : Polynom; (* the zero polynomial *) + PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) + PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed + up evaluation of a polynomial *) + k : SHORTINT; (* simple counter during initialisation *) + error : Events.EventType; + errormsg : ARRAY errorcodes OF Events.Message; + + + (* ***** error handling ***** *) + + PROCEDURE InitErrorHandling; + BEGIN + Events.Define(error); + errormsg[writeSetFailed] := "couldn't write set"; + errormsg[readSetFailed] := "couldn't read set"; + errormsg[notRegular] := "element isn't regular"; + END InitErrorHandling; + + PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); + VAR + event: ErrorEvent; + BEGIN + NEW(event); + event.message := errormsg[errorcode]; + event.type := error; + event.errorcode := errorcode; + RelatedEvents.Raise(s, event); + END Error; + + (* ***** arithmetic functions for elements out of CC(M) ***** *) + + PROCEDURE RegulaerCCM (x: CCMElement) : BOOLEAN; + (* tests x for regularity [a regular CCMElement contains an odd number of + set bits]; returns TRUE when x is regular, FALSE otherwise *) + VAR + res, i : SHORTINT; + BEGIN + i := 0; + res := 0; + REPEAT (* counting the set bits *) + IF i IN x THEN + INC(res); END; + INC(i); + UNTIL i>=M; + RETURN ((res MOD 2) = 1); + END RegulaerCCM; - TYPE - VektorCCM = ARRAY Dim OF CCMElement; - VektorPolynom = ARRAY Dim OF Polynom; - MatCCM = ARRAY Dim, Dim OF CCMElement; - MatPolynom = ARRAY Dim, Dim OF Polynom; - ListCCM = ARRAY Rounds OF CCMElement; - ListPolynom = ARRAY Rounds OF Polynom; - ChainCCM = ARRAY Rounds OF VektorCCM; - ChainPolynom = ARRAY Rounds OF VektorPolynom; - (* to increase the performance of the algorithm there shouldn't be too - many different exponents to start with *) - ListExp = ARRAY MaxNrExp OF Exponent; - - TYPE - (* this type is the input of the TCrypt method *) - TCryptInput = POINTER TO TCryptInputRec; - TCryptInputRec = RECORD - arg : ARRAY MaxVar OF CCMElement; + PROCEDURE EqualCCM (x, y: CCMElement) : BOOLEAN; + (* compares x and y for equality; if x and y are equal TRUE is returned, + FALSE otherwise *) + VAR + i : SHORTINT; + BEGIN + i := 0; + WHILE i < M DO + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + RETURN FALSE; END; + INC(i); + END; + RETURN TRUE; + END EqualCCM; - TYPE - (* result type after encryption with the public key *) - TCryptTmp = POINTER TO TCryptTmpRec; - TCryptTmpRec = RECORD - numerator : ChainCCM; - denominator : ListCCM; + PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); + (* add x and y in CC(M) *) + VAR + i : SHORTINT; + BEGIN + z := NullCCM; + i := 0; + REPEAT + IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN + z := z + {i}; END; + INC(i); + UNTIL i>=M; + END AddCCM; - TYPE - (* result type of the algorithm *) - TCryptRes = POINTER TO TCryptResRec; - TCryptResRec = RECORD - arg : ARRAY LastRounds OF VektorCCM; - END; - - TYPE - (* this type represents the public function f resp. phi *) - Phi = POINTER TO PhiRec; - PhiRec = RECORD - num : ChainPolynom; - denom : ListPolynom; - END; - - TYPE - (* the private/secret function g resp. psi consisting of an inital matrix - and a permutation *) - Psi = POINTER TO PsiRec; - PsiRec = RECORD - (* although the inital matrix consists only of elements out of CC(M) - this generalization is useful since all other matrces consist of - polynomials *) - initialmatrix : MatCCM; - (* correcting factors *) - korrNum : ChainCCM; - korrDenom : ListCCM; - END; - - (* the public function h resp. eta being the composition of f/phi - and g/psi *) - TYPE - Eta = POINTER TO EtaRec; - EtaRec = RECORD - p : ARRAY LastRounds OF VektorPolynom; - END; - - TYPE - (* the declaration of a basic type which PublicCipher and PrivateCipher - are descendents from seems a good idea ... at least to me :) *) - Cipher* = POINTER TO CipherRec; - CipherRec* = RECORD (AsymmetricCiphers.CipherRec) END; - (* the specific format of a public key for Trautner's technique *) - PublicCipher = POINTER TO PublicCipherRec; - PublicCipherRec = RECORD - (CipherRec) - phi : Phi; - eta : Eta; - END; - (* the specific format of a key for Trautner's technique *) - PrivateCipher = POINTER TO PrivateCipherRec; - PrivateCipherRec = RECORD - (CipherRec) - phi : Phi; - psi : Psi; - eta : Eta; - END; - - TYPE - ErrorEvent = POINTER TO ErrorEventRec; - ErrorEventRec = RECORD - (Events.EventRec) - errorcode : SHORTINT; - END; - - VAR - pubType, privType, cipherType : Services.Type; - pubIf, privIf, cipherIf : PersistentObjects.Interface; - NullCCM, EinsCCM : CCMElement; (* the zero and unit of CC(M) *) - NullExp : Exponent; (* consists of zero exponents *) - NullExpList : ListExp; (* a pseudo list for CreatePolynom *) - GlobalExpList : ListExp; (* contains the exponents which should be used - when calling CreatePolynom *) - NullPolynom : Polynom; (* the zero polynomial *) - PolFeld : ARRAY MaxTerms OF Polynom; (* used for sorting purposes *) - PreEvalArg : ARRAY M OF TCryptInput; (* precomputed values to speed - up evaluation of a polynomial *) - k : SHORTINT; (* simple counter during initialisation *) - error : Events.EventType; - errormsg : ARRAY errorcodes OF Events.Message; - - - (* ***** error handling ***** *) - - PROCEDURE InitErrorHandling; - BEGIN - Events.Define(error); - errormsg[writeSetFailed] := "couldn't write set"; - errormsg[readSetFailed] := "couldn't read set"; - errormsg[notRegular] := "element isn't regular"; - END InitErrorHandling; - - PROCEDURE Error(s: Streams.Stream; errorcode: SHORTINT); - VAR - event: ErrorEvent; - BEGIN - NEW(event); - event.message := errormsg[errorcode]; - event.type := error; - event.errorcode := errorcode; - RelatedEvents.Raise(s, event); - END Error; - - (* ***** arithmetic functions for elements out of CC(M) ***** *) - - PROCEDURE RegulaerCCM (x: CCMElement) : BOOLEAN; - (* tests x for regularity [a regular CCMElement contains an odd number of - set bits]; returns TRUE when x is regular, FALSE otherwise *) - VAR - res, i : SHORTINT; - BEGIN - i := 0; - res := 0; - REPEAT (* counting the set bits *) - IF i IN x THEN - INC(res); - END; - INC(i); - UNTIL i>=M; - RETURN ((res MOD 2) = 1); - END RegulaerCCM; - - PROCEDURE EqualCCM (x, y: CCMElement) : BOOLEAN; - (* compares x and y for equality; if x and y are equal TRUE is returned, - FALSE otherwise *) - VAR - i : SHORTINT; - BEGIN - i := 0; - WHILE i < M DO - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - RETURN FALSE; - END; - INC(i); - END; - RETURN TRUE; - END EqualCCM; - - PROCEDURE AddCCM (x, y: CCMElement; VAR z: CCMElement); - (* add x and y in CC(M) *) - VAR - i : SHORTINT; - BEGIN - z := NullCCM; - i := 0; + PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); + (* multiply x and y in CC(M) *) + VAR + i, j, diff : SHORTINT; + tmp : INTEGER; + BEGIN + z := NullCCM; + i := 0; + REPEAT + j := 0; + tmp := 0; REPEAT - IF ((i IN x) & (~(i IN y))) OR ((~(i IN x)) & (i IN y)) THEN - z := z + {i}; - END; - INC(i); - UNTIL i>=M; - END AddCCM; - - PROCEDURE MulCCM (x, y: CCMElement; VAR z: CCMElement); - (* multiply x and y in CC(M) *) - VAR - i, j, diff : SHORTINT; - tmp : INTEGER; - BEGIN - z := NullCCM; - i := 0; - REPEAT - j := 0; - tmp := 0; - REPEAT - diff := i-j; - IF diff >= 0 THEN - IF (j IN x) & (diff IN y) THEN - INC(tmp); - END; - ELSE - IF (j IN x) & ((M+diff) IN y) THEN - INC(tmp); - END; - END; - INC(j); - UNTIL j>=M; - IF (tmp MOD 2) = 1 THEN - z := z + {i}; - END; - INC(i); - UNTIL i>=M; - END MulCCM; - - PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); - (* raises x to the power exp in CC(M) *) - VAR - tmp : CCMElement; - BEGIN - (* some special cases first *) - IF exp >= M THEN - IF ~RegulaerCCM(x) THEN - (* x is singular -> result is zero *) - z := NullCCM; - RETURN; - END; - (* x is regular -> compute the modulus of exp mod M and use this - instead of exp *) - exp := exp MOD M; - END; - IF exp = 0 THEN - z := EinsCCM; - RETURN; - END; - IF exp = 1 THEN - z := x; - RETURN; + diff := i-j; + IF diff >= 0 THEN + IF (j IN x) & (diff IN y) THEN + INC(tmp); + END; + ELSE + IF (j IN x) & ((M+diff) IN y) THEN + INC(tmp); + END; + END; + INC(j); + UNTIL j>=M; + IF (tmp MOD 2) = 1 THEN + z := z + {i}; END; + INC(i); + UNTIL i>=M; + END MulCCM; - (* default case; use a "square and multiply" technique *) - tmp := x; + PROCEDURE PowerCCM (x: CCMElement; exp: INTEGER; VAR z: CCMElement); + (* raises x to the power exp in CC(M) *) + VAR + tmp : CCMElement; + BEGIN + (* some special cases first *) + IF exp >= M THEN + IF ~RegulaerCCM(x) THEN + (* x is singular -> result is zero *) + z := NullCCM; + RETURN; + END; + (* x is regular -> compute the modulus of exp mod M and use this + instead of exp *) + exp := exp MOD M; + END; + IF exp = 0 THEN z := EinsCCM; - REPEAT - IF exp MOD 2 = 1 THEN - MulCCM(z, tmp, z); - END; - exp := exp DIV 2; - MulCCM(tmp, tmp, tmp); - UNTIL exp < 1; - END PowerCCM; + RETURN; + END; + IF exp = 1 THEN + z := x; + RETURN; + END; - PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); - (* creates a random element out of CC(M) depending on mode which - can be reg, sing or random; - the result is in any case different from the zero *) + (* default case; use a "square and multiply" technique *) + tmp := x; + z := EinsCCM; + REPEAT + IF exp MOD 2 = 1 THEN + MulCCM(z, tmp, z); + END; + exp := exp DIV 2; + MulCCM(tmp, tmp, tmp); + UNTIL exp < 1; + END PowerCCM; + + PROCEDURE CreateCCM (VAR x: CCMElement; mode: SHORTINT); + (* creates a random element out of CC(M) depending on mode which + can be reg, sing or random; + the result is in any case different from the zero *) + VAR + i, SetBits: SHORTINT; + BEGIN + x := NullCCM; + REPEAT + i := 0; + SetBits := 0; + REPEAT + IF Random.Flip() THEN + (* set bit *) + x := x + {i}; + INC(SetBits); + END; + INC(i); + UNTIL i >= (M-1); + UNTIL SetBits > 0; (* at least one bit must be set so that the result + differs from zero *) + + CASE mode OF + random: + IF Random.Flip() THEN + x := x + {M-1}; + END; + | sing: (* singular element - even # of bits *) + IF (SetBits MOD 2) = 1 THEN + x := x + {M-1}; + END; + | reg: (* regular element - odd # of bits *) + IF ((SetBits + 1) MOD 2) = 1 THEN + x := x + {M-1}; + END; + ELSE + END; + END CreateCCM; + + (* ***** arithmetic functions for polynomials over CC(M) ***** *) + + PROCEDURE LengthPolynom(p: Polynom) : INTEGER; + (* returns the number of terms which make up the polynomial p *) + VAR + i : INTEGER; + BEGIN + i := 0; + WHILE p # NIL DO + INC(i); + p := p.next; + END; + RETURN i; + END LengthPolynom; + + PROCEDURE RegulaerPolynom (p: Polynom) : BOOLEAN; + (* tests the regularity of a polynomial [a polynomial is regular + iff the # of regular coefficients is odd] *) + VAR + regkoeffs : SHORTINT; + BEGIN + regkoeffs := 0; + WHILE p # NIL DO + IF RegulaerCCM(p.koeff) THEN + (* count # of reg. coefficients *) + INC(regkoeffs); + END; + p := p.next; + END; + RETURN (regkoeffs MOD 2) = 1; + END RegulaerPolynom; + + PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; + (* compares two exponent vectors and returns 0 on equality, a + positive value if exp1>exp2 and a negative value if exp1 e2 THEN + cmp := 1; diff := TRUE; + END; + END; + INC(i); + UNTIL i >= MaxVar; + + IF sum1 < sum2 THEN + RETURN -2; + END; + IF sum1 > sum2 THEN + RETURN 2; + END; + + RETURN cmp + END CmpExp; + + PROCEDURE ArrangePolynom (VAR p: Polynom); + (* arrange a polynomial according to the order given by CmpExp *) + VAR + r : Polynom; + cnt : INTEGER; + + PROCEDURE SortPolynom(left, right: INTEGER); + (* sort the global field PolFeld with the quicksort algorithm *) VAR - i, SetBits: SHORTINT; - BEGIN - x := NullCCM; - REPEAT - i := 0; - SetBits := 0; - REPEAT - IF Random.Flip() THEN - (* set bit *) - x := x + {i}; - INC(SetBits); - END; - INC(i); - UNTIL i >= (M-1); - UNTIL SetBits > 0; (* at least one bit must be set so that the result - differs from zero *) + mid : INTEGER; - CASE mode OF - random: - IF Random.Flip() THEN - x := x + {M-1}; - END; - | sing: (* singular element - even # of bits *) - IF (SetBits MOD 2) = 1 THEN - x := x + {M-1}; - END; - | reg: (* regular element - odd # of bits *) - IF ((SetBits + 1) MOD 2) = 1 THEN - x := x + {M-1}; - END; + PROCEDURE Partition(l, r: INTEGER) : INTEGER; + VAR + koeff : CCMElement; + exp : Exponent; + cmp : Exponent; + i, j : INTEGER; + BEGIN + cmp := PolFeld[(l+r) DIV 2].exp; + i := l-1; + j := r+1; + LOOP + REPEAT + DEC(j); + UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; + REPEAT + INC(i); + UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; + IF i < j THEN + koeff := PolFeld[i].koeff; + exp := PolFeld[i].exp; + PolFeld[i].koeff := PolFeld[j].koeff; + PolFeld[i].exp := PolFeld[j].exp; + PolFeld[j].koeff := koeff; + PolFeld[j].exp := exp; + ELSE + RETURN j; + END; + END; + END Partition; + + BEGIN + IF left < right THEN + mid := Partition(left, right); + SortPolynom(left, mid); + SortPolynom(mid+1, right); + END; + END SortPolynom; + + BEGIN (* ArrangePolynom *) + IF p = NIL THEN + RETURN; + END; + r := p; + cnt := 0; + WHILE (p # NIL) & (cnt < MaxTerms) DO + PolFeld[cnt] := p; + INC(cnt); + p := p.next; + END; + (* polynomial contains too many terms; this shouldn't happen if all + parameters are set to reasonable values and MaxTerms is high + enough *) + ASSERT(cnt 1 THEN + SortPolynom(0, cnt-1); + END; + p := r; + END ArrangePolynom; + + PROCEDURE CopyPolynom (s: Polynom; VAR t: Polynom); + (* copy the source polynomial s to a new target t *) + VAR + troot : Polynom; + BEGIN + IF s = NIL THEN + t := NIL; + RETURN; + END; + NEW(t); + troot := t; (* save the root of t *) + WHILE s # NIL DO + troot.koeff := s.koeff; + troot.exp := s.exp; + s := s.next; + IF s # NIL THEN + NEW(troot.next); + troot := troot.next; ELSE + troot.next := NIL; END; - END CreateCCM; + END; + END CopyPolynom; - (* ***** arithmetic functions for polynomials over CC(M) ***** *) - - PROCEDURE LengthPolynom(p: Polynom) : INTEGER; - (* returns the number of terms which make up the polynomial p *) - VAR - i : INTEGER; - BEGIN - i := 0; - WHILE p # NIL DO - INC(i); - p := p.next; - END; - RETURN i; - END LengthPolynom; - - PROCEDURE RegulaerPolynom (p: Polynom) : BOOLEAN; - (* tests the regularity of a polynomial [a polynomial is regular - iff the # of regular coefficients is odd] *) - VAR - regkoeffs : SHORTINT; - BEGIN - regkoeffs := 0; - WHILE p # NIL DO - IF RegulaerCCM(p.koeff) THEN - (* count # of reg. coefficients *) - INC(regkoeffs); - END; - p := p.next; - END; - RETURN (regkoeffs MOD 2) = 1; - END RegulaerPolynom; - - PROCEDURE CmpExp (exp1, exp2: Exponent) : SHORTINT; - (* compares two exponent vectors and returns 0 on equality, a - positive value if exp1>exp2 and a negative value if exp1 e2 THEN - cmp := 1; diff := TRUE; - END; - END; - INC(i); - UNTIL i >= MaxVar; - - IF sum1 < sum2 THEN - RETURN -2; - END; - IF sum1 > sum2 THEN - RETURN 2; - END; - - RETURN cmp - END CmpExp; - - PROCEDURE ArrangePolynom (VAR p: Polynom); - (* arrange a polynomial according to the order given by CmpExp *) - VAR - r : Polynom; - cnt : INTEGER; - - PROCEDURE SortPolynom(left, right: INTEGER); - (* sort the global field PolFeld with the quicksort algorithm *) - VAR - mid : INTEGER; - - PROCEDURE Partition(l, r: INTEGER) : INTEGER; - VAR - koeff : CCMElement; - exp : Exponent; - cmp : Exponent; - i, j : INTEGER; - BEGIN - cmp := PolFeld[(l+r) DIV 2].exp; - i := l-1; - j := r+1; - LOOP - REPEAT - DEC(j); - UNTIL CmpExp(PolFeld[j].exp, cmp) >= 0; - REPEAT - INC(i); - UNTIL CmpExp(PolFeld[i].exp, cmp) <= 0; - IF i < j THEN - koeff := PolFeld[i].koeff; - exp := PolFeld[i].exp; - PolFeld[i].koeff := PolFeld[j].koeff; - PolFeld[i].exp := PolFeld[j].exp; - PolFeld[j].koeff := koeff; - PolFeld[j].exp := exp; - ELSE - RETURN j; - END; - END; - END Partition; - - BEGIN - IF left < right THEN - mid := Partition(left, right); - SortPolynom(left, mid); - SortPolynom(mid+1, right); - END; - END SortPolynom; - - BEGIN (* ArrangePolynom *) - IF p = NIL THEN - RETURN; - END; - r := p; - cnt := 0; - WHILE (p # NIL) & (cnt < MaxTerms) DO - PolFeld[cnt] := p; - INC(cnt); - p := p.next; - END; - (* polynomial contains too many terms; this shouldn't happen if all - parameters are set to reasonable values and MaxTerms is high - enough *) - ASSERT(cnt 1 THEN - SortPolynom(0, cnt-1); - END; - p := r; - END ArrangePolynom; - - PROCEDURE CopyPolynom (s: Polynom; VAR t: Polynom); - (* copy the source polynomial s to a new target t *) - VAR - troot : Polynom; - BEGIN - IF s = NIL THEN - t := NIL; - RETURN; - END; - NEW(t); - troot := t; (* save the root of t *) - WHILE s # NIL DO - troot.koeff := s.koeff; - troot.exp := s.exp; - s := s.next; - IF s # NIL THEN - NEW(troot.next); - troot := troot.next; - ELSE - troot.next := NIL; - END; - END; - END CopyPolynom; - - PROCEDURE AddPolynom (p, q: Polynom; VAR r: Polynom); - (* add two polynomial; the polynomials must be sorted by the exponents as - is the result *) - VAR - term1, term2 : Polynom; - last : Polynom; (* the last term of the result *) - tmp : Polynom; - cmpres : SHORTINT; - BEGIN - IF (p = NIL) & (q = NIL) THEN - r := NIL; - RETURN; - END; - NEW(r); - term1 := p; (* term1 runs through all terms of p *) - term2 := q; (* same with term2 for q *) - tmp := r; (* save the root of r *) - last := tmp; - REPEAT - IF (term1 = NIL) OR (term2 = NIL) THEN - IF term2 = NIL THEN - (* no further terms in q *) - WHILE term1 # NIL DO - (* copy the remaining terms of p *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - ELSE (* no further terms in p *) - WHILE term2 # NIL DO - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - last := tmp; - NEW(tmp.next); - tmp := tmp.next; - END; - END; - END; - ELSE (* both p and q still have a term *) - cmpres := CmpExp(term1.exp, term2.exp); - IF cmpres = 0 THEN (* add when exponents are equal *) - AddCCM(term1.koeff, term2.koeff, tmp.koeff); - tmp.exp := term1.exp; - term1 := term1.next; - term2 := term2.next; - ELSE - IF cmpres < 0 THEN (* exp2 > exp1 *) - tmp.koeff := term2.koeff; - tmp.exp := term2.exp; - term2 := term2.next; - ELSE (* exp1 > exp2 *) - tmp.koeff := term1.koeff; - tmp.exp := term1.exp; - term1 := term1.next; - END; - END; - (* zero coefficients = zero terms shouldn't occur in the result *) - IF ~EqualCCM(tmp.koeff, NullCCM) THEN - NEW(tmp.next); - last := tmp; - tmp := tmp.next; - END; - END; - UNTIL (term1 = NIL) & (term2 = NIL); - - (* forget last created term *) - last.next := NIL; - END AddPolynom; - - PROCEDURE MulTerm (p, term: Polynom; VAR r: Polynom); - (* multiply a polynomial with a single term; is used by MulPolynom *) - VAR - tmp : Polynom; - last : Polynom; - - (* add two exponent vetors; addition is modulo M *) - PROCEDURE AddExp (exp1, exp2 : Exponent; VAR res: Exponent); - VAR - i : SHORTINT; - BEGIN - i := 0; - WHILE i exp1 *) + tmp.koeff := term2.koeff; + tmp.exp := term2.exp; + term2 := term2.next; + ELSE (* exp1 > exp2 *) + tmp.koeff := term1.koeff; + tmp.exp := term1.exp; + term1 := term1.next; + END; + END; + (* zero coefficients = zero terms shouldn't occur in the result *) + IF ~EqualCCM(tmp.koeff, NullCCM) THEN + NEW(tmp.next); + last := tmp; + tmp := tmp.next; + END; END; - qterm := q; - WHILE qterm # NIL DO - MulTerm(p,qterm,tmp); (* multiply p with current term of q *) - AddPolynom(tmp,r,r); (* add up results *) - qterm := qterm.next; - END; - ArrangePolynom(r); - END MulPolynom; + UNTIL (term1 = NIL) & (term2 = NIL); - PROCEDURE MulPolynomWithCCM (p: Polynom; c: CCMElement; VAR r: Polynom); - (* multiplies a polynomial with a single element out of CC(M) *) - VAR - tmp : Polynom; - BEGIN - IF p = NIL THEN - r := NIL; - RETURN; - END; - CopyPolynom(p, r); - tmp := r; - WHILE tmp # NIL DO - MulCCM(tmp.koeff, c, tmp.koeff); - tmp := tmp.next; - END; - END MulPolynomWithCCM; + (* forget last created term *) + last.next := NIL; + END AddPolynom; - PROCEDURE InvertPolynom (p: Polynom; VAR res: Polynom); - (* inverts a regular polynomial; if p is illegal (NIL) or singular the - result is NIL *) - VAR - exp : SHORTINT; - tmp : Polynom; - BEGIN - IF (p = NIL) OR ~RegulaerPolynom(p) THEN - res := NIL; - RETURN; - END; - CopyPolynom(p, tmp); - CopyPolynom(NullPolynom, res); - res.koeff := EinsCCM; - (* works the same way as PowerCCM ["square-and-multiply"] *) - exp := M - 1; (* inverse means "power M-1" *) - WHILE exp > 0 DO - IF (exp MOD 2) = 1 THEN - MulPolynom(res, tmp, res); - END; - MulPolynom(tmp, tmp, tmp); - exp := exp DIV 2; - END; - END InvertPolynom; + PROCEDURE MulTerm (p, term: Polynom; VAR r: Polynom); + (* multiply a polynomial with a single term; is used by MulPolynom *) + VAR + tmp : Polynom; + last : Polynom; - PROCEDURE EvalPolynom (p: Polynom; VAR res: CCMElement); - (* evaluate p; a precomputed list of all the powers of the argument can - be found in the global variable PreEvalArg *) + (* add two exponent vetors; addition is modulo M *) + PROCEDURE AddExp (exp1, exp2 : Exponent; VAR res: Exponent); VAR - i : SHORTINT; - pow, prod : CCMElement; - BEGIN - res := NullCCM; - IF p = NIL THEN - RETURN; - END; - WHILE p # NIL DO - prod := PreEvalArg[p.exp[0]].arg[0]; - i := 1; - REPEAT - pow := PreEvalArg[p.exp[i]].arg[i]; - MulCCM(prod, pow, prod); - INC(i); - UNTIL i >= MaxVar; - MulCCM(prod, p.koeff, prod); - AddCCM(res, prod, res); - p := p.next; - END; - END EvalPolynom; - - PROCEDURE CreateExp (VAR exp: Exponent); - (* creates a random vector of exponents *) - VAR - i : SHORTINT; - BEGIN + i : SHORTINT; + BEGIN i := 0; WHILE i 0 DO + IF (exp MOD 2) = 1 THEN + MulPolynom(res, tmp, res); END; + MulPolynom(tmp, tmp, tmp); + exp := exp DIV 2; + END; + END InvertPolynom; - NEW(p); - proot := p; (* save root of p *) - regkoeffs := 0; (* # of regular coeff. in p *) - i := 0; - WHILE i= MaxVar; + MulCCM(prod, p.koeff, prod); + AddCCM(res, prod, res); + p := p.next; + END; + END EvalPolynom; - (* the last term must be created manually so that the result is - regular/singular (depending on mode) *) - IF i # terms THEN - CreateCCM(p.koeff, random); - IF RegulaerCCM(p.koeff) THEN - INC(regkoeffs); - END; - NEW(p.next); - p := p.next; - END; + PROCEDURE CreateExp (VAR exp: Exponent); + (* creates a random vector of exponents *) + VAR + i : SHORTINT; + BEGIN + i := 0; + WHILE i 0 DO + IF (kk MOD 2) = 1 THEN + MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); + END; + INC(ii,ii); + kk := kk DIV 2; + END; + PreEvalArg[k].arg[i] := tmp; + INC(k); + END; + INC(i); + END; + END PreComputeArgs; - (* E(n), n=1,...,Rounds, und sigma := psi *) - NEW(psi); - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - psi.initialmatrix[dy][dx] := E[0][dy][dx].koeff; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - psi.korrNum[r][d] := korrNum[r][d]; - INC(d); - END; - psi.korrDenom[r] := korrDenom[r]; - INC(r); + PROCEDURE EvaluatePhi (arg: TCryptInput; data: Phi) : TCryptTmp; + (* evaluate the public function phi (represented by data) with + argument arg *) + VAR + res : TCryptTmp; + r, d : SHORTINT; + BEGIN + NEW(res); + PreComputeArgs(arg); + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + EvalPolynom(data.num[r][d], res.numerator[r][d]); + INC(d); END; + EvalPolynom(data.denom[r], res.denominator[r]); + INC(r); + END; + RETURN res; + END EvaluatePhi; - (* A(Rounds) := eta *) - NEW(eta); - r := 0; - idx := Rounds - LastRounds; - WHILE idx < Rounds DO - d := 0; - WHILE d < Dim DO - CopyPolynom(A[idx][d], eta.p[r][d]); - INC(d); - END; - INC(r); - INC(idx); - END; - END CreateMaps; - - PROCEDURE PreComputeArgs(arg: TCryptInput); - (* used for preevaluation of a polynomial argument *) - VAR - k, i, kk, ii : INTEGER; - tmp : CCMElement; - BEGIN - i := 0; - WHILE i < MaxVar DO - PreEvalArg[1].arg[i] := arg.arg[i]; - INC(i); - END; - i := 0; - WHILE i < MaxVar DO - k := 2; - tmp := arg.arg[i]; - WHILE k < M DO - MulCCM(tmp, tmp, tmp); - PreEvalArg[k].arg[i] := tmp; - INC(k,k); - END; - k := 3; - WHILE k < M DO - kk := k; - ii := 1; - tmp := EinsCCM; - WHILE kk > 0 DO - IF (kk MOD 2) = 1 THEN - MulCCM(tmp, PreEvalArg[ii].arg[i], tmp); - END; - INC(ii,ii); - kk := kk DIV 2; - END; - PreEvalArg[k].arg[i] := tmp; - INC(k); - END; - INC(i); - END; - END PreComputeArgs; - - PROCEDURE EvaluatePhi (arg: TCryptInput; data: Phi) : TCryptTmp; - (* evaluate the public function phi (represented by data) with - argument arg *) - VAR - res : TCryptTmp; - r, d : SHORTINT; - BEGIN - NEW(res); - PreComputeArgs(arg); - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.num[r][d], res.numerator[r][d]); - INC(d); - END; - EvalPolynom(data.denom[r], res.denominator[r]); - INC(r); - END; - RETURN res; - END EvaluatePhi; - - PROCEDURE EvaluatePsi (arg: TCryptTmp; data: Psi) : TCryptRes; - (* evalute the private function psi *) - VAR - res : TCryptRes; - mat, prev : MatCCM; - num, denom, inv : CCMElement; - vek : VektorCCM; - A : ChainCCM; - r, d : SHORTINT; - BEGIN - (* first correct the input with the correlating inverts *) - MulCCM(arg.denominator[0], data.korrDenom[0], denom); + PROCEDURE EvaluatePsi (arg: TCryptTmp; data: Psi) : TCryptRes; + (* evalute the private function psi *) + VAR + res : TCryptRes; + mat, prev : MatCCM; + num, denom, inv : CCMElement; + vek : VektorCCM; + A : ChainCCM; + r, d : SHORTINT; + BEGIN + (* first correct the input with the correlating inverts *) + MulCCM(arg.denominator[0], data.korrDenom[0], denom); + PowerCCM(denom, M-1, inv); + MulCCM(arg.numerator[0][0], data.korrNum[0][0], num); + MulCCM(num, inv, vek[0]); + MulCCM(arg.numerator[0][1], data.korrNum[0][1], num); + MulCCM(num, inv, vek[1]); + MulMatrix(data.initialmatrix, vek, A[0]); + prev := data.initialmatrix; + r := 1; + WHILE r < Rounds DO + (* the matrix for the current round of the recursion must be computed + each round *) + BuildMatrix(mat, prev, A[r-1]); + prev := mat; + MulCCM(arg.denominator[r], data.korrDenom[r], denom); PowerCCM(denom, M-1, inv); - MulCCM(arg.numerator[0][0], data.korrNum[0][0], num); + MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); MulCCM(num, inv, vek[0]); - MulCCM(arg.numerator[0][1], data.korrNum[0][1], num); + MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); MulCCM(num, inv, vek[1]); - MulMatrix(data.initialmatrix, vek, A[0]); - prev := data.initialmatrix; - r := 1; - WHILE r < Rounds DO - (* the matrix for the current round of the recursion must be computed - each round *) - BuildMatrix(mat, prev, A[r-1]); - prev := mat; - MulCCM(arg.denominator[r], data.korrDenom[r], denom); - PowerCCM(denom, M-1, inv); - MulCCM(arg.numerator[r][0], data.korrNum[r][0], num); - MulCCM(num, inv, vek[0]); - MulCCM(arg.numerator[r][1], data.korrNum[r][1], num); - MulCCM(num, inv, vek[1]); - MulMatrix(mat, vek, A[r]); - INC(r); + MulMatrix(mat, vek, A[r]); + INC(r); + END; + NEW(res); + r := 0; + WHILE r < LastRounds DO + d := 0; + WHILE d < Dim DO + res.arg[r][d] := A[Rounds-LastRounds+r][d]; + INC(d); END; - NEW(res); - r := 0; - WHILE r < LastRounds DO - d := 0; - WHILE d < Dim DO - res.arg[r][d] := A[Rounds-LastRounds+r][d]; - INC(d); - END; - INC(r); - END; - RETURN res; - END EvaluatePsi; + INC(r); + END; + RETURN res; + END EvaluatePsi; - PROCEDURE EvaluateEta (arg: TCryptInput; data: Eta) : TCryptRes; - (* evaluate the public function eta (composition of phi and psi) *) - VAR - l, d : SHORTINT; - res : TCryptRes; - BEGIN - NEW(res); - PreComputeArgs(arg); - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - EvalPolynom(data.p[l][d], res.arg[l][d]); - INC(d); - END; - INC(l); + PROCEDURE EvaluateEta (arg: TCryptInput; data: Eta) : TCryptRes; + (* evaluate the public function eta (composition of phi and psi) *) + VAR + l, d : SHORTINT; + res : TCryptRes; + BEGIN + NEW(res); + PreComputeArgs(arg); + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + EvalPolynom(data.p[l][d], res.arg[l][d]); + INC(d); END; - RETURN res; - END EvaluateEta; + INC(l); + END; + RETURN res; + END EvaluateEta; - PROCEDURE Eof (s: Streams.Stream) : BOOLEAN; - (* returns TRUE if no bytes are left to read from stream s *) - VAR - b : SYS.BYTE; - BEGIN - RETURN ~Streams.ReadByte(s, b) OR ~Streams.Back(s); - END Eof; + PROCEDURE Eof (s: Streams.Stream) : BOOLEAN; + (* returns TRUE if no bytes are left to read from stream s *) + VAR + b : SYS.BYTE; + BEGIN + RETURN ~Streams.ReadByte(s, b) OR ~Streams.Back(s); + END Eof; - PROCEDURE Encrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for Ciphers.Encrypt *) - VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptTmp; - wholeStream : BOOLEAN; - BEGIN - (* check if the whole stream msg shall be encrypted or only a certain - amount of bytes *) - IF length <= 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE - END; - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - IF ~RegulaerCCM(ccmarg.arg[i]) THEN - Error(msg, notRegular); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); - ELSE - ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); - END; - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(i); - END; - DEC(length, MaxVar*(M DIV 8)); - END; - RETURN TRUE; - END Encrypt; - - PROCEDURE Decrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for Ciphers.Decrypt *) - VAR - i, j : SHORTINT; - inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; - ccmarg : TCryptTmp; - ccmres : TCryptRes; - wholeStream : BOOLEAN; - BEGIN - IF length < 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE; - END; - WITH key:PrivateCipher DO - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < Rounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(j); - END; - IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - ccmres := EvaluatePsi(ccmarg, key.psi); - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, Rounds*Dim*(M DIV 8)); - END; - END; - RETURN TRUE; - END Decrypt; - - PROCEDURE ComposedEncrypt (msg: Streams.Stream; key: Ciphers.Cipher; - length: INTEGER; s: Streams.Stream) : BOOLEAN; - (* interface procedure for AsymmetricCiphers.ComposedEncrypt *) - VAR - i, j : SHORTINT; - ccmarg : TCryptInput; - ccmres : TCryptRes; - in, out : ARRAY (M DIV 8) OF SYS.BYTE; - wholeStream : BOOLEAN; - BEGIN - IF length < 0 THEN - wholeStream := TRUE; - ELSE - wholeStream := FALSE; - END; - NEW(ccmarg); - WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN - Error(msg, readSetFailed); - RETURN FALSE; - END; - INC(i); - END; - IF key IS PublicCipher THEN - ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); - ELSE - ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); - END; - i := 0; - WHILE i < LastRounds DO - j := 0; - WHILE j < Dim DO - IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN - Error(s, writeSetFailed); - RETURN FALSE; - END; - INC(j); - END; - INC(i); - END; - DEC (length, MaxVar*(M DIV 8)); - END; - RETURN TRUE; - END ComposedEncrypt; - - PROCEDURE RandomStream (s: Streams.Stream); - (* writes some random elements of CC(M) to the stream s which can then - be used as an input for Trautner's TCRYPT *) - VAR - ccm : CCMElement; - bytes : ARRAY M DIV 8 OF SYS.BYTE; - i : INTEGER; - BEGIN + PROCEDURE Encrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for Ciphers.Encrypt *) + VAR + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptTmp; + wholeStream : BOOLEAN; + BEGIN + (* check if the whole stream msg shall be encrypted or only a certain + amount of bytes *) + IF length <= 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE + END; + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO i := 0; WHILE i < MaxVar DO - CreateCCM(ccm, reg); - IF ~NetIO.WriteSet(s, ccm) THEN + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + IF ~RegulaerCCM(ccmarg.arg[i]) THEN + Error(msg, notRegular); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluatePhi(ccmarg, key(PublicCipher).phi); + ELSE + ccmres := EvaluatePhi(ccmarg, key(PrivateCipher).phi); + END; + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.numerator[i][j]) THEN Error(s, writeSetFailed); - END; - INC(i); - END; - END RandomStream; - - PROCEDURE PublicCipherCreate (VAR obj: PersistentObjects.Object); - (* constructor for a public cipher *) - VAR - pub : PublicCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; - BEGIN - NEW(pub); NEW(pub.phi); NEW(pub.eta); - PersistentObjects.Init(pub, pubType); - NEW(if); if.encrypt := Encrypt; if.decrypt := NIL; - if.compencrypt := ComposedEncrypt; if.split := NIL; - if.randomStream := RandomStream; - caps := {AsymmetricCiphers.composed}; - AsymmetricCiphers.Init(pub, if, caps, M*MaxVar, M*Dim); - obj := pub; - END PublicCipherCreate; - - PROCEDURE Split (VAR public: AsymmetricCiphers.Cipher; - key: AsymmetricCiphers.Cipher); - (* interface procedure for asymmetric interface *) - VAR - pub: PublicCipher; - BEGIN - WITH key:PrivateCipher DO - PublicCipherCreate(SYS.VAL(PersistentObjects.Object, pub)); - pub.phi := key.phi; - pub.eta := key.eta; - public := pub; - END; - END Split; - - PROCEDURE CipherCreate (VAR obj: PersistentObjects.Object); - (* constructor for a private cipher *) - VAR - key : PrivateCipher; - if : AsymmetricCiphers.Interface; - caps : AsymmetricCiphers.CapabilitySet; - BEGIN - NEW(key); NEW(key.phi); NEW(key.psi); NEW(key.eta); - PersistentObjects.Init(key, privType); - NEW(if); if.encrypt := Encrypt; if.decrypt := Decrypt; - if.compencrypt := ComposedEncrypt; if.split := Split; - if.randomStream := RandomStream; - caps := {AsymmetricCiphers.composed, AsymmetricCiphers.isPrivateKey}; - AsymmetricCiphers.Init(key, if, caps, M*MaxVar, M*Dim); - obj := key; - END CipherCreate; - - PROCEDURE Create* (VAR key: Ciphers.Cipher); - (* creates a cipher for the use with Trautner's TCRYPT algorithm *) - VAR - tmpKey : PrivateCipher; - phi : Phi; - psi : Psi; - eta : Eta; - BEGIN - CipherCreate(SYS.VAL(PersistentObjects.Object, tmpKey)); - CreateMaps(tmpKey.phi, tmpKey.psi, tmpKey.eta); - key := tmpKey; - END Create; - - PROCEDURE WritePolynom (s: Streams.Stream; p: Polynom) : BOOLEAN; - (* writes the polynomial p onto the stream s *) - CONST - index = M DIV 8; - VAR - nrOfTerms, i : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - nrOfTerms := LengthPolynom(p); - IF ~NetIO.WriteInteger(s, nrOfTerms) THEN - RETURN FALSE; - END; - WHILE nrOfTerms > 0 DO - IF ~NetIO.WriteSet(s, p.koeff) THEN RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN - RETURN FALSE; - END; - INC(i); - END; - p := p.next; - DEC(nrOfTerms); + END; + INC(j); + END; + IF ~NetIO.WriteSet(s, ccmres.denominator[i]) THEN + Error(s, writeSetFailed); + RETURN FALSE; + END; + INC(i); END; - RETURN TRUE; - END WritePolynom; + DEC(length, MaxVar*(M DIV 8)); + END; + RETURN TRUE; + END Encrypt; - PROCEDURE ReadPolynom (s: Streams.Stream; VAR p: Polynom) : BOOLEAN; - (* reads a polynomial from stream s *) - CONST - index = M DIV 8; - VAR - nrOfTerms, i : INTEGER; - pol : Polynom; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - IF ~NetIO.ReadInteger(s, nrOfTerms) THEN - RETURN FALSE; - END; - NEW(p); - pol := p; - WHILE nrOfTerms > 0 DO - IF ~NetIO.ReadSet(s, pol.koeff) THEN + PROCEDURE Decrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for Ciphers.Decrypt *) + VAR + i, j : SHORTINT; + inNum, inDenom, out : ARRAY (M DIV 8) OF SYS.BYTE; + ccmarg : TCryptTmp; + ccmres : TCryptRes; + wholeStream : BOOLEAN; + BEGIN + IF length < 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE; + END; + WITH key:PrivateCipher DO + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO + i := 0; + WHILE i < Rounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.ReadSet(msg, ccmarg.numerator[i][j]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(j); + END; + IF ~NetIO.ReadSet(msg, ccmarg.denominator[i]) THEN + Error(msg, readSetFailed); RETURN FALSE; - END; - i := 0; - WHILE i < MaxVar DO - IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN - RETURN FALSE; + END; + INC(i); + END; + ccmres := EvaluatePsi(ccmarg, key.psi); + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); + RETURN FALSE; END; - INC(i); - END; - DEC(nrOfTerms); - IF nrOfTerms > 0 THEN - NEW(pol.next); - pol := pol.next; - END + INC(j); + END; + INC(i); + END; + DEC (length, Rounds*Dim*(M DIV 8)); END; - RETURN TRUE; - END ReadPolynom; + END; + RETURN TRUE; + END Decrypt; - PROCEDURE PhiWrite (s: Streams.Stream; data: Phi) : BOOLEAN; - (* writes the data structure for the public function phi onto a stream *) - VAR - r, d, k : INTEGER; - BEGIN - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~WritePolynom(s, data.denom[r]) THEN + PROCEDURE ComposedEncrypt (msg: Streams.Stream; key: Ciphers.Cipher; + length: INTEGER; s: Streams.Stream) : BOOLEAN; + (* interface procedure for AsymmetricCiphers.ComposedEncrypt *) + VAR + i, j : SHORTINT; + ccmarg : TCryptInput; + ccmres : TCryptRes; + in, out : ARRAY (M DIV 8) OF SYS.BYTE; + wholeStream : BOOLEAN; + BEGIN + IF length < 0 THEN + wholeStream := TRUE; + ELSE + wholeStream := FALSE; + END; + NEW(ccmarg); + WHILE ~Eof(msg) & (wholeStream OR (length > 0)) DO + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadSet(msg, ccmarg.arg[i]) THEN + Error(msg, readSetFailed); + RETURN FALSE; + END; + INC(i); + END; + IF key IS PublicCipher THEN + ccmres := EvaluateEta(ccmarg, key(PublicCipher).eta); + ELSE + ccmres := EvaluateEta(ccmarg, key(PrivateCipher).eta); + END; + i := 0; + WHILE i < LastRounds DO + j := 0; + WHILE j < Dim DO + IF ~NetIO.WriteSet(s, ccmres.arg[i][j]) THEN + Error(s, writeSetFailed); RETURN FALSE; - END; - INC(r); + END; + INC(j); + END; + INC(i); END; - RETURN TRUE; - END PhiWrite; + DEC (length, MaxVar*(M DIV 8)); + END; + RETURN TRUE; + END ComposedEncrypt; - PROCEDURE PhiRead (s: Streams.Stream; VAR data: Phi) : BOOLEAN; - (* reads the data structure for the public function phi from a stream *) - VAR - r, d, k : INTEGER; - BEGIN - NEW(data); - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.num[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~ReadPolynom(s, data.denom[r]) THEN - RETURN FALSE; - END; - INC(r); + PROCEDURE RandomStream (s: Streams.Stream); + (* writes some random elements of CC(M) to the stream s which can then + be used as an input for Trautner's TCRYPT *) + VAR + ccm : CCMElement; + bytes : ARRAY M DIV 8 OF SYS.BYTE; + i : INTEGER; + BEGIN + i := 0; + WHILE i < MaxVar DO + CreateCCM(ccm, reg); + IF ~NetIO.WriteSet(s, ccm) THEN + Error(s, writeSetFailed); END; - RETURN TRUE; - END PhiRead; + INC(i); + END; + END RandomStream; - PROCEDURE PsiWrite (s: Streams.Stream; data: Psi) : BOOLEAN; - (* writes the data structure for the private function psi onto a stream *) - CONST - index = M DIV 8; - VAR - dx, dy, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); - END; - RETURN TRUE; - END PsiWrite; + PROCEDURE PublicCipherCreate (VAR obj: PersistentObjects.Object); + (* constructor for a public cipher *) + VAR + pub : PublicCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; + BEGIN + NEW(pub); NEW(pub.phi); NEW(pub.eta); + PersistentObjects.Init(pub, pubType); + NEW(if); if.encrypt := Encrypt; if.decrypt := NIL; + if.compencrypt := ComposedEncrypt; if.split := NIL; + if.randomStream := RandomStream; + caps := {AsymmetricCiphers.composed}; + AsymmetricCiphers.Init(pub, if, caps, M*MaxVar, M*Dim); + obj := pub; + END PublicCipherCreate; - PROCEDURE PsiRead (s: Streams.Stream; VAR data: Psi) : BOOLEAN; - (* reads the data structure for the private function psi from a stream *) - CONST - index = M DIV 8; - VAR - dy, dx, r, d : INTEGER; - bytes : ARRAY index OF SYS.BYTE; - BEGIN - dy := 0; - WHILE dy < Dim DO - dx := 0; - WHILE dx < Dim DO - IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN - RETURN FALSE; - END; - INC(dx); - END; - INC(dy); - END; - r := 0; - WHILE r < Rounds DO - d := 0; - WHILE d < Dim DO - IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN - RETURN FALSE; - END; - INC(r); - END; - RETURN TRUE; - END PsiRead; + PROCEDURE Split (VAR public: AsymmetricCiphers.Cipher; + key: AsymmetricCiphers.Cipher); + (* interface procedure for asymmetric interface *) + VAR + pub: PublicCipher; + obj: PersistentObjects.Object; + BEGIN + WITH key:PrivateCipher DO + PublicCipherCreate(obj); pub := obj(PublicCipher); + pub.phi := key.phi; + pub.eta := key.eta; + public := pub; + END; + END Split; - PROCEDURE EtaWrite (s: Streams.Stream; data: Eta) : BOOLEAN; - (* writes the data structure for the public function eta onto a stream *) - VAR - l, d : INTEGER; - BEGIN - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~WritePolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); - END; - RETURN TRUE; - END EtaWrite; + PROCEDURE CipherCreate (VAR obj: PersistentObjects.Object); + (* constructor for a private cipher *) + VAR + key : PrivateCipher; + if : AsymmetricCiphers.Interface; + caps : AsymmetricCiphers.CapabilitySet; + BEGIN + NEW(key); NEW(key.phi); NEW(key.psi); NEW(key.eta); + PersistentObjects.Init(key, privType); + NEW(if); if.encrypt := Encrypt; if.decrypt := Decrypt; + if.compencrypt := ComposedEncrypt; if.split := Split; + if.randomStream := RandomStream; + caps := {AsymmetricCiphers.composed, AsymmetricCiphers.isPrivateKey}; + AsymmetricCiphers.Init(key, if, caps, M*MaxVar, M*Dim); + obj := key; + END CipherCreate; - PROCEDURE EtaRead (s: Streams.Stream; VAR data: Eta) : BOOLEAN; - (* reads the data structure for the public function eta from a stream *) - VAR - l, d : INTEGER; - BEGIN - NEW(data); - l := 0; - WHILE l < LastRounds DO - d := 0; - WHILE d < Dim DO - IF ~ReadPolynom(s, data.p[l][d]) THEN - RETURN FALSE; - END; - INC(d); - END; - INC(l); - END; - RETURN TRUE; - END EtaRead; + PROCEDURE Create* (VAR key: Ciphers.Cipher); + (* creates a cipher for the use with Trautner's TCRYPT algorithm *) + VAR + tmpKey : PrivateCipher; + obj : PersistentObjects.Object; + phi : Phi; + psi : Psi; + eta : Eta; + BEGIN + CipherCreate(obj); tmpKey := obj(PrivateCipher); + CreateMaps(tmpKey.phi, tmpKey.psi, tmpKey.eta); + key := tmpKey; + END Create; - PROCEDURE PubWrite (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PublicCipher DO - RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); + PROCEDURE WritePolynom (s: Streams.Stream; p: Polynom) : BOOLEAN; + (* writes the polynomial p onto the stream s *) + CONST + index = M DIV 8; + VAR + nrOfTerms, i : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + nrOfTerms := LengthPolynom(p); + IF ~NetIO.WriteInteger(s, nrOfTerms) THEN + RETURN FALSE; + END; + WHILE nrOfTerms > 0 DO + IF ~NetIO.WriteSet(s, p.koeff) THEN + RETURN FALSE; END; - END PubWrite; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.WriteShortInt(s, p.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + p := p.next; + DEC(nrOfTerms); + END; + RETURN TRUE; + END WritePolynom; - PROCEDURE CipherWrite (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PrivateCipher DO - RETURN PhiWrite(s, obj.phi) & - PsiWrite(s, obj.psi) & - EtaWrite(s, obj.eta); + PROCEDURE ReadPolynom (s: Streams.Stream; VAR p: Polynom) : BOOLEAN; + (* reads a polynomial from stream s *) + CONST + index = M DIV 8; + VAR + nrOfTerms, i : INTEGER; + pol : Polynom; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + IF ~NetIO.ReadInteger(s, nrOfTerms) THEN + RETURN FALSE; + END; + NEW(p); + pol := p; + WHILE nrOfTerms > 0 DO + IF ~NetIO.ReadSet(s, pol.koeff) THEN + RETURN FALSE; END; - END CipherWrite; + i := 0; + WHILE i < MaxVar DO + IF ~NetIO.ReadShortInt(s, pol.exp[i]) THEN + RETURN FALSE; + END; + INC(i); + END; + DEC(nrOfTerms); + IF nrOfTerms > 0 THEN + NEW(pol.next); + pol := pol.next; + END + END; + RETURN TRUE; + END ReadPolynom; - PROCEDURE PubRead (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PublicCipher DO - IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + PROCEDURE PhiWrite (s: Streams.Stream; data: Phi) : BOOLEAN; + (* writes the data structure for the public function phi onto a stream *) + VAR + r, d, k : INTEGER; + BEGIN + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); END; - RETURN TRUE; - END PubRead; + IF ~WritePolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PhiWrite; - PROCEDURE CipherRead (s: Streams.Stream; - obj: PersistentObjects.Object) : BOOLEAN; - (* interface procedure for PersistentObjects *) - BEGIN - WITH obj:PrivateCipher DO - IF ~PhiRead(s, obj.phi) OR - ~PsiRead(s, obj.psi) OR - ~EtaRead(s, obj.eta) THEN - RETURN FALSE; - END; + PROCEDURE PhiRead (s: Streams.Stream; VAR data: Phi) : BOOLEAN; + (* reads the data structure for the public function phi from a stream *) + VAR + r, d, k : INTEGER; + BEGIN + NEW(data); + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.num[r][d]) THEN + RETURN FALSE; + END; + INC(d); END; - RETURN TRUE; - END CipherRead; + IF ~ReadPolynom(s, data.denom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PhiRead; + + PROCEDURE PsiWrite (s: Streams.Stream; data: Psi) : BOOLEAN; + (* writes the data structure for the private function psi onto a stream *) + CONST + index = M DIV 8; + VAR + dx, dy, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + dy := 0; + WHILE dy < Dim DO + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.WriteSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); + END; + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~NetIO.WriteSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.WriteSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PsiWrite; + + PROCEDURE PsiRead (s: Streams.Stream; VAR data: Psi) : BOOLEAN; + (* reads the data structure for the private function psi from a stream *) + CONST + index = M DIV 8; + VAR + dy, dx, r, d : INTEGER; + bytes : ARRAY index OF SYS.BYTE; + BEGIN + dy := 0; + WHILE dy < Dim DO + dx := 0; + WHILE dx < Dim DO + IF ~NetIO.ReadSet(s, data.initialmatrix[dy][dx]) THEN + RETURN FALSE; + END; + INC(dx); + END; + INC(dy); + END; + r := 0; + WHILE r < Rounds DO + d := 0; + WHILE d < Dim DO + IF ~NetIO.ReadSet(s, data.korrNum[r][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + IF ~NetIO.ReadSet(s, data.korrDenom[r]) THEN + RETURN FALSE; + END; + INC(r); + END; + RETURN TRUE; + END PsiRead; + + PROCEDURE EtaWrite (s: Streams.Stream; data: Eta) : BOOLEAN; + (* writes the data structure for the public function eta onto a stream *) + VAR + l, d : INTEGER; + BEGIN + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + IF ~WritePolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); + END; + RETURN TRUE; + END EtaWrite; + + PROCEDURE EtaRead (s: Streams.Stream; VAR data: Eta) : BOOLEAN; + (* reads the data structure for the public function eta from a stream *) + VAR + l, d : INTEGER; + BEGIN + NEW(data); + l := 0; + WHILE l < LastRounds DO + d := 0; + WHILE d < Dim DO + IF ~ReadPolynom(s, data.p[l][d]) THEN + RETURN FALSE; + END; + INC(d); + END; + INC(l); + END; + RETURN TRUE; + END EtaRead; + + PROCEDURE PubWrite (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PublicCipher DO + RETURN PhiWrite(s, obj.phi) & EtaWrite(s, obj.eta); + END; + END PubWrite; + + PROCEDURE CipherWrite (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PrivateCipher DO + RETURN PhiWrite(s, obj.phi) & + PsiWrite(s, obj.psi) & + EtaWrite(s, obj.eta); + END; + END CipherWrite; + + PROCEDURE PubRead (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PublicCipher DO + IF ~PhiRead(s, obj.phi) OR ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; + END; + RETURN TRUE; + END PubRead; + + PROCEDURE CipherRead (s: Streams.Stream; + obj: PersistentObjects.Object) : BOOLEAN; + (* interface procedure for PersistentObjects *) + BEGIN + WITH obj:PrivateCipher DO + IF ~PhiRead(s, obj.phi) OR + ~PsiRead(s, obj.psi) OR + ~EtaRead(s, obj.eta) THEN + RETURN FALSE; + END; + END; + RETURN TRUE; + END CipherRead; BEGIN - (* init of the zero and unit of CC(M) *) - NullCCM := {}; - EinsCCM := {0}; + (* init of the zero and unit of CC(M) *) + NullCCM := {}; + EinsCCM := {0}; - (* init of the zero exponent *) - k := 0; - WHILE k Priorities.base THEN - desc.caps := desc.caps + {Conditions.select, Conditions.async}; - desc.internal := priorityOfClock < Priorities.interrupts; - END; - END; - NEW(domain); Conditions.InitDomain(domain, if, desc); - domain.clock := clock; - IF Clocks.timer IN Clocks.Capabilities(clock) THEN - Events.Define(domain.alarm); - Events.SetPriority(domain.alarm, priorityOfClock + 1); - Events.Handler(domain.alarm, Wakeup); - ELSE - domain.alarm := NIL; - END; - NEW(clockDisc); clockDisc.id := disciplineId; - clockDisc.domain := domain; - Disciplines.Add(clock, clockDisc); - domain.event := NIL; + TYPE + WakeupEvent = POINTER TO WakeupEventRec; + WakeupEventRec = + RECORD + (Events.EventRec) + condition: Condition; + awaked: BOOLEAN; (* set to true by Wakeup event handler *) END; - Conditions.Init(condition, domain); - FixTime(time, currentTime, clock); condition.time := time; - condition.domain := domain; - condition.passed := Clocks.Passed(clock, time); - condition.scheduled := FALSE; - IF ~condition.passed & - (domain.alarm # NIL) & (clock # Clocks.system) THEN - ScheduleEvent(condition); - END; - END Init; - PROCEDURE Create*(VAR condition: Conditions.Condition; - clock: Clocks.Clock; time: Times.Time); - (* create and initialize a time condition: - is the current time of the clock greater than or - equal to `time'; - if time is relative then it is taken relative to the current time - *) - VAR - timeCond: Condition; - BEGIN - NEW(timeCond); - Init(timeCond, clock, time); - condition := timeCond; - END Create; + VAR + if: Conditions.Interface; - (* ======== interface procedures ================================ *) - - PROCEDURE GetTime(clock: Clocks.Clock; - VAR currentTime: Times.Time; - errors: RelatedEvents.Object) : BOOLEAN; - (* get the current time of clock and check for errors *) - VAR - oldEvents, newEvents: RelatedEvents.Queue; - BEGIN - RelatedEvents.GetQueue(clock, oldEvents); + PROCEDURE FixTime(VAR time: Times.Time; + currentTime: Times.Time; + clock: Clocks.Clock); + (* convert relative time measures into absolute time specs *) + VAR op: Op.Operand; + BEGIN + IF Scales.IsRelative(time) THEN Clocks.GetTime(clock, currentTime); - RelatedEvents.GetQueue(clock, newEvents); - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(errors, newEvents); - END; - IF oldEvents # NIL THEN - RelatedEvents.AppendQueue(clock, oldEvents); - END; - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(clock, newEvents); - END; - RETURN newEvents = NIL - END GetTime; + op := time; Op.Add3(op, currentTime, time); time := op(Times.Time) + END; + END FixTime; - PROCEDURE Passed(clock: Clocks.Clock; - time: Times.Time; - VAR passed: BOOLEAN; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - oldEvents, newEvents: RelatedEvents.Queue; - BEGIN - RelatedEvents.GetQueue(clock, oldEvents); - passed := Clocks.Passed(clock, time); - RelatedEvents.GetQueue(clock, newEvents); - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(errors, newEvents); + PROCEDURE Wakeup(event: Events.Event); + (* note that we strictly rely on the capability of the + underlying clock to raise this event at the appropriate + time; we are unable to verify it because that could + deadlock us in case of remote clocks + *) + VAR + condevent: Events.Event; (* event requested by SendEvent *) + BEGIN + WITH event: WakeupEvent DO + event.awaked := TRUE; + IF event.condition # NIL THEN + event.condition.passed := TRUE; + event.condition.scheduled := FALSE; + condevent := event.condition.domain.event; + IF condevent # NIL THEN + event.condition.domain.event := NIL; + Events.Raise(condevent); + END; END; - IF oldEvents # NIL THEN - RelatedEvents.AppendQueue(clock, oldEvents); - END; - IF newEvents # NIL THEN - RelatedEvents.AppendQueue(clock, newEvents); - END; - RETURN newEvents = NIL - END Passed; + END; + END Wakeup; - PROCEDURE Test(domain: Conditions.Domain; condition: Conditions.Condition; - errors: RelatedEvents.Object) : BOOLEAN; - VAR - currentTime: Times.Time; - BEGIN - WITH domain: Domain DO WITH condition: Condition DO - IF condition.passed THEN RETURN TRUE END; - IF condition.domain.event # NIL THEN RETURN FALSE END; - IF condition.scheduled THEN RETURN FALSE END; - IF ~Passed(domain.clock, condition.time, - condition.passed, errors) THEN - condition.passed := TRUE; - RETURN TRUE - END; - RETURN condition.passed - END; END; - END Test; + PROCEDURE ScheduleEvent(condition: Condition); + VAR + wakeup: WakeupEvent; + domain: Domain; + BEGIN + IF ~condition.scheduled THEN + domain := condition.domain; + ASSERT(domain.alarm # NIL); + NEW(wakeup); wakeup.type := domain.alarm; + wakeup.awaked := FALSE; wakeup.condition := condition; + condition.scheduled := TRUE; + Timers.Schedule(domain.clock, condition.time, wakeup); + END; + END ScheduleEvent; - PROCEDURE GetMinTime(conditionSet: Conditions.ConditionSet; - VAR minTime: Times.Time; - VAR minCond: Condition); + PROCEDURE Init*(condition: Condition; clock: Clocks.Clock; time: Times.Time); + (* like Create but without NEW *) + VAR + clockDisc: Discipline; + disc: Disciplines.Discipline; + domain: Domain; + desc: Conditions.Description; + priorityOfClock: Priorities.Priority; + currentTime: Times.Time; + BEGIN + IF Disciplines.Seek(clock, disciplineId, disc) THEN + domain := disc(Discipline).domain; + ELSE + (* create new domain *) + NEW(desc); desc.caps := {}; desc.internal := TRUE; + IF clock = Clocks.system THEN + desc.caps := desc.caps + + {Conditions.timelimit, Conditions.timecond}; + END; + IF Clocks.timer IN Clocks.Capabilities(clock) THEN + Clocks.GetPriority(clock, priorityOfClock); + IF priorityOfClock > Priorities.base THEN + desc.caps := desc.caps + {Conditions.select, Conditions.async}; + desc.internal := priorityOfClock < Priorities.interrupts; + END; + END; + NEW(domain); Conditions.InitDomain(domain, if, desc); + domain.clock := clock; + IF Clocks.timer IN Clocks.Capabilities(clock) THEN + Events.Define(domain.alarm); + Events.SetPriority(domain.alarm, priorityOfClock + 1); + Events.Handler(domain.alarm, Wakeup); + ELSE + domain.alarm := NIL; + END; + NEW(clockDisc); clockDisc.id := disciplineId; + clockDisc.domain := domain; + Disciplines.Add(clock, clockDisc); + domain.event := NIL; + END; + Conditions.Init(condition, domain); + FixTime(time, currentTime, clock); condition.time := time; + condition.domain := domain; + condition.passed := Clocks.Passed(clock, time); + condition.scheduled := FALSE; + IF ~condition.passed & + (domain.alarm # NIL) & (clock # Clocks.system) THEN + ScheduleEvent(condition); + END; + END Init; + + PROCEDURE Create*(VAR condition: Conditions.Condition; + clock: Clocks.Clock; time: Times.Time); + (* create and initialize a time condition: + is the current time of the clock greater than or + equal to `time'; + if time is relative then it is taken relative to the current time + *) + VAR + timeCond: Condition; + BEGIN + NEW(timeCond); + Init(timeCond, clock, time); + condition := timeCond; + END Create; + + (* ======== interface procedures ================================ *) + + PROCEDURE GetTime(clock: Clocks.Clock; + VAR currentTime: Times.Time; + errors: RelatedEvents.Object) : BOOLEAN; + (* get the current time of clock and check for errors *) + VAR + oldEvents, newEvents: RelatedEvents.Queue; + BEGIN + RelatedEvents.GetQueue(clock, oldEvents); + Clocks.GetTime(clock, currentTime); + RelatedEvents.GetQueue(clock, newEvents); + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(errors, newEvents); + END; + IF oldEvents # NIL THEN + RelatedEvents.AppendQueue(clock, oldEvents); + END; + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(clock, newEvents); + END; + RETURN newEvents = NIL + END GetTime; + + PROCEDURE Passed(clock: Clocks.Clock; + time: Times.Time; + VAR passed: BOOLEAN; + errors: RelatedEvents.Object) : BOOLEAN; + VAR + oldEvents, newEvents: RelatedEvents.Queue; + BEGIN + RelatedEvents.GetQueue(clock, oldEvents); + passed := Clocks.Passed(clock, time); + RelatedEvents.GetQueue(clock, newEvents); + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(errors, newEvents); + END; + IF oldEvents # NIL THEN + RelatedEvents.AppendQueue(clock, oldEvents); + END; + IF newEvents # NIL THEN + RelatedEvents.AppendQueue(clock, newEvents); + END; + RETURN newEvents = NIL + END Passed; + + PROCEDURE Test(domain: Conditions.Domain; condition: Conditions.Condition; + errors: RelatedEvents.Object) : BOOLEAN; + VAR + currentTime: Times.Time; + BEGIN + WITH domain: Domain DO WITH condition: Condition DO + IF condition.passed THEN RETURN TRUE END; + IF condition.domain.event # NIL THEN RETURN FALSE END; + IF condition.scheduled THEN RETURN FALSE END; + IF ~Passed(domain.clock, condition.time, + condition.passed, errors) THEN + condition.passed := TRUE; + RETURN TRUE + END; + RETURN condition.passed + END; END; + END Test; + + PROCEDURE GetMinTime(conditionSet: Conditions.ConditionSet; + VAR minTime: Times.Time; + VAR minCond: Condition); + VAR + condition: Conditions.Condition; (* Condition *) + op: Op.Operand; + BEGIN + minTime := NIL; + Conditions.ExamineConditions(conditionSet); + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + IF (minTime = NIL) OR (Op.Compare(condition(Condition).time, minTime) < 0) THEN + minTime := condition(Condition).time; minCond := condition(Condition) + END; + END; + op := minTime; Op.Assign(op, minTime); minTime := op(Times.Time) (* take a copy *) + END GetMinTime; + + PROCEDURE Select(domain: Conditions.Domain; + conditionSet: Conditions.ConditionSet; + time: Times.Time; + VAR setOfTrueConditions: Conditions.ConditionSet; + errors: RelatedEvents.Object; + retry: BOOLEAN; + VAR interrupted: BOOLEAN) : BOOLEAN; + VAR + minTime: Times.Time; + minCond: Condition; + currentTime: Times.Time; (* of Clocks.system *) + condition: Conditions.Condition; (* Condition *) + wakeup: WakeupEvent; + anythingTrue: BOOLEAN; + + PROCEDURE Failure; + (* we are unable to retrieve the time; + so we have to mark all conditions as passed + and to return the whole set + *) VAR - condition: Condition; - BEGIN - minTime := NIL; + condition: Conditions.Condition; (* Condition *) + BEGIN + Conditions.CreateSet(setOfTrueConditions); Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - IF (minTime = NIL) OR (Op.Compare(condition.time, minTime) < 0) THEN - minTime := condition.time; minCond := condition; - END; + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + condition(Condition).passed := TRUE; + Conditions.Incl(setOfTrueConditions, condition(Condition)); END; - Op.Assign(SYSTEM.VAL(Op.Operand, minTime), minTime); (* take a copy *) - END GetMinTime; + END Failure; - PROCEDURE Select(domain: Conditions.Domain; - conditionSet: Conditions.ConditionSet; - time: Times.Time; - VAR setOfTrueConditions: Conditions.ConditionSet; - errors: RelatedEvents.Object; - retry: BOOLEAN; - VAR interrupted: BOOLEAN) : BOOLEAN; - VAR - minTime: Times.Time; - minCond: Condition; - currentTime: Times.Time; (* of Clocks.system *) - condition: Condition; - wakeup: WakeupEvent; - anythingTrue: BOOLEAN; + BEGIN (* Select *) + WITH domain: Domain DO + GetMinTime(conditionSet, minTime, minCond); - PROCEDURE Failure; - (* we are unable to retrieve the time; - so we have to mark all conditions as passed - and to return the whole set - *) - VAR - condition: Condition; - BEGIN - Conditions.CreateSet(setOfTrueConditions); - Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - condition.passed := TRUE; - Conditions.Incl(setOfTrueConditions, condition); - END; - END Failure; - - BEGIN (* Select *) - WITH domain: Domain DO - GetMinTime(conditionSet, minTime, minCond); - - (* block current process, if necessary *) - interrupted := FALSE; - IF time # NIL THEN - Clocks.GetTime(Clocks.system, currentTime); - FixTime(time, currentTime, Clocks.system); - NEW(wakeup); wakeup.type := domain.alarm; - wakeup.condition := NIL; wakeup.awaked := FALSE; - Timers.Schedule(Clocks.system, time, wakeup); - END; - IF ~GetTime(domain.clock, currentTime, errors) THEN - Failure; RETURN TRUE - END; - - IF ~minCond.passed THEN - LOOP (* goes only into loop if retry = TRUE & we get interrupted *) - Process.Pause; - IF wakeup.awaked THEN EXIT END; - interrupted := ~minCond.passed; - IF ~interrupted THEN EXIT END; - IF ~retry THEN RETURN FALSE END; - END; - END; - - anythingTrue := FALSE; - Conditions.CreateSet(setOfTrueConditions); - Conditions.ExamineConditions(conditionSet); - WHILE Conditions.GetNextCondition(conditionSet, SYSTEM.VAL(Conditions.Condition, condition)) DO - IF condition.passed THEN - Conditions.Incl(setOfTrueConditions, condition); - anythingTrue := TRUE; - END; - END; - RETURN anythingTrue + (* block current process, if necessary *) + interrupted := FALSE; + IF time # NIL THEN + Clocks.GetTime(Clocks.system, currentTime); + FixTime(time, currentTime, Clocks.system); + NEW(wakeup); wakeup.type := domain.alarm; + wakeup.condition := NIL; wakeup.awaked := FALSE; + Timers.Schedule(Clocks.system, time, wakeup); + END; + IF ~GetTime(domain.clock, currentTime, errors) THEN + Failure; RETURN TRUE END; - END Select; - PROCEDURE SendEvent(domain: Conditions.Domain; - condition: Conditions.Condition; - event: Events.Event; - errors: RelatedEvents.Object) : BOOLEAN; - BEGIN - WITH domain: Domain DO WITH condition: Condition DO - IF condition.passed THEN - RETURN FALSE - ELSE - domain.event := event; - ScheduleEvent(condition); - RETURN TRUE - END; - END; END; - END SendEvent; + IF ~minCond.passed THEN + LOOP (* goes only into loop if retry = TRUE & we get interrupted *) + Process.Pause; + IF wakeup.awaked THEN EXIT END; + interrupted := ~minCond.passed; + IF ~interrupted THEN EXIT END; + IF ~retry THEN RETURN FALSE END; + END; + END; - PROCEDURE GetNextTime(domain: Conditions.Domain; - conditionSet: Conditions.ConditionSet; - VAR nextTime: Times.Time; - VAR nextCond: Conditions.Condition; - errors: RelatedEvents.Object); - VAR - condition: Condition; - BEGIN - GetMinTime(conditionSet, nextTime, condition); - nextCond := condition; - END GetNextTime; + anythingTrue := FALSE; + Conditions.CreateSet(setOfTrueConditions); + Conditions.ExamineConditions(conditionSet); + WHILE Conditions.GetNextCondition(conditionSet, condition) DO + IF condition(Condition).passed THEN + Conditions.Incl(setOfTrueConditions, condition(Condition)); + anythingTrue := TRUE; + END; + END; + RETURN anythingTrue + END; + END Select; - PROCEDURE InitInterface; - BEGIN - NEW(if); - if.test := Test; - if.select := Select; - if.sendevent := SendEvent; - if.gettime := GetNextTime; - END InitInterface; + PROCEDURE SendEvent(domain: Conditions.Domain; + condition: Conditions.Condition; + event: Events.Event; + errors: RelatedEvents.Object) : BOOLEAN; + BEGIN + WITH domain: Domain DO WITH condition: Condition DO + IF condition.passed THEN + RETURN FALSE + ELSE + domain.event := event; + ScheduleEvent(condition); + RETURN TRUE + END; + END; END; + END SendEvent; + + PROCEDURE GetNextTime(domain: Conditions.Domain; + conditionSet: Conditions.ConditionSet; + VAR nextTime: Times.Time; + VAR nextCond: Conditions.Condition; + errors: RelatedEvents.Object); + VAR + condition: Condition; + BEGIN + GetMinTime(conditionSet, nextTime, condition); + nextCond := condition; + END GetNextTime; + + PROCEDURE InitInterface; + BEGIN + NEW(if); + if.test := Test; + if.select := Select; + if.sendevent := SendEvent; + if.gettime := GetNextTime; + END InitInterface; BEGIN - disciplineId := Disciplines.Unique(); - InitInterface; + disciplineId := Disciplines.Unique(); + InitInterface; END ulmTimeConditions. diff --git a/src/library/ulm/ulmTimers.Mod b/src/library/ulm/ulmTimers.Mod index 88ca1996..62c45e7f 100644 --- a/src/library/ulm/ulmTimers.Mod +++ b/src/library/ulm/ulmTimers.Mod @@ -1,336 +1,338 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Timers.om,v 1.3 2001/04/30 14:58:18 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Timers.om,v $ - Revision 1.3 2001/04/30 14:58:18 borchert - bug fix: recursion via Clocks.TimerOn was not possible + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Timers.om,v 1.3 2001/04/30 14:58:18 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Timers.om,v $ + Revision 1.3 2001/04/30 14:58:18 borchert + bug fix: recursion via Clocks.TimerOn was not possible - Revision 1.2 1994/07/18 14:21:51 borchert - bug fix: CreateQueue took uninitialized priority variable instead of - queue.priority + Revision 1.2 1994/07/18 14:21:51 borchert + bug fix: CreateQueue took uninitialized priority variable instead of + queue.priority - Revision 1.1 1994/02/22 20:11:37 borchert - Initial revision + Revision 1.1 1994/02/22 20:11:37 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 1/92 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 1/92 + ---------------------------------------------------------------------------- *) MODULE ulmTimers; - IMPORT Clocks := ulmClocks, Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, Priorities := ulmPriorities, - SYS := ulmSYSTEM, SYSTEM, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Times := ulmTimes; + IMPORT Clocks := ulmClocks, Disciplines := ulmDisciplines, Events := ulmEvents, Objects := ulmObjects, Op := ulmOperations, Priorities := ulmPriorities, + SYS := ulmSYSTEM, RelatedEvents := ulmRelatedEvents, Scales := ulmScales, Times := ulmTimes; - TYPE - Queue = POINTER TO QueueRec; - Timer* = POINTER TO TimerRec; - TimerRec* = - RECORD - (Objects.ObjectRec) - valid: BOOLEAN; (* a valid timer entry? *) - queue: Queue; (* timer belongs to this queue *) - prev, next: Timer; (* double-linked and sorted list *) - time: Times.Time; (* key *) - event: Events.Event; (* raise this event at the given time *) - END; - QueueRec = - RECORD - (Disciplines.ObjectRec) - clock: Clocks.Clock; (* queue of this clock *) - priority: Priorities.Priority; (* priority of the clock *) - checkQueue: Events.EventType; (* check queue on this event *) - head, tail: Timer; (* sorted list of timers *) - lock: BOOLEAN; - END; - TYPE - CheckQueueEvent = POINTER TO CheckQueueEventRec; - CheckQueueEventRec = - RECORD - (Events.EventRec) - queue: Queue; - END; - TYPE - ClockDiscipline = POINTER TO ClockDisciplineRec; - ClockDisciplineRec = - RECORD - (Disciplines.DisciplineRec) - queue: Queue; - END; - VAR - clockDisciplineId: Disciplines.Identifier; - - CONST - invalidTimer* = 0; (* timer is no longer valid *) - queueLocked* = 1; (* the queue is currently locked *) - badClock* = 2; (* clock is unable to maintain a timer *) - errorcodes* = 3; - TYPE - ErrorEvent* = POINTER TO ErrorEventRec; - ErrorEventRec* = - RECORD - (Events.EventRec) - errorcode*: SHORTINT; - END; - VAR - errormsg*: ARRAY errorcodes OF Events.Message; - error*: Events.EventType; - - PROCEDURE InitErrorHandling; - BEGIN - errormsg[invalidTimer] := "invalid timer given to Timers.Remove"; - errormsg[queueLocked] := "the queue is currently locked"; - errormsg[badClock] := "clock is unable to maintain a timer"; - Events.Define(error); Events.SetPriority(error, Priorities.liberrors); - END InitErrorHandling; - - PROCEDURE Error(errors: RelatedEvents.Object; code: SHORTINT); - VAR - event: ErrorEvent; - BEGIN - NEW(event); - event.type := error; - event.message := errormsg[code]; - event.errorcode := code; - RelatedEvents.Raise(errors, event); - END Error; - - PROCEDURE CheckQueue(queue: Queue); - VAR - currentTime: Times.Time; - oldTimers: Timer; - p, prev: Timer; - checkQueueEvent: CheckQueueEvent; - nextTimer: Timer; - BEGIN - IF queue.head = NIL THEN queue.lock := FALSE; RETURN END; - - Clocks.GetTime(queue.clock, currentTime); - - (* remove old timers from queue *) - oldTimers := queue.head; - p := queue.head; prev := NIL; - WHILE (p # NIL) & (Op.Compare(currentTime, p.time) >= 0) DO - prev := p; p := p.next; + TYPE + Queue = POINTER TO QueueRec; + Timer* = POINTER TO TimerRec; + TimerRec* = + RECORD + (Objects.ObjectRec) + valid: BOOLEAN; (* a valid timer entry? *) + queue: Queue; (* timer belongs to this queue *) + prev, next: Timer; (* double-linked and sorted list *) + time: Times.Time; (* key *) + event: Events.Event; (* raise this event at the given time *) END; - IF p = NIL THEN - queue.head := NIL; queue.tail := NIL; - ELSE - queue.head := p; - p.prev := NIL; + QueueRec = + RECORD + (Disciplines.ObjectRec) + clock: Clocks.Clock; (* queue of this clock *) + priority: Priorities.Priority; (* priority of the clock *) + checkQueue: Events.EventType; (* check queue on this event *) + head, tail: Timer; (* sorted list of timers *) + lock: BOOLEAN; END; - IF prev = NIL THEN - oldTimers := NIL; - ELSE - prev.next := NIL; + TYPE + CheckQueueEvent = POINTER TO CheckQueueEventRec; + CheckQueueEventRec = + RECORD + (Events.EventRec) + queue: Queue; END; + TYPE + ClockDiscipline = POINTER TO ClockDisciplineRec; + ClockDisciplineRec = + RECORD + (Disciplines.DisciplineRec) + queue: Queue; + END; + VAR + clockDisciplineId: Disciplines.Identifier; - (* set up next check-queue-event, if necessary *) - nextTimer := queue.head; - queue.lock := FALSE; - (* unlock queue now to allow recursion via Clocks.TimerOn *) - IF nextTimer # NIL THEN - NEW(checkQueueEvent); - checkQueueEvent.type := queue.checkQueue; - checkQueueEvent.message := "check queue of timer"; - checkQueueEvent.queue := queue; - Clocks.TimerOn(queue.clock, nextTimer.time, checkQueueEvent); - ELSE - Clocks.TimerOff(queue.clock); + CONST + invalidTimer* = 0; (* timer is no longer valid *) + queueLocked* = 1; (* the queue is currently locked *) + badClock* = 2; (* clock is unable to maintain a timer *) + errorcodes* = 3; + TYPE + ErrorEvent* = POINTER TO ErrorEventRec; + ErrorEventRec* = + RECORD + (Events.EventRec) + errorcode*: SHORTINT; END; + VAR + errormsg*: ARRAY errorcodes OF Events.Message; + error*: Events.EventType; - (* process old timers *) - p := oldTimers; - WHILE p # NIL DO - p.valid := FALSE; - Events.Raise(p.event); - p := p.next; - END; - END CheckQueue; + PROCEDURE InitErrorHandling; + BEGIN + errormsg[invalidTimer] := "invalid timer given to Timers.Remove"; + errormsg[queueLocked] := "the queue is currently locked"; + errormsg[badClock] := "clock is unable to maintain a timer"; + Events.Define(error); Events.SetPriority(error, Priorities.liberrors); + END InitErrorHandling; - PROCEDURE CatchCheckQueueEvents(event: Events.Event); - BEGIN - WITH event: CheckQueueEvent DO - IF ~SYS.TAS(event.queue.lock) THEN - CheckQueue(event.queue); - (* event.queue.lock := FALSE; (* done by CheckQueue *) *) - END; - END; - END CatchCheckQueueEvents; + PROCEDURE Error(errors: RelatedEvents.Object; code: SHORTINT); + VAR + event: ErrorEvent; + BEGIN + NEW(event); + event.type := error; + event.message := errormsg[code]; + event.errorcode := code; + RelatedEvents.Raise(errors, event); + END Error; - PROCEDURE CreateQueue(errors: RelatedEvents.Object; - VAR queue: Queue; clock: Clocks.Clock) : BOOLEAN; - VAR - clockDiscipline: ClockDiscipline; - BEGIN - IF ~(Clocks.timer IN Clocks.Capabilities(clock)) THEN - Error(errors, badClock); RETURN FALSE - END; + PROCEDURE CheckQueue(queue: Queue); + VAR + currentTime: Times.Time; + oldTimers: Timer; + p, prev: Timer; + checkQueueEvent: CheckQueueEvent; + nextTimer: Timer; + BEGIN + IF queue.head = NIL THEN queue.lock := FALSE; RETURN END; - NEW(queue); - queue.clock := clock; + Clocks.GetTime(queue.clock, currentTime); + + (* remove old timers from queue *) + oldTimers := queue.head; + p := queue.head; prev := NIL; + WHILE (p # NIL) & (Op.Compare(currentTime, p.time) >= 0) DO + prev := p; p := p.next; + END; + IF p = NIL THEN queue.head := NIL; queue.tail := NIL; - queue.lock := FALSE; - Events.Define(queue.checkQueue); - Events.Handler(queue.checkQueue, CatchCheckQueueEvents); - Clocks.GetPriority(clock, queue.priority); - IF queue.priority > Priorities.base THEN - Events.SetPriority(queue.checkQueue, queue.priority + 1); + ELSE + queue.head := p; + p.prev := NIL; + END; + IF prev = NIL THEN + oldTimers := NIL; + ELSE + prev.next := NIL; + END; + + (* set up next check-queue-event, if necessary *) + nextTimer := queue.head; + queue.lock := FALSE; + (* unlock queue now to allow recursion via Clocks.TimerOn *) + IF nextTimer # NIL THEN + NEW(checkQueueEvent); + checkQueueEvent.type := queue.checkQueue; + checkQueueEvent.message := "check queue of timer"; + checkQueueEvent.queue := queue; + Clocks.TimerOn(queue.clock, nextTimer.time, checkQueueEvent); + ELSE + Clocks.TimerOff(queue.clock); + END; + + (* process old timers *) + p := oldTimers; + WHILE p # NIL DO + p.valid := FALSE; + Events.Raise(p.event); + p := p.next; + END; + END CheckQueue; + + PROCEDURE CatchCheckQueueEvents(event: Events.Event); + BEGIN + WITH event: CheckQueueEvent DO + IF ~SYS.TAS(event.queue.lock) THEN + CheckQueue(event.queue); + (* event.queue.lock := FALSE; (* done by CheckQueue *) *) + END; + END; + END CatchCheckQueueEvents; + + PROCEDURE CreateQueue(errors: RelatedEvents.Object; + VAR queue: Queue; clock: Clocks.Clock) : BOOLEAN; + VAR + clockDiscipline: ClockDiscipline; + BEGIN + IF ~(Clocks.timer IN Clocks.Capabilities(clock)) THEN + Error(errors, badClock); RETURN FALSE + END; + + NEW(queue); + queue.clock := clock; + queue.head := NIL; queue.tail := NIL; + queue.lock := FALSE; + Events.Define(queue.checkQueue); + Events.Handler(queue.checkQueue, CatchCheckQueueEvents); + Clocks.GetPriority(clock, queue.priority); + IF queue.priority > Priorities.base THEN + Events.SetPriority(queue.checkQueue, queue.priority + 1); + ELSE + queue.priority := Priorities.default; + END; + + NEW(clockDiscipline); clockDiscipline.id := clockDisciplineId; + clockDiscipline.queue := queue; + Disciplines.Add(clock, clockDiscipline); + RETURN TRUE + END CreateQueue; + + PROCEDURE Add*(clock: Clocks.Clock; time: Times.Time; event: Events.Event; + VAR timer: Timer); + VAR + queue: Queue; + clockDiscipline: Disciplines.Discipline; (* ClockDiscipline *) + p: Timer; + absTime: Times.Time; + op: Op.Operand; + BEGIN + IF Disciplines.Seek(clock, clockDisciplineId, clockDiscipline) THEN + queue := clockDiscipline(ClockDiscipline).queue; + ELSIF ~CreateQueue(clock, queue, clock) THEN + RETURN + END; + + IF SYS.TAS(queue.lock) THEN + Error(clock, queueLocked); RETURN + END; + Events.AssertPriority(queue.priority); + + IF Scales.IsRelative(time) THEN + (* take relative time to be relative to the current time *) + Clocks.GetTime(clock, absTime); + (* Op.Add2(SYSTEM.VAL(Op.Operand, absTime), time); *) + op := absTime; Op.Add2(op, time); absTime := op(Times.Time); + ELSE + (* create a copy of time *) + op := NIL; Op.Assign(op, time); absTime := op(Times.Time); + END; + time := absTime; + NEW(timer); timer.time := time; timer.event := event; + timer.queue := queue; timer.valid := TRUE; + + (* look for the insertion point *) + p := queue.head; + WHILE (p # NIL) & (Op.Compare(time, p.time) > 0) DO + p := p.next; + END; + + (* insert timer in front of p *) + timer.next := p; + IF p = NIL THEN + (* append timer at the end of the queue *) + timer.prev := queue.tail; + IF queue.tail = NIL THEN + queue.head := timer; ELSE - queue.priority := Priorities.default; + queue.tail.next := timer; END; - - NEW(clockDiscipline); clockDiscipline.id := clockDisciplineId; - clockDiscipline.queue := queue; - Disciplines.Add(clock, clockDiscipline); - RETURN TRUE - END CreateQueue; - - PROCEDURE Add*(clock: Clocks.Clock; time: Times.Time; event: Events.Event; - VAR timer: Timer); - VAR - queue: Queue; - clockDiscipline: ClockDiscipline; - p: Timer; - absTime: Times.Time; - BEGIN - IF Disciplines.Seek(clock, clockDisciplineId, SYSTEM.VAL(Disciplines.Discipline, clockDiscipline)) THEN - queue := clockDiscipline.queue; - ELSIF ~CreateQueue(clock, queue, clock) THEN - RETURN + queue.tail := timer; + ELSE + timer.prev := p.prev; + timer.next := p; + IF p = queue.head THEN + queue.head := timer; + ELSE + p.prev.next := timer; END; + p.prev := timer; + END; + CheckQueue(queue); + (* queue.lock := FALSE; (* done by CheckQueue *) *) + Events.ExitPriority; + END Add; + + PROCEDURE Remove*(timer: Timer); + VAR + queue: Queue; + BEGIN + IF timer.valid THEN + queue := timer.queue; IF SYS.TAS(queue.lock) THEN - Error(clock, queueLocked); RETURN + Error(queue.clock, queueLocked); RETURN END; Events.AssertPriority(queue.priority); - - IF Scales.IsRelative(time) THEN - (* take relative time to be relative to the current time *) - Clocks.GetTime(clock, absTime); - Op.Add2(SYSTEM.VAL(Op.Operand, absTime), time); + timer.valid := FALSE; + IF timer.prev = NIL THEN + queue.head := timer.next; ELSE - (* create a copy of time *) - absTime := NIL; Op.Assign(SYSTEM.VAL(Op.Operand, absTime), time); + timer.prev.next := timer.next; END; - time := absTime; - NEW(timer); timer.time := time; timer.event := event; - timer.queue := queue; timer.valid := TRUE; - - (* look for the insertion point *) - p := queue.head; - WHILE (p # NIL) & (Op.Compare(time, p.time) > 0) DO - p := p.next; - END; - - (* insert timer in front of p *) - timer.next := p; - IF p = NIL THEN - (* append timer at the end of the queue *) - timer.prev := queue.tail; - IF queue.tail = NIL THEN - queue.head := timer; - ELSE - queue.tail.next := timer; - END; - queue.tail := timer; + IF timer.next = NIL THEN + queue.tail := timer.prev; ELSE - timer.prev := p.prev; - timer.next := p; - IF p = queue.head THEN - queue.head := timer; - ELSE - p.prev.next := timer; - END; - p.prev := timer; + timer.next.prev := timer.prev; END; - CheckQueue(queue); (* queue.lock := FALSE; (* done by CheckQueue *) *) Events.ExitPriority; - END Add; + ELSE + Error(timer.queue.clock, invalidTimer); + END; + END Remove; - PROCEDURE Remove*(timer: Timer); - VAR - queue: Queue; - BEGIN - IF timer.valid THEN - queue := timer.queue; - IF SYS.TAS(queue.lock) THEN - Error(queue.clock, queueLocked); RETURN - END; - Events.AssertPriority(queue.priority); - timer.valid := FALSE; - IF timer.prev = NIL THEN - queue.head := timer.next; - ELSE - timer.prev.next := timer.next; - END; - IF timer.next = NIL THEN - queue.tail := timer.prev; - ELSE - timer.next.prev := timer.prev; - END; - CheckQueue(queue); - (* queue.lock := FALSE; (* done by CheckQueue *) *) - Events.ExitPriority; - ELSE - Error(timer.queue.clock, invalidTimer); - END; - END Remove; + PROCEDURE Schedule*(clock: Clocks.Clock; + time: Times.Time; event: Events.Event); + VAR + timer: Timer; + BEGIN + Add(clock, time, event, timer); + END Schedule; - PROCEDURE Schedule*(clock: Clocks.Clock; - time: Times.Time; event: Events.Event); - VAR - timer: Timer; - BEGIN - Add(clock, time, event, timer); - END Schedule; + PROCEDURE NextEvent*(clock: Clocks.Clock; VAR time: Times.Time) : BOOLEAN; + VAR + rval: BOOLEAN; + queue: Queue; + clockDiscipline: Disciplines.Discipline; (* ClockDiscipline *) + BEGIN + IF ~Disciplines.Seek(clock, clockDisciplineId, clockDiscipline) THEN + RETURN FALSE + END; + queue := clockDiscipline(ClockDiscipline).queue; - PROCEDURE NextEvent*(clock: Clocks.Clock; VAR time: Times.Time) : BOOLEAN; - VAR - rval: BOOLEAN; - queue: Queue; - clockDiscipline: ClockDiscipline; - BEGIN - IF ~Disciplines.Seek(clock, clockDisciplineId, SYSTEM.VAL(Disciplines.Discipline, clockDiscipline)) THEN - RETURN FALSE - END; - queue := clockDiscipline.queue; - - IF SYS.TAS(queue.lock) THEN - Error(clock, queueLocked); RETURN FALSE - END; - CheckQueue(queue); - IF queue.head # NIL THEN - time := queue.head.time; - rval := TRUE; - ELSE - rval := FALSE - END; - (* queue.lock := FALSE; (* done by CheckQueue *) *) - RETURN rval - END NextEvent; + IF SYS.TAS(queue.lock) THEN + Error(clock, queueLocked); RETURN FALSE + END; + CheckQueue(queue); + IF queue.head # NIL THEN + time := queue.head.time; + rval := TRUE; + ELSE + rval := FALSE + END; + (* queue.lock := FALSE; (* done by CheckQueue *) *) + RETURN rval + END NextEvent; BEGIN - InitErrorHandling; - clockDisciplineId := Disciplines.Unique(); + InitErrorHandling; + clockDisciplineId := Disciplines.Unique(); END ulmTimers. diff --git a/src/library/ulm/ulmTimes.Mod b/src/library/ulm/ulmTimes.Mod index e7dc122f..cf45c823 100644 --- a/src/library/ulm/ulmTimes.Mod +++ b/src/library/ulm/ulmTimes.Mod @@ -1,398 +1,401 @@ (* Ulm's Oberon Library - Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany - ---------------------------------------------------------------------------- - Ulm's Oberon Library is free software; you can redistribute it - and/or modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either version - 2 of the License, or (at your option) any later version. + Copyright (C) 1989-1994 by University of Ulm, SAI, D-89069 Ulm, Germany + ---------------------------------------------------------------------------- + Ulm's Oberon Library is free software; you can redistribute it + and/or modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. - Ulm's Oberon Library is distributed in the hope that it will be - useful, but WITHOUT ANY WARRANTY; without even the implied warranty - of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + Ulm's Oberon Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ---------------------------------------------------------------------------- - E-mail contact: oberon@mathematik.uni-ulm.de - ---------------------------------------------------------------------------- - $Id: Times.om,v 1.3 2001/04/30 14:54:44 borchert Exp $ - ---------------------------------------------------------------------------- - $Log: Times.om,v $ - Revision 1.3 2001/04/30 14:54:44 borchert - bug fix: base type is TimeRec instead of Times.TimeRec - (invalid self-reference) + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ---------------------------------------------------------------------------- + E-mail contact: oberon@mathematik.uni-ulm.de + ---------------------------------------------------------------------------- + $Id: Times.om,v 1.3 2001/04/30 14:54:44 borchert Exp $ + ---------------------------------------------------------------------------- + $Log: Times.om,v $ + Revision 1.3 2001/04/30 14:54:44 borchert + bug fix: base type is TimeRec instead of Times.TimeRec + (invalid self-reference) - Revision 1.2 1995/04/07 13:25:07 borchert - fixes due to changed if of PersistentObjects + Revision 1.2 1995/04/07 13:25:07 borchert + fixes due to changed if of PersistentObjects - Revision 1.1 1994/02/22 20:12:02 borchert - Initial revision + Revision 1.1 1994/02/22 20:12:02 borchert + Initial revision - ---------------------------------------------------------------------------- - AFB 12/91 - ---------------------------------------------------------------------------- + ---------------------------------------------------------------------------- + AFB 12/91 + ---------------------------------------------------------------------------- *) MODULE ulmTimes; - IMPORT NetIO := ulmNetIO, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Scales := ulmScales, - Services := ulmServices, Streams := ulmStreams, SYSTEM; + IMPORT NetIO := ulmNetIO, Objects := ulmObjects, Operations := ulmOperations, PersistentObjects := ulmPersistentObjects, Scales := ulmScales, + Services := ulmServices, Streams := ulmStreams; - CONST - relative* = Scales.relative; - absolute* = Scales.absolute; - TYPE - (* the common base type of all time measures *) - Time* = POINTER TO TimeRec; - TimeRec* = RECORD (Scales.MeasureRec) END; + CONST + relative* = Scales.relative; + absolute* = Scales.absolute; + TYPE + (* the common base type of all time measures *) + Time* = POINTER TO TimeRec; + TimeRec* = RECORD (Scales.MeasureRec) END; - CONST - usecsPerSec = 1000000; (* 10^6 *) - TYPE - (* units of the reference implementation: - epoch, second and usec - *) - TimeValueRec* = - RECORD - (Objects.ObjectRec) - (* epoch 0: Jan. 1, 1970; - each epoch has a length of MAX(Scales.Value) + 1 seconds; - epoch may be negative: - -1 is the epoch just before 1970 - *) - epoch*: Scales.Value; - (* seconds and ... *) - second*: Scales.Value; - (* ... microseconds since the beginning of the epoch *) - usec*: Scales.Value; - END; - - (* ==== private datatypes for the reference scale *) - TYPE - ReferenceTime = POINTER TO ReferenceTimeRec; - ReferenceTimeRec = - RECORD - (TimeRec) - timeval: TimeValueRec; - END; - VAR - absType, relType: Services.Type; - CONST - epochUnit = 0; secondUnit = 1; usecUnit = 2; - TYPE - Unit = POINTER TO UnitRec; - UnitRec = - RECORD - (Scales.UnitRec) - index: SHORTINT; (* epochUnit..usecUnit *) - END; - - VAR - scale*: Scales.Scale; (* reference scale *) - family*: Scales.Family; (* family of time scales *) - if: Scales.Interface; - - PROCEDURE Create*(VAR time: Time; type: SHORTINT); - (* type = absolute or relative *) - VAR - m: Scales.Measure; - BEGIN - Scales.CreateMeasure(scale, m, type); - time := m(Time); - END Create; - - PROCEDURE Normalize(VAR timeval: TimeValueRec); - (* make sure that second and usec >= 0 *) - VAR - toomanysecs: Scales.Value; - secs: Scales.Value; - BEGIN - IF timeval.second < 0 THEN - INC(timeval.second, 1); - INC(timeval.second, MAX(Scales.Value)); - DEC(timeval.epoch); + CONST + usecsPerSec = 1000000; (* 10^6 *) + TYPE + (* units of the reference implementation: + epoch, second and usec + *) + TimeValueRec* = + RECORD + (Objects.ObjectRec) + (* epoch 0: Jan. 1, 1970; + each epoch has a length of MAX(Scales.Value) + 1 seconds; + epoch may be negative: + -1 is the epoch just before 1970 + *) + epoch*: Scales.Value; + (* seconds and ... *) + second*: Scales.Value; + (* ... microseconds since the beginning of the epoch *) + usec*: Scales.Value; END; - IF timeval.usec < 0 THEN - toomanysecs := timeval.usec DIV usecsPerSec; - IF toomanysecs > timeval.second THEN - timeval.second := - toomanysecs + MAX(Scales.Value) + 1 + - timeval.second; - DEC(timeval.epoch); - ELSE - DEC(timeval.second, toomanysecs); - END; - timeval.usec := timeval.usec MOD usecsPerSec; - ELSIF timeval.usec >= usecsPerSec THEN - secs := timeval.usec DIV usecsPerSec; - IF MAX(Scales.Value) - timeval.second <= secs THEN - INC(timeval.second, secs); - ELSE - timeval.second := secs - (MAX(Scales.Value) - timeval.second); - INC(timeval.epoch); - END; - timeval.usec := timeval.usec MOD usecsPerSec; - END; - END Normalize; - PROCEDURE SetValue*(time: Time; value: TimeValueRec); - VAR - refTime: Time; - scaleOfTime: Scales.Scale; - BEGIN - Normalize(value); - IF time IS ReferenceTime THEN - WITH time: ReferenceTime DO - time.timeval := value; - END; + (* ==== private datatypes for the reference scale *) + TYPE + ReferenceTime = POINTER TO ReferenceTimeRec; + ReferenceTimeRec = + RECORD + (TimeRec) + timeval: TimeValueRec; + END; + VAR + absType, relType: Services.Type; + CONST + epochUnit = 0; secondUnit = 1; usecUnit = 2; + TYPE + Unit = POINTER TO UnitRec; + UnitRec = + RECORD + (Scales.UnitRec) + index: SHORTINT; (* epochUnit..usecUnit *) + END; + + VAR + scale*: Scales.Scale; (* reference scale *) + family*: Scales.Family; (* family of time scales *) + if: Scales.Interface; + + PROCEDURE Create*(VAR time: Time; type: SHORTINT); + (* type = absolute or relative *) + VAR + m: Scales.Measure; + BEGIN + Scales.CreateMeasure(scale, m, type); + time := m(Time); + END Create; + + PROCEDURE Normalize(VAR timeval: TimeValueRec); + (* make sure that second and usec >= 0 *) + VAR + toomanysecs: Scales.Value; + secs: Scales.Value; + BEGIN + IF timeval.second < 0 THEN + INC(timeval.second, 1); + INC(timeval.second, MAX(Scales.Value)); + DEC(timeval.epoch); + END; + IF timeval.usec < 0 THEN + toomanysecs := timeval.usec DIV usecsPerSec; + IF toomanysecs > timeval.second THEN + timeval.second := - toomanysecs + MAX(Scales.Value) + 1 + + timeval.second; + DEC(timeval.epoch); ELSE - Create(refTime, Scales.MeasureType(time)); - refTime(ReferenceTime).timeval := value; - Scales.GetScale(time, scaleOfTime); - Scales.ConvertMeasure(scaleOfTime, SYSTEM.VAL(Scales.Measure, refTime)); - Operations.Copy(refTime, time); + DEC(timeval.second, toomanysecs); END; - END SetValue; - - PROCEDURE CreateAndSet*(VAR time: Time; type: SHORTINT; - epoch, second, usec: Scales.Value); - VAR - timeval: TimeValueRec; - BEGIN - Create(time, type); - timeval.epoch := epoch; timeval.second := second; timeval.usec := usec; - SetValue(time, timeval); - END CreateAndSet; - - PROCEDURE GetValue*(time: Time; VAR value: TimeValueRec); - BEGIN - IF ~(time IS ReferenceTime) THEN - Scales.ConvertMeasure(scale, SYSTEM.VAL(Scales.Measure, time)); - END; - value := time(ReferenceTime).timeval; - END GetValue; - - (* ===== interface procedures =================================== *) - - PROCEDURE InternalCreate(scale: Scales.Scale; - VAR measure: Scales.Measure; abs: BOOLEAN); - VAR - time: ReferenceTime; - BEGIN - NEW(time); - time.timeval.epoch := 0; - time.timeval.second := 0; - time.timeval.usec := 0; - IF abs THEN - PersistentObjects.Init(time, absType); + timeval.usec := timeval.usec MOD usecsPerSec; + ELSIF timeval.usec >= usecsPerSec THEN + secs := timeval.usec DIV usecsPerSec; + IF MAX(Scales.Value) - timeval.second <= secs THEN + INC(timeval.second, secs); ELSE - PersistentObjects.Init(time, relType); + timeval.second := secs - (MAX(Scales.Value) - timeval.second); + INC(timeval.epoch); END; - measure := time; - END InternalCreate; + timeval.usec := timeval.usec MOD usecsPerSec; + END; + END Normalize; - PROCEDURE InternalGetValue(measure: Scales.Measure; unit: Scales.Unit; - VAR value: Scales.Value); - BEGIN - WITH measure: ReferenceTime DO WITH unit: Unit DO - CASE unit.index OF - | epochUnit: value := measure.timeval.epoch; - | secondUnit: value := measure.timeval.second; - | usecUnit: value := measure.timeval.usec; + PROCEDURE SetValue*(time: Time; value: TimeValueRec); + VAR + refTime: Time; + measure: Scales.Measure; + scaleOfTime: Scales.Scale; + BEGIN + Normalize(value); + IF time IS ReferenceTime THEN + WITH time: ReferenceTime DO + time.timeval := value; + END; ELSE - END; - END; END; - END InternalGetValue; + Create(refTime, Scales.MeasureType(time)); + refTime(ReferenceTime).timeval := value; + Scales.GetScale(time, scaleOfTime); + measure := refTime; + Scales.ConvertMeasure(scaleOfTime, measure); + Operations.Copy(measure, time); + END; + END SetValue; - PROCEDURE InternalSetValue(measure: Scales.Measure; unit: Scales.Unit; - value: Scales.Value); - BEGIN - WITH measure: ReferenceTime DO WITH unit: Unit DO - CASE unit.index OF - | epochUnit: measure.timeval.epoch := value; - | secondUnit: measure.timeval.second := value; - | usecUnit: measure.timeval.usec := value; + PROCEDURE CreateAndSet*(VAR time: Time; type: SHORTINT; + epoch, second, usec: Scales.Value); + VAR + timeval: TimeValueRec; + BEGIN + Create(time, type); + timeval.epoch := epoch; timeval.second := second; timeval.usec := usec; + SetValue(time, timeval); + END CreateAndSet; + + PROCEDURE GetValue*(time: Time; VAR value: TimeValueRec); + VAR mtime: Scales.Measure; + BEGIN + IF ~(time IS ReferenceTime) THEN + Scales.ConvertMeasure(scale, mtime); time := mtime(Time) + END; + value := time(ReferenceTime).timeval; + END GetValue; + + (* ===== interface procedures =================================== *) + + PROCEDURE InternalCreate(scale: Scales.Scale; + VAR measure: Scales.Measure; abs: BOOLEAN); + VAR + time: ReferenceTime; + BEGIN + NEW(time); + time.timeval.epoch := 0; + time.timeval.second := 0; + time.timeval.usec := 0; + IF abs THEN + PersistentObjects.Init(time, absType); ELSE - END; - Normalize(measure.timeval); - END; END; - END InternalSetValue; + PersistentObjects.Init(time, relType); + END; + measure := time; + END InternalCreate; - PROCEDURE Assign(target: Scales.Measure; source: Scales.Measure); - BEGIN - WITH target: ReferenceTime DO WITH source: ReferenceTime DO - target.timeval := source.timeval; - END; END; - END Assign; - - PROCEDURE Op(op: Scales.Operation; op1, op2, result: Scales.Measure); - - PROCEDURE Add(op1, op2: TimeValueRec; VAR result: TimeValueRec); - BEGIN - result.epoch := op1.epoch + op2.epoch; - IF op1.second > MAX(Scales.Value) - op2.second THEN - INC(result.epoch); - result.second := op1.second - MAX(Scales.Value) - 1 + - op2.second; - ELSE - result.second := op1.second + op2.second; - END; - result.usec := op1.usec + op2.usec; - IF result.usec > usecsPerSec THEN - DEC(result.usec, usecsPerSec); - IF result.second = MAX(Scales.Value) THEN - result.second := 0; INC(result.epoch); - ELSE - INC(result.second); - END; - END; - END Add; - - PROCEDURE Sub(op1, op2: TimeValueRec; VAR result: TimeValueRec); - BEGIN - result.epoch := op1.epoch - op2.epoch; - IF op1.second >= op2.second THEN - result.second := op1.second - op2.second; - ELSE - DEC(result.epoch); - result.second := - op2.second + MAX(Scales.Value) + 1 + op1.second; - END; - result.usec := op1.usec - op2.usec; - IF result.usec < 0 THEN - INC(result.usec, usecsPerSec); - IF result.second = 0 THEN - result.second := MAX(Scales.Value); - DEC(result.epoch); - ELSE - DEC(result.second); - END; - END; - END Sub; - - BEGIN - WITH op1: ReferenceTime DO WITH op2: ReferenceTime DO - WITH result: ReferenceTime DO - CASE op OF - | Scales.add: Add(op1.timeval, op2.timeval, result.timeval); - | Scales.sub: Sub(op1.timeval, op2.timeval, result.timeval); - ELSE - END; - END; - END; END; - END Op; - - PROCEDURE Compare(op1, op2: Scales.Measure) : INTEGER; - - PROCEDURE ReturnVal(val1, val2: Scales.Value) : INTEGER; - BEGIN - IF val1 < val2 THEN - RETURN -1 - ELSIF val1 > val2 THEN - RETURN 1 - ELSE - RETURN 0 - END; - END ReturnVal; - - BEGIN - WITH op1: ReferenceTime DO - WITH op2: ReferenceTime DO - IF op1.timeval.epoch # op2.timeval.epoch THEN - RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) - ELSIF op1.timeval.second # op2.timeval.second THEN - RETURN ReturnVal(op1.timeval.second, op2.timeval.second) - ELSE - RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) - END; - END; + PROCEDURE InternalGetValue(measure: Scales.Measure; unit: Scales.Unit; + VAR value: Scales.Value); + BEGIN + WITH measure: ReferenceTime DO WITH unit: Unit DO + CASE unit.index OF + | epochUnit: value := measure.timeval.epoch; + | secondUnit: value := measure.timeval.second; + | usecUnit: value := measure.timeval.usec; + ELSE END; - RETURN 0; - END Compare; + END; END; + END InternalGetValue; - (* ========= initialization procedures ========================== *) - - PROCEDURE InitInterface; - VAR - timeType: Services.Type; - BEGIN - NEW(if); - if.create := InternalCreate; - if.getvalue := InternalGetValue; if.setvalue := InternalSetValue; - if.assign := Assign; if.op := Op; if.compare := Compare; - (* conversion procedures are not necessary *) - - PersistentObjects.RegisterType(timeType, "Times.Time", "Scales.Measure", - NIL); - END InitInterface; - - PROCEDURE CreateAbs(VAR object: PersistentObjects.Object); - VAR - measure: Scales.Measure; - BEGIN - Scales.CreateAbsMeasure(scale, measure); - object := measure; - END CreateAbs; - - PROCEDURE CreateRel(VAR object: PersistentObjects.Object); - VAR - measure: Scales.Measure; - BEGIN - Scales.CreateRelMeasure(scale, measure); - object := measure; - END CreateRel; - - PROCEDURE Write(s: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - BEGIN - WITH object: ReferenceTime DO - RETURN NetIO.WriteLongInt(s, object.timeval.epoch) & - NetIO.WriteLongInt(s, object.timeval.second) & - NetIO.WriteLongInt(s, object.timeval.usec) + PROCEDURE InternalSetValue(measure: Scales.Measure; unit: Scales.Unit; + value: Scales.Value); + BEGIN + WITH measure: ReferenceTime DO WITH unit: Unit DO + CASE unit.index OF + | epochUnit: measure.timeval.epoch := value; + | secondUnit: measure.timeval.second := value; + | usecUnit: measure.timeval.usec := value; + ELSE END; - END Write; + Normalize(measure.timeval); + END; END; + END InternalSetValue; - PROCEDURE Read(s: Streams.Stream; - object: PersistentObjects.Object) : BOOLEAN; - BEGIN - WITH object: ReferenceTime DO - RETURN NetIO.ReadLongInt(s, object.timeval.epoch) & - NetIO.ReadLongInt(s, object.timeval.second) & - NetIO.ReadLongInt(s, object.timeval.usec) + PROCEDURE Assign(target: Scales.Measure; source: Scales.Measure); + BEGIN + WITH target: ReferenceTime DO WITH source: ReferenceTime DO + target.timeval := source.timeval; + END; END; + END Assign; + + PROCEDURE Op(op: Scales.Operation; op1, op2, result: Scales.Measure); + + PROCEDURE Add(op1, op2: TimeValueRec; VAR result: TimeValueRec); + BEGIN + result.epoch := op1.epoch + op2.epoch; + IF op1.second > MAX(Scales.Value) - op2.second THEN + INC(result.epoch); + result.second := op1.second - MAX(Scales.Value) - 1 + + op2.second; + ELSE + result.second := op1.second + op2.second; END; - END Read; + result.usec := op1.usec + op2.usec; + IF result.usec > usecsPerSec THEN + DEC(result.usec, usecsPerSec); + IF result.second = MAX(Scales.Value) THEN + result.second := 0; INC(result.epoch); + ELSE + INC(result.second); + END; + END; + END Add; - PROCEDURE InitRefScale; + PROCEDURE Sub(op1, op2: TimeValueRec; VAR result: TimeValueRec); + BEGIN + result.epoch := op1.epoch - op2.epoch; + IF op1.second >= op2.second THEN + result.second := op1.second - op2.second; + ELSE + DEC(result.epoch); + result.second := - op2.second + MAX(Scales.Value) + 1 + op1.second; + END; + result.usec := op1.usec - op2.usec; + IF result.usec < 0 THEN + INC(result.usec, usecsPerSec); + IF result.second = 0 THEN + result.second := MAX(Scales.Value); + DEC(result.epoch); + ELSE + DEC(result.second); + END; + END; + END Sub; + BEGIN + WITH op1: ReferenceTime DO WITH op2: ReferenceTime DO + WITH result: ReferenceTime DO + CASE op OF + | Scales.add: Add(op1.timeval, op2.timeval, result.timeval); + | Scales.sub: Sub(op1.timeval, op2.timeval, result.timeval); + ELSE + END; + END; + END; END; + END Op; + + PROCEDURE Compare(op1, op2: Scales.Measure) : INTEGER; + + PROCEDURE ReturnVal(val1, val2: Scales.Value) : INTEGER; + BEGIN + IF val1 < val2 THEN + RETURN -1 + ELSIF val1 > val2 THEN + RETURN 1 + ELSE + RETURN 0 + END; + END ReturnVal; + + BEGIN + WITH op1: ReferenceTime DO + WITH op2: ReferenceTime DO + IF op1.timeval.epoch # op2.timeval.epoch THEN + RETURN ReturnVal(op1.timeval.epoch, op2.timeval.epoch) + ELSIF op1.timeval.second # op2.timeval.second THEN + RETURN ReturnVal(op1.timeval.second, op2.timeval.second) + ELSE + RETURN ReturnVal(op1.timeval.usec, op2.timeval.usec) + END; + END; + END; + RETURN 0; + END Compare; + + (* ========= initialization procedures ========================== *) + + PROCEDURE InitInterface; + VAR + timeType: Services.Type; + BEGIN + NEW(if); + if.create := InternalCreate; + if.getvalue := InternalGetValue; if.setvalue := InternalSetValue; + if.assign := Assign; if.op := Op; if.compare := Compare; + (* conversion procedures are not necessary *) + + PersistentObjects.RegisterType(timeType, "Times.Time", "Scales.Measure", + NIL); + END InitInterface; + + PROCEDURE CreateAbs(VAR object: PersistentObjects.Object); + VAR + measure: Scales.Measure; + BEGIN + Scales.CreateAbsMeasure(scale, measure); + object := measure; + END CreateAbs; + + PROCEDURE CreateRel(VAR object: PersistentObjects.Object); + VAR + measure: Scales.Measure; + BEGIN + Scales.CreateRelMeasure(scale, measure); + object := measure; + END CreateRel; + + PROCEDURE Write(s: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + BEGIN + WITH object: ReferenceTime DO + RETURN NetIO.WriteLongInt(s, object.timeval.epoch) & + NetIO.WriteLongInt(s, object.timeval.second) & + NetIO.WriteLongInt(s, object.timeval.usec) + END; + END Write; + + PROCEDURE Read(s: Streams.Stream; + object: PersistentObjects.Object) : BOOLEAN; + BEGIN + WITH object: ReferenceTime DO + RETURN NetIO.ReadLongInt(s, object.timeval.epoch) & + NetIO.ReadLongInt(s, object.timeval.second) & + NetIO.ReadLongInt(s, object.timeval.usec) + END; + END Read; + + PROCEDURE InitRefScale; + + VAR + poif: PersistentObjects.Interface; + + PROCEDURE InitUnit(unitIndex: SHORTINT; name: Scales.UnitName); VAR - poif: PersistentObjects.Interface; + unit: Unit; + BEGIN + NEW(unit); unit.index := unitIndex; + Scales.InitUnit(scale, unit, name); + END InitUnit; - PROCEDURE InitUnit(unitIndex: SHORTINT; name: Scales.UnitName); - VAR - unit: Unit; - BEGIN - NEW(unit); unit.index := unitIndex; - Scales.InitUnit(scale, unit, name); - END InitUnit; + BEGIN + NEW(scale); Scales.Init(scale, NIL, if); + InitUnit(epochUnit, "epoch"); + InitUnit(secondUnit, "second"); + InitUnit(usecUnit, "usec"); - BEGIN - NEW(scale); Scales.Init(scale, NIL, if); - InitUnit(epochUnit, "epoch"); - InitUnit(secondUnit, "second"); - InitUnit(usecUnit, "usec"); - - NEW(poif); poif.read := Read; poif.write := Write; - poif.create := CreateAbs; poif.createAndRead := NIL; - PersistentObjects.RegisterType(absType, - "Times.AbsReferenceTime", "Times.Time", poif); - NEW(poif); poif.read := Read; poif.write := Write; - poif.create := CreateRel; poif.createAndRead := NIL; - PersistentObjects.RegisterType(relType, - "Times.RelReferenceTime", "Times.Time", poif); - END InitRefScale; + NEW(poif); poif.read := Read; poif.write := Write; + poif.create := CreateAbs; poif.createAndRead := NIL; + PersistentObjects.RegisterType(absType, + "Times.AbsReferenceTime", "Times.Time", poif); + NEW(poif); poif.read := Read; poif.write := Write; + poif.create := CreateRel; poif.createAndRead := NIL; + PersistentObjects.RegisterType(relType, + "Times.RelReferenceTime", "Times.Time", poif); + END InitRefScale; BEGIN - InitInterface; - InitRefScale; - NEW(family); Scales.InitFamily(family, scale); + InitInterface; + InitRefScale; + NEW(family); Scales.InitFamily(family, scale); END ulmTimes. diff --git a/src/library/ulm/ulmTypes.Mod b/src/library/ulm/ulmTypes.Mod index c9d6f4fe..93bab9fc 100644 --- a/src/library/ulm/ulmTypes.Mod +++ b/src/library/ulm/ulmTypes.Mod @@ -50,15 +50,8 @@ MODULE ulmTypes; IMPORT SYS := SYSTEM; TYPE - Address* = LONGINT (*SYS.ADDRESS*); - (* ulm compiler can accept - VAR p : SYSTEM.ADDRESS; // SYSTEM.PTR in ETH and V4 versions - ... - p := SYSTEM.ADR(something); - and this is how it is used in ulm oberon system library, - while SYSTEM.ADR returns LONGINT in ETH and V4 versions. - Thus I leave it as LONGINT for now, before coming up with better solution -- noch *) - + Address* = SYS.ADDRESS; + UntracedAddress* = POINTER[1] TO UntracedAddressDesc; (*SYS.UNTRACEDADDRESS;*) UntracedAddressDesc* = RECORD[1] END; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 1ef21940..288fc04b 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -75,6 +75,7 @@ PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'EINTR'; @@ -92,15 +93,18 @@ PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ENOENT()) END Absent; +BEGIN RETURN e = ENOENT() END Absent; PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; +BEGIN RETURN e = ETIMEDOUT() END TimedOut; PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index f91415c5..a538fdc5 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -72,6 +72,7 @@ PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; @@ -100,6 +101,9 @@ PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + (* OS memory allocaton *) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 1d3fd191..16311bd0 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -209,20 +209,20 @@ ooc: @printf "\nMaking ooc library\n" cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod @@ -232,7 +232,7 @@ ooc: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod @@ -255,52 +255,52 @@ ulm: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" @@ -311,7 +311,7 @@ misc: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod @@ -327,13 +327,13 @@ s3: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod -# cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod librarybinary: @printf "\nMaking lib$(ONAME)\n" From 212bcd58b9dd8792dfb302b3195aeab07beb6e5a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Sep 2016 11:38:53 +0100 Subject: [PATCH 061/140] Beginning adding -OC (large model) runtime library --- makefile | 10 +- src/compiler/Compiler.Mod | 9 +- src/compiler/OPC.Mod | 9 +- src/compiler/OPT.Mod | 34 +- src/compiler/OPV.Mod | 1 + src/compiler/extTools.Mod | 1 - src/runtime/Files.Mod | 764 +++++++++++++++++++++++++++ src/runtime/Heap.Mod | 578 +++++++++++++++++++++ src/runtime/In.Mod | 0 src/runtime/LowLReal.Mod | 486 ++++++++++++++++++ src/runtime/LowReal.Mod | 408 +++++++++++++++ src/runtime/Math.Mod | 612 ++++++++++++++++++++++ src/runtime/MathL.Mod | 562 ++++++++++++++++++++ src/runtime/Modules.Mod | 96 ++++ src/runtime/Oberon.Mod | 74 +++ src/runtime/Out.Mod | 55 ++ src/runtime/Platformunix.Mod | 552 ++++++++++++++++++++ src/runtime/Platformwindows.Mod | 622 ++++++++++++++++++++++ src/runtime/Reals.Mod | 136 +++++ src/runtime/Strings.Mod | 156 ++++++ src/runtime/Texts.Mod | 881 ++++++++++++++++++++++++++++++++ src/system/Platformunix.Mod | 6 +- src/tools/make/oberon.mk | 300 ++++++----- 23 files changed, 6183 insertions(+), 169 deletions(-) create mode 100644 src/runtime/Files.Mod create mode 100644 src/runtime/Heap.Mod create mode 100644 src/runtime/In.Mod create mode 100644 src/runtime/LowLReal.Mod create mode 100644 src/runtime/LowReal.Mod create mode 100644 src/runtime/Math.Mod create mode 100644 src/runtime/MathL.Mod create mode 100644 src/runtime/Modules.Mod create mode 100644 src/runtime/Oberon.Mod create mode 100644 src/runtime/Out.Mod create mode 100644 src/runtime/Platformunix.Mod create mode 100644 src/runtime/Platformwindows.Mod create mode 100644 src/runtime/Reals.Mod create mode 100644 src/runtime/Strings.Mod create mode 100644 src/runtime/Texts.Mod diff --git a/makefile b/makefile index df72a78b..5202abb7 100644 --- a/makefile +++ b/makefile @@ -156,13 +156,14 @@ full: configuration @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s O2library + @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges - @make -f src/tools/make/oberon.mk -s install MODEL=2 + @make -f src/tools/make/oberon.mk -s install @printf "\n\n--- Confidence tests started ---\n\n" @make -f src/tools/make/oberon.mk -s confidence MODEL=2 - @make -f src/tools/make/oberon.mk -s showpath MODEL=2 + @make -f src/tools/make/oberon.mk -s showpath assemble: @@ -190,7 +191,8 @@ browsercmd: configuration # library: build all directories under src/library library: configuration - @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s O2library + @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C # Individual library components v4: configuration diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index f27fd578..e5acdac7 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -66,7 +66,14 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.sintobj.typ := OPT.sinttyp; OPT.intobj.typ := OPT.inttyp; - OPT.lintobj.typ := OPT.linttyp + OPT.lintobj.typ := OPT.linttyp; + + (* Enable or disable (non-system) BYTE type *) + IF OPM.Model = "C" THEN + OPT.cpbytetyp.strobj.name[4] := 0X (* Enable Component Pascal non-system BYTE type *) + ELSE + OPT.cpbytetyp.strobj.name[4] := '@' (* Disable Component Pascal non-system BYTE type *) + END END PropagateElementaryTypeSizes; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 4f4839c5..e0313bbe 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -821,10 +821,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) GenHeaderMsg; OPM.WriteLn; - (* Define adjustable type sizes *) - OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + (* Define model dependent type sizes *) + OPM.WriteString("#define SHORTINT int"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; OPM.WriteLn; Include(BasicIncludeFile); diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index ad3afe73..3732b2cb 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -151,13 +151,12 @@ CONST VAR topScope*: Object; - undftyp*, - bytetyp*, booltyp*, chartyp*, - sinttyp*, inttyp*, linttyp*, hinttyp*, - adrtyp*, - int8typ*, int16typ*, int32typ*, int64typ*, - realtyp*, lrltyp*, settyp*, stringtyp*, - niltyp*, notyp*, sysptrtyp*: Struct; + undftyp*, niltyp*, notyp*, + bytetyp*, cpbytetyp*, booltyp*, chartyp*, + sinttyp*, inttyp*, linttyp*, hinttyp*, + int8typ*, int16typ*, int32typ*, int64typ*, + realtyp*, lrltyp*, settyp*, stringtyp*, + adrtyp*, sysptrtyp*: Struct; sintobj*, intobj*, lintobj*: Object; @@ -1295,13 +1294,13 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(niltyp, NilTyp); (*initialization of module SYSTEM*) - EnterTyp("BYTE", Byte, 1, bytetyp); + EnterTyp("BYTE", Byte, 1, bytetyp); EnterTyp("PTR", Pointer, -1, sysptrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("ADDRESS", Int, -1, adrtyp); (* Size set in Compiler.PropagateElementaryTypeSize *) - EnterTyp("INT8", Int, 1, int8typ); - EnterTyp("INT16", Int, 2, int16typ); - EnterTyp("INT32", Int, 4, int32typ); - EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("INT8", Int, 1, int8typ); + EnterTyp("INT16", Int, 2, int16typ); + EnterTyp("INT32", Int, 4, int32typ); + EnterTyp("INT64", Int, 8, int64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); @@ -1320,12 +1319,13 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, 1, booltyp); - EnterTyp("CHAR", Char, 1, chartyp); + EnterTyp("BOOLEAN", Bool, 1, booltyp); + EnterTyp("CHAR", Char, 1, chartyp); EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) - EnterTyp("REAL", Real, 4, realtyp); - EnterTyp("LONGREAL", LReal, 8, lrltyp); - EnterTyp("HUGEINT", Int, 8, hinttyp); + EnterTyp("REAL", Real, 4, realtyp); + EnterTyp("LONGREAL", LReal, 8, lrltyp); + EnterTyp("HUGEINT", Int, 8, hinttyp); + EnterTyp("BYTE@", Int, 1, cpbytetyp); (* Component Pascal byte type, enabled in Compiler.PropagateElementaryTypeSize *) EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 34d1ef34..39bfeded 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -137,6 +137,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 (* mark basic types as predefined, OPC.Ident can avoid qualification*) OPT.chartyp^.strobj^.linkadr := PredefinedType; + OPT.cpbytetyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.adrtyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index f158fd60..077fb5a5 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -76,4 +76,3 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition END extTools. -, \ No newline at end of file diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod new file mode 100644 index 00000000..7e497627 --- /dev/null +++ b/src/runtime/Files.Mod @@ -0,0 +1,764 @@ +MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) + + IMPORT SYSTEM, Platform, Heap, Strings, Out; + + (* standard data type I/O + + little endian, + Sint:1, Int:2, Lint:4 + ORD({0}) = 1, + false = 0, true =1 + IEEE real format, + null terminated strings, + compact numbers according to M.Odersky *) + + + CONST + nofbufs = 4; + bufsize = 4096; + noDesc = -1; + notDone = -1; + + (* file states *) + open = 0; (* OS File has been opened *) + create = 1; (* OS file needs to be created *) + close = 2; (* Register telling Create to use registerName directly: + i.e. since we're closing and all data is still in + buffers bypass writing to temp file and then renaming + and just write directly to fianl register name *) + + + TYPE + FileName = ARRAY 101 OF CHAR; + File* = POINTER TO FileDesc; + Buffer = POINTER TO BufDesc; + + FileDesc = RECORD + workName: FileName; + registerName: FileName; + tempFile: BOOLEAN; + identity: Platform.FileIdentity; + fd-: Platform.FileHandle; + len, pos: LONGINT; + bufs: ARRAY nofbufs OF Buffer; + swapper: INTEGER; + state: INTEGER; + next: File; + END; + + BufDesc = RECORD + f: File; + chg: BOOLEAN; + org: LONGINT; + size: LONGINT; + data: ARRAY bufsize OF SYSTEM.BYTE + END; + + Rider* = RECORD + res*: LONGINT; + eof*: BOOLEAN; + buf: Buffer; + org: LONGINT; + offset: LONGINT + END; + + + VAR + files: File; (* List of files that have an OS file handle/descriptor assigned *) + tempno: INTEGER; + HOME: ARRAY 1024 OF CHAR; + SearchPath: POINTER TO ARRAY OF CHAR; + + + + + PROCEDURE -IdxTrap "__HALT(-1)"; + + PROCEDURE^ Finalize(o: SYSTEM.PTR); + + PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); + BEGIN + Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); + IF f # NIL THEN + IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; + IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END + END; + IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; + Out.Ln; + HALT(99) + END Err; + + PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN i := 0; j := 0; + WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; + IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; + WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; + dest[i] := 0X + END MakeFileName; + + PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); + VAR n, i, j: LONGINT; + BEGIN + INC(tempno); n := tempno; i := 0; + IF finalName[0] # "/" THEN (* relative pathname *) + WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; + IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END + END; + j := 0; + WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; + DEC(i); + WHILE name[i] # "/" DO DEC(i) END; + name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := "."; INC(i); n := Platform.PID; + WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; + name[i] := 0X + END GetTempName; + + PROCEDURE Create(f: File); + VAR + identity: Platform.FileIdentity; + done: BOOLEAN; + error: Platform.ErrorCode; + err: ARRAY 32 OF CHAR; + BEGIN + (* + Out.String("Files.Create fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; + *) + IF f.fd = noDesc THEN + IF f.state = create THEN + GetTempName(f.registerName, f.workName); f.tempFile := TRUE + ELSIF f.state = close THEN + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END; + error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) + + error := Platform.New(f.workName, f.fd); + done := error = 0; + IF done THEN + f.next := files; files := f; + INC(Heap.FileCount); + Heap.RegisterFinalizer(f, Finalize); + f.state := open; + f.pos := 0; + error := Platform.Identify(f.fd, f.identity); + ELSE + IF Platform.NoSuchDirectory(error) THEN err := "no such directory" + ELSIF Platform.TooManyFiles(error) THEN err := "too many files open" + ELSE err := "file not created" + END; + Err(err, f, error) + END + END + END Create; + + PROCEDURE Flush(buf: Buffer); + VAR + error: Platform.ErrorCode; + f: File; + (* identity: Platform.FileIdentity; *) + BEGIN + (* + Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); + Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); + Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); + Out.String(", size "); Out.Int(buf.size,1); Out.Ln; + *) + IF buf.chg THEN f := buf.f; Create(f); + IF buf.org # f.pos THEN + error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); + (* + Out.String("Seeking to "); Out.Int(buf.org,1); + Out.String(", error code "); Out.Int(error,1); Out.Ln; + *) + END; + error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); + IF error # 0 THEN Err("error writing file", f, error) END; + f.pos := buf.org + buf.size; + buf.chg := FALSE; + error := Platform.Identify(f.fd, f.identity); + IF error # 0 THEN Err("error identifying file", f, error) END; + (* + error := Platform.Identify(f.fd, identity); + f.identity.mtime := identity.mtime; + *) + END + END Flush; + + + PROCEDURE CloseOSFile(f: File); + (* Close the OS file handle and remove f from 'files' *) + VAR prev: File; error: Platform.ErrorCode; + BEGIN + IF files = f THEN files := f.next + ELSE + prev := files; + WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; + IF prev.next # NIL THEN prev.next := f.next END + END; + error := Platform.Close(f.fd); + f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + END CloseOSFile; + + + PROCEDURE Close* (f: File); + VAR + i: LONGINT; + error: Platform.ErrorCode; + BEGIN + IF (f.state # create) OR (f.registerName # "") THEN + Create(f); i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + error := Platform.Sync(f.fd); + IF error # 0 THEN Err("error writing file", f, error) END; + CloseOSFile(f); + END + END Close; + + PROCEDURE Length* (f: File): LONGINT; + BEGIN RETURN f.len END Length; + + PROCEDURE New* (name: ARRAY OF CHAR): File; + VAR f: File; + BEGIN + NEW(f); f.workName := ""; COPY(name, f.registerName); + f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + RETURN f + END New; + + PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); + (* Extract next individual directory from searchpath starting at pos, + updating pos and returning dir. + Supports ~, ~user and blanks inside path *) + VAR i: INTEGER; ch: CHAR; + BEGIN + i := 0; + IF SearchPath = NIL THEN + IF pos = 0 THEN + dir[0] := "."; i := 1; INC(pos) (* Default search path is just the current directory *) + END + ELSE + ch := SearchPath[pos]; + WHILE (ch = " ") OR (ch = ";") DO INC(pos); ch := SearchPath[pos] END; + IF ch = "~" THEN + INC(pos); ch := SearchPath[pos]; + WHILE HOME[i] # 0X DO dir[i] := HOME[i]; INC(i) END; + IF (ch # "/") & (ch # 0X) & (ch # ";") & (ch # " ") THEN + WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END + END + END; + WHILE (ch # 0X) & (ch # ";") DO dir[i] := ch; INC(i); INC(pos); ch := SearchPath[pos] END; + WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END + END; + dir[i] := 0X + END ScanPath; + + PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; ch := name[0]; + WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END; + RETURN ch = "/" + END HasDir; + + PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; + VAR f: File; i: INTEGER; error: Platform.ErrorCode; + BEGIN f := files; + WHILE f # NIL DO + IF Platform.SameFile(identity, f.identity) THEN + IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; + INC(i) + END; + f.swapper := -1; f.identity := identity; + error := Platform.Size(f.fd, f.len); + END; + RETURN f + END; + f := f.next + END; + RETURN NIL + END CacheEntry; + + PROCEDURE Old*(name: ARRAY OF CHAR): File; + VAR + f: File; + fd: Platform.FileHandle; + pos: INTEGER; + done: BOOLEAN; + dir, path: ARRAY 256 OF CHAR; + error: Platform.ErrorCode; + identity: Platform.FileIdentity; + BEGIN + (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) + IF name # "" THEN + IF HasDir(name) THEN dir := ""; COPY(name, path) + ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) + END; + LOOP + error := Platform.OldRW(path, fd); done := error = 0; + IF ~done & Platform.TooManyFiles(error) THEN Err("too many files open", f, error) END; + IF ~done & Platform.Inaccessible(error) THEN + error := Platform.OldRO(path, fd); done := error = 0; + END; + IF ~done & ~Platform.Absent(error) THEN + Out.String("Warning: Files.Old "); Out.String(name); + Out.String(" error = "); Out.Int(error, 0); Out.Ln; + END; + IF done THEN + (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) + error := Platform.Identify(fd, identity); + f := CacheEntry(identity); + IF f # NIL THEN + (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) + RETURN f + ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); + f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + error := Platform.Size(fd, f.len); + COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; + f.identity := identity; + f.next := files; files := f; INC(Heap.FileCount); + RETURN f + END + ELSIF dir = "" THEN RETURN NIL + ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) + END + END + ELSE RETURN NIL + END + END Old; + + PROCEDURE Purge* (f: File); + VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; + BEGIN i := 0; + WHILE i < nofbufs DO + IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; + INC(i) + END; + IF f.fd # noDesc THEN + error := Platform.Truncate(f.fd, 0); + error := Platform.Seek(f.fd, 0, Platform.SeekSet) + END; + f.pos := 0; f.len := 0; f.swapper := -1; + error := Platform.Identify(f.fd, identity); Platform.SetMTime(f.identity, identity) + END Purge; + + PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); + VAR + identity: Platform.FileIdentity; error: Platform.ErrorCode; + BEGIN + Create(f); error := Platform.Identify(f.fd, identity); + Platform.MTimeAsClock(identity, t, d) + END GetDate; + + PROCEDURE Pos* (VAR r: Rider): LONGINT; + BEGIN RETURN r.org + r.offset + END Pos; + + PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); + VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; + BEGIN + IF f # NIL THEN + (* + Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; + *) + IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; + offset := pos MOD bufsize; org := pos - offset; i := 0; + WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; + IF i < nofbufs THEN + IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf + ELSE buf := f.bufs[i] + END + ELSE + f.swapper := (f.swapper + 1) MOD nofbufs; + buf := f.bufs[f.swapper]; + Flush(buf) + END; + IF buf.org # org THEN + IF org = f.len THEN buf.size := 0 + ELSE Create(f); + IF f.pos # org THEN error := Platform.Seek(f.fd, org, Platform.SeekSet) END; + error := Platform.ReadBuf(f.fd, buf.data, n); + IF error # 0 THEN Err("read from file not done", f, error) END; + f.pos := org + n; + buf.size := n + END; + buf.org := org; buf.chg := FALSE + END + ELSE buf := NIL; org := 0; offset := 0 + END; + r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 + END Set; + + PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; + BEGIN + buf := r.buf; offset := r.offset; + IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + IF (offset < buf.size) THEN + x := buf.data[offset]; r.offset := offset + 1 + ELSIF r.org + offset < buf.f.len THEN + Set(r, r.buf.f, r.org + offset); + x := r.buf.data[0]; r.offset := 1 + ELSE + x := 0X; r.eof := TRUE + END + END Read; + + PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + restInBuf := buf.size - offset; + IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN + ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + END; + r.res := 0; r.eof := FALSE + END ReadBytes; + + PROCEDURE Base* (VAR r: Rider): File; + BEGIN RETURN r.buf.f + END Base; + + PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; + BEGIN + buf := r.buf; offset := r.offset; + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + buf.data[offset] := x; + buf.chg := TRUE; + IF offset = buf.size THEN + INC(buf.size); INC(buf.f.len) + END; + r.offset := offset + 1; r.res := 0 + END Write; + + PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); + VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; + BEGIN + IF n > LEN(x) THEN IdxTrap END; + xpos := 0; buf := r.buf; offset := r.offset; + WHILE n > 0 DO + IF (r.org # buf.org) OR (offset >= bufsize) THEN + Set(r, buf.f, r.org + offset); + buf := r.buf; offset := r.offset + END; + restInBuf := bufsize - offset; + IF n > restInBuf THEN min := restInBuf ELSE min := n END; + SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + INC(offset, min); r.offset := offset; + IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; + INC(xpos, min); DEC(n, min); buf.chg := TRUE + END; + r.res := 0 + END WriteBytes; + +(* another solution would be one that is similar to ReadBytes, WriteBytes. +No code duplication, more symmetric, only two ifs for +Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +must be made consistent with offset (if offset > buf.size) in a lazy way. + +PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); + VAR buf: Buffer; offset: LONGINT; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= bufsize) OR (r.org # buf.org) THEN + Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; + END; + buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE +END Write; + +PROCEDURE WriteBytes ... + +PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); + VAR offset: LONGINT; buf: Buffer; +BEGIN + buf := r.buf; offset := r.offset; + IF (offset >= buf.size) OR (r.org # buf.org) THEN + IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN + ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset + END + END; + x := buf.data[offset]; r.offset := offset + 1 +END Read; + +but this would also affect Set, Length, and Flush. +Especially Length would become fairly complex. +*) + + PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN res := Platform.Unlink(name) END Delete; + + PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); + VAR + fdold, fdnew: Platform.FileHandle; + n: LONGINT; + error, ignore: Platform.ErrorCode; + oldidentity, newidentity: Platform.FileIdentity; + buf: ARRAY 4096 OF CHAR; + BEGIN + (* + Out.String("Files.Rename old = "); Out.String(old); + Out.String(", new = "); Out.String(new); Out.Ln; + *) + error := Platform.IdentifyByName(old, oldidentity); + IF error = 0 THEN + error := Platform.IdentifyByName(new, newidentity); + IF (error # 0) & ~Platform.SameFile(oldidentity, newidentity) THEN + Delete(new, error); (* work around stale nfs handles *) + END; + error := Platform.Rename(old, new); + (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) + IF ~Platform.DifferentFilesystems(error) THEN + res := error; RETURN + ELSE + (* cross device link, move the file *) + error := Platform.OldRO(old, fdold); + IF error # 0 THEN res := 2; RETURN END; + error := Platform.New(new, fdnew); + IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + WHILE n > 0 DO + error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); + IF error # 0 THEN + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + Err("cannot move file", NIL, error) + END; + error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + END; + ignore := Platform.Close(fdold); + ignore := Platform.Close(fdnew); + IF n = 0 THEN + error := Platform.Unlink(old); res := 0 + ELSE + Err("cannot move file", NIL, error) + END; + END + ELSE + res := 2 (* old file not found *) + END + END Rename; + + PROCEDURE Register* (f: File); + VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; + BEGIN + (* + Out.String("Files.Register f.registerName = "); Out.String(f.registerName); + Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; + *) + IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; + Close(f); + IF f.registerName # "" THEN + Rename(f.workName, f.registerName, errcode); + (* + Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); + Out.String(" from workname "); Out.String(f.workName); + Out.String(" to registerName "); Out.String(f.registerName); + Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; + *) + IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; + f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE + END + END Register; + + PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); + BEGIN + res := Platform.Chdir(path); + END ChangeDirectory; + + PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); + VAR i, j: LONGINT; + BEGIN + IF ~Platform.LittleEndian THEN i := LEN(src); j := 0; + WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END + ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) + END + END FlipBytes; + + PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); + BEGIN Read(R, SYSTEM.VAL(CHAR, x)) + END ReadBool; + + PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN ReadBytes(R, b, 2); + x := ORD(b[0]) + ORD(b[1])*256 + END ReadInt; + + PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); + x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H + END ReadLInt; + + PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); + (* Reads 32 bits as a SET value (even on 64 bit systems. See Oakwood appendix 1.2.5.4 *) + VAR b: ARRAY 4 OF CHAR; l: LONGINT; + BEGIN ReadBytes(R, b, 4); + (* Need to read via a LONGINT to provide correct behaviour for 64 bit sets. *) + l := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H; + x := SYSTEM.VAL(SET, l) + END ReadSet; + + PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) + END ReadReal; + + PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) + END ReadLReal; + + PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; + BEGIN i := 0; + REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X + END ReadString; + + PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); + VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + BEGIN + i := 0; + b := FALSE; + REPEAT + Read(R, ch); + IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN + b := TRUE + ELSE + x[i] := ch; + INC(i); + END; + UNTIL b + END ReadLine; + + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); + VAR s: SHORTINT; ch: CHAR; n: LONGINT; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + END ReadNum; + + PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); + (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms + VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; + BEGIN s := 0; n := 0; Read(R, ch); + WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; + INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); + x := n + *) + VAR n: LONGINT; + BEGIN ReadNum(R, n); x := n + END ReadNum64; + + PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); + BEGIN Write(R, SYSTEM.VAL(CHAR, x)) + END WriteBool; + + PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); + VAR b: ARRAY 2 OF CHAR; + BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); + WriteBytes(R, b, 2); + END WriteInt; + + PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); + VAR b: ARRAY 4 OF CHAR; + BEGIN + b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); + WriteBytes(R, b, 4); + END WriteLInt; + + PROCEDURE WriteSet* (VAR R: Rider; x: SET); + VAR b: ARRAY 4 OF CHAR; i: LONGINT; + BEGIN i := SYSTEM.VAL(LONGINT, x); + b[0] := CHR(i); b[1] := CHR(i DIV 100H); b[2] := CHR(i DIV 10000H); b[3] := CHR(i DIV 1000000H); + WriteBytes(R, b, 4); + END WriteSet; + + PROCEDURE WriteReal* (VAR R: Rider; x: REAL); + VAR b: ARRAY 4 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) + END WriteReal; + + PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); + VAR b: ARRAY 8 OF CHAR; + BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) + END WriteLReal; + + PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE x[i] # 0X DO INC(i) END; + WriteBytes(R, x, i+1) + END WriteString; + + PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum; + + PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); + BEGIN + WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; + Write(R, CHR(x MOD 128)) + END WriteNum64; + + PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); + BEGIN + COPY (f.workName, name); + END GetName; + + PROCEDURE Finalize(o: SYSTEM.PTR); + VAR f: File; res: LONGINT; + BEGIN + f := SYSTEM.VAL(File, o); + (* + Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); + Out.String(", f.registername = "); Out.String(f.registerName); + Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; + *) + IF f.fd >= 0 THEN + CloseOSFile(f); + IF f.tempFile THEN res := Platform.Unlink(f.workName) END + END + END Finalize; + + PROCEDURE SetSearchPath*(path: ARRAY OF CHAR); + BEGIN + IF Strings.Length(path) # 0 THEN + NEW(SearchPath, Strings.Length(path)+1); + COPY(path, SearchPath^) + ELSE + SearchPath := NIL + END + END SetSearchPath; + + +BEGIN + tempno := -1; + Heap.FileCount := 0; + HOME := ""; Platform.GetEnv("HOME", HOME); +END Files. diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod new file mode 100644 index 00000000..b05b218b --- /dev/null +++ b/src/runtime/Heap.Mod @@ -0,0 +1,578 @@ +MODULE Heap; + + IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete + before any other modules are initialized. *) + + CONST + ModNameLen = 20; + CmdNameLen = 24; + SZA = SIZE(S.ADDRESS); (* Size of address *) + Unit = 4*SZA; (* smallest possible heap block *) + nofLists = 9; (* number of free_lists *) + heapSize0 = 8000*Unit; (* startup heap size *) + + (* all blocks look the same: + free blocks describe themselves: size = Unit + tag = &tag++ + ->block size + sentinel = -SZA + next + *) + + (* heap chunks *) + nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) + blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) + + (* heap blocks *) + tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) + sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = S.VAL(S.ADDRESS, -SZA); + AddressZero = S.VAL(S.ADDRESS, 0); + + TYPE + ModuleName = ARRAY ModNameLen OF CHAR; + CmdName = ARRAY CmdNameLen OF CHAR; + + Module = POINTER TO ModuleDesc; + Cmd = POINTER TO CmdDesc; + + EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); + + ModuleDesc = RECORD + next: Module; + name: ModuleName; + refcnt: LONGINT; + cmds: Cmd; + types: S.ADDRESS; + enumPtrs: EnumProc; + reserved1, reserved2: LONGINT + END ; + + Command = PROCEDURE; + + CmdDesc = RECORD + next: Cmd; + name: CmdName; + cmd: Command + END ; + + Finalizer = PROCEDURE(obj: S.PTR); + + FinNode = POINTER TO FinDesc; + FinDesc = RECORD + next: FinNode; + obj: S.ADDRESS; (* weak pointer *) + marked: BOOLEAN; + finalize: Finalizer; + END ; + + VAR + (* the list of loaded (=initialization started) modules *) + modules*: S.PTR; + + freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: S.ADDRESS; + allocated*: S.ADDRESS; + firstTry: BOOLEAN; + + (* extensible heap *) + heap: S.ADDRESS; (* the sorted list of heap chunks *) + heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) + + (* finalization candidates *) + fin: FinNode; + + (* garbage collector locking *) + lockdepth: INTEGER; + interrupted: BOOLEAN; + + (* File system file count monitor *) + FileCount*: INTEGER; + + + PROCEDURE Lock*; + BEGIN + INC(lockdepth); + END Lock; + + PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; + + PROCEDURE Unlock*; + BEGIN + DEC(lockdepth); + IF interrupted & (lockdepth = 0) THEN + PlatformHalt(-9); + END + END Unlock; + + + (* + PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) + VAR oldflag : BOOLEAN; + BEGIN + oldflag := flag; + flag := TRUE; + RETURN oldflag; + END TAS; + *) + + PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; + VAR m: Module; + BEGIN + (* REGMOD is called at the start of module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the Heap module itself, we + must use S.NEW. *) + IF name = "Heap" THEN + S.NEW(m, SIZE(ModuleDesc)) + ELSE + NEW(m) + END; + m.types := 0; m.cmds := NIL; + COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); + modules := m; + RETURN m + END REGMOD; + + PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); + VAR c: Cmd; + BEGIN + (* REGCMD is called during module initialisation code before that modules + type descriptors have been set up. 'NEW' depends on the Heap modules type + descriptors being ready for use, therefore, just for the commands registered + by the Heap module itself, we must use S.NEW. *) + IF m.name = "Heap" THEN + S.NEW(c, SIZE(CmdDesc)) + ELSE + NEW(c) + END; + COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c + END REGCMD; + + PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); + BEGIN S.PUT(typ, m.types); m.types := typ + END REGTYP; + + PROCEDURE INCREF*(m: Module); + BEGIN INC(m.refcnt) + END INCREF; + + + PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; + + PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; + VAR chnk: S.ADDRESS; + BEGIN + chnk := OSAllocate(blksz + blkOff); + IF chnk # 0 THEN + S.PUT(chnk + endOff, chnk + (blkOff + blksz)); + S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); + S.PUT(chnk + (blkOff + sizeOff), blksz); + S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); + S.PUT(chnk + (blkOff + nextOff), bigBlocks); + bigBlocks := chnk + blkOff; + INC(heapsize, blksz) + END ; + RETURN chnk + END NewChunk; + + PROCEDURE ExtendHeap(blksz: S.ADDRESS); + VAR size, chnk, j, next: S.ADDRESS; + BEGIN + IF blksz > 10000*Unit THEN size := blksz + ELSE size := 10000*Unit (* additional heuristics *) + END ; + chnk := NewChunk(size); + IF chnk # 0 THEN + (*sorted insertion*) + IF chnk < heap THEN + S.PUT(chnk, heap); heap := chnk + ELSE + j := heap; S.GET(j, next); + WHILE (next # 0) & (chnk > next) DO + j := next; + S.GET(j, next) + END; + S.PUT(chnk, next); S.PUT(j, chnk) + END ; + IF next = 0 THEN S.GET(chnk+endOff, heapend) END + END + END ExtendHeap; + + PROCEDURE ^GC*(markStack: BOOLEAN); + + PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; + VAR + i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; + new: S.PTR; + BEGIN + Lock(); + S.GET(tag, blksz); + + ASSERT((Unit = 16) OR (Unit = 32)); + ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); + ASSERT(blksz MOD Unit = 0); + + i0 := blksz DIV Unit; i := i0; + IF i < nofLists THEN adr := freeList[i]; + WHILE adr = 0 DO INC(i); adr := freeList[i] END + END ; + IF i < nofLists THEN (* unlink *) + S.GET(adr + nextOff, next); + freeList[i] := next; + IF i # i0 THEN (* split *) + di := i - i0; restsize := di * Unit; end := adr + restsize; + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr; + INC(adr, restsize) + END + ELSE + adr := bigBlocks; prev := 0; + LOOP + IF adr = 0 THEN + IF firstTry THEN + GC(TRUE); INC(blksz, Unit); + IF (heapsize - allocated - blksz) * 4 < heapsize THEN + (* heap is still almost full; expand to avoid thrashing *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) + END ; + firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; + IF new = NIL THEN + (* depending on the fragmentation, the heap may not have been extended by + the anti-thrashing heuristics above *) + ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); + new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) + END ; + Unlock(); RETURN new + ELSE + Unlock(); RETURN NIL + END + END ; + S.GET(adr+sizeOff, t); + IF t >= blksz THEN EXIT END ; + prev := adr; S.GET(adr + nextOff, adr) + END ; + restsize := t - blksz; end := adr + restsize; + S.PUT(end + sizeOff, blksz); + S.PUT(end + sntlOff, NoPtrSntl); + S.PUT(end, end + sizeOff); + IF restsize > nofLists * Unit THEN (*resize*) + S.PUT(adr + sizeOff, restsize) + ELSE (*unlink*) + S.GET(adr + nextOff, next); + IF prev = 0 THEN bigBlocks := next + ELSE S.PUT(prev + nextOff, next); + END ; + IF restsize > 0 THEN (*move*) + di := restsize DIV Unit; + S.PUT(adr + sizeOff, restsize); + S.PUT(adr + nextOff, freeList[di]); + freeList[di] := adr + END + END ; + INC(adr, restsize) + END ; + i := adr + 4*SZA; end := adr + blksz; + WHILE i < end DO (*deliberately unrolled*) + S.PUT(i, AddressZero); + S.PUT(i + SZA, AddressZero); + S.PUT(i + 2*SZA, AddressZero); + S.PUT(i + 3*SZA, AddressZero); + INC(i, 4*SZA) + END ; + S.PUT(adr + nextOff, AddressZero); + S.PUT(adr, tag); + S.PUT(adr + sizeOff, AddressZero); + S.PUT(adr + sntlOff, AddressZero); + INC(allocated, blksz); + Unlock(); + RETURN S.VAL(S.PTR, adr + SZA) + END NEWREC; + + PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; + VAR blksz, tag: S.ADDRESS; new: S.PTR; + BEGIN + Lock(); + blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) + new := NEWREC(S.ADR(blksz)); + tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; + S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) + S.PUT(tag, blksz); + S.PUT(tag + SZA, NoPtrSntl); + S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); + Unlock(); + RETURN new + END NEWBLK; + + PROCEDURE Mark(q: S.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; + BEGIN + IF q # 0 THEN + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + IF ~ODD(tagbits) THEN (* If it has not already been marked *) + S.PUT(q - SZA, tagbits + 1); (* Mark it *) + p := 0; + tag := tagbits + SZA; (* Tag addresses first offset *) + LOOP + S.GET(tag, offset); (* Get next ptr field offset *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) + S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) + IF p = 0 THEN EXIT END ; + n := q; q := p; + S.GET(q - SZA, tag); DEC(tag, 1); + S.GET(tag, offset); fld := q + offset; + S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) + ELSE (* offset references a ptr field *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) + IF n # 0 THEN (* If pointer is not NIL *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + IF ~ODD(tagbits) THEN + S.PUT(n - SZA, tagbits + 1); + S.PUT(q - SZA, tag + 1); + S.PUT(fld, S.VAL(S.PTR, p)); + p := q; q := n; + tag := tagbits + END + END + END ; + INC(tag, SZA) + END + END + END + END Mark; + + PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) + BEGIN + Mark(S.VAL(S.ADDRESS, p)) + END MarkP; + + PROCEDURE Scan; + VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; + BEGIN bigBlocks := 0; i := 1; + WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; + freesize := 0; allocated := 0; chnk := heap; + WHILE chnk # 0 DO + adr := chnk + blkOff; + S.GET(chnk + endOff, end); + WHILE adr < end DO + S.GET(adr, tag); + IF ODD(tag) THEN (*marked*) + IF freesize > 0 THEN + start := adr - freesize; + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + DEC(tag, 1); + S.PUT(adr, tag); + S.GET(tag, size); + INC(allocated, size); + INC(adr, size) + ELSE (*unmarked*) + S.GET(tag, size); + INC(freesize, size); + INC(adr, size) + END + END ; + IF freesize > 0 THEN (*collect last block*) + start := adr - freesize; + S.PUT(start, start+SZA); + S.PUT(start+sizeOff, freesize); + S.PUT(start+sntlOff, NoPtrSntl); + i := freesize DIV Unit; freesize := 0; + IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start + ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start + END + END ; + S.GET(chnk, chnk) + END + END Scan; + + PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR i, j, x: S.ADDRESS; + BEGIN j := l; x := a[j]; + LOOP i := j; j := 2*j + 1; + IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; + IF (j > r) OR (a[j] <= x) THEN EXIT END; + a[i] := a[j] + END; + a[i] := x + END Sift; + + PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); + VAR l, r, x: S.ADDRESS; + BEGIN l := n DIV 2; r := n - 1; + WHILE l > 0 DO DEC(l); Sift(l, r, a) END; + WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END + END HeapSort; + + PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; + BEGIN + chnk := heap; i := 0; lim := cand[n-1]; + WHILE (chnk # 0 ) & (chnk < lim) DO + adr := chnk + blkOff; + S.GET(chnk + endOff, lim1); + IF lim < lim1 THEN lim1 := lim END ; + WHILE adr < lim1 DO + S.GET(adr, tag); + IF ODD(tag) THEN (*already marked*) + S.GET(tag-1, size); INC(adr, size) + ELSE + S.GET(tag, size); + ptr := adr + SZA; + WHILE cand[i] < ptr DO INC(i) END ; + IF i = n THEN RETURN END ; + next := adr + size; + IF cand[i] < next THEN Mark(ptr) END ; + adr := next + END + END ; + S.GET(chnk, chnk) + END + END MarkCandidates; + + PROCEDURE CheckFin; + VAR n: FinNode; tag: S.ADDRESS; + BEGIN + n := fin; + WHILE n # NIL DO + S.GET(n.obj - SZA, tag); + IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) + ELSE n.marked := TRUE + END ; + n := n.next + END + END CheckFin; + + PROCEDURE Finalize; + VAR n, prev: FinNode; + BEGIN n := fin; prev := NIL; + WHILE n # NIL DO + IF ~n.marked THEN + IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; + n.finalize(S.VAL(S.PTR, n.obj)); + (* new nodes may have been pushed in n.finalize, therefore: *) + IF prev = NIL THEN n := fin ELSE n := n.next END + ELSE + prev := n; n := n.next + END + END + END Finalize; + + PROCEDURE FINALL*; + VAR n: FinNode; + BEGIN + WHILE fin # NIL DO + n := fin; fin := fin.next; + n.finalize(S.VAL(S.PTR, n.obj)) + END + END FINALL; + + PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; + + PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); + VAR + frame: S.PTR; + inc, nofcand: S.ADDRESS; + sp, p, stack0: S.ADDRESS; + align: RECORD ch: CHAR; p: S.PTR END ; + BEGIN + IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) + IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) + END ; + IF n = 0 THEN + nofcand := 0; sp := S.ADR(frame); + stack0 := PlatformMainStackFrame(); + (* check for minimum alignment of pointers *) + inc := S.ADR(align.p) - S.ADR(align); + IF sp > stack0 THEN inc := -inc END ; + WHILE sp # stack0 DO + S.GET(sp, p); + IF (p > heap) & (p < heapend) THEN + IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; + cand[nofcand] := p; INC(nofcand) + END ; + INC(sp, inc) + END ; + IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END + END + END MarkStack; + + PROCEDURE GC*(markStack: BOOLEAN); + VAR + m: Module; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; + cand: ARRAY 10000 OF S.ADDRESS; + BEGIN + IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN + Lock(); + m := S.VAL(Module, modules); + WHILE m # NIL DO + IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; + m := m^.next + END ; + IF markStack THEN + (* generate register pressure to force callee saved registers to memory; + may be simplified by inlining OS calls or processor specific instructions + *) + i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; + i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; + i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; + LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); + INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); + INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); + IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END + END ; + IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) + END ; + END; + CheckFin; + Scan; + Finalize; + Unlock() + END + END GC; + + PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); + VAR f: FinNode; + BEGIN NEW(f); + f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; + f.next := fin; fin := f; + END RegisterFinalizer; + + +PROCEDURE -ExternHeapInit "extern void *Heap__init();"; +PROCEDURE -HeapModuleInit 'Heap__init()'; + + PROCEDURE InitHeap*; + (* InitHeap is called by Platform.init before any module bodies have been + initialised, to enable NEW, S.NEW *) + BEGIN + heap := NewChunk(heapSize0); + S.GET(heap + endOff, heapend); + S.PUT(heap, AddressZero); + allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; + FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; + interrupted := FALSE; + + HeapModuleInit; + END InitHeap; + +END Heap. diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod new file mode 100644 index 00000000..e69de29b diff --git a/src/runtime/LowLReal.Mod b/src/runtime/LowLReal.Mod new file mode 100644 index 00000000..b90958b2 --- /dev/null +++ b/src/runtime/LowLReal.Mod @@ -0,0 +1,486 @@ +(* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) +MODULE oocLowLReal; + +(* ToDo. support 64 bit builds *) + +(* + LowLReal - Gives access to the underlying properties of the type LONGREAL + for IEEE double-precision numbers. + Copyright (C) 1996 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + + +IMPORT Low := LowReal, S := SYSTEM; + +(* + + Real number properties are defined as follows: + + radix--The whole number value of the radix used to represent the + corresponding read number values. + + places--The whole number value of the number of radix places used + to store values of the corresponding real number type. + + expoMin--The whole number value of the exponent minimum. + + expoMax--The whole number value of the exponent maximum. + + large--The largest value of the corresponding real number type. + + small--The smallest positive value of the corresponding real number + type, represented to maximal precision. + + IEC559--A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 + (IEEE 754:1987) in all regards. + + NOTES + 6 -- If `IEC559' is TRUE, the value of `radix' is 2. + 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 + is used for the type REAL. + 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 + is used for the type REAL. + + LIA1--A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967-1:199x + (LIA-1) in all regards: parameters, arithmetic, exceptions, and + notification. + + rounds--A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number + type nearest to the mathematical result. + + gUnderflow--A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. + + exception--A Boolean value that is TRUE if and only if every operation that + attempts to produce a real value out of range raises an exception. + + extend--A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than + the stored values. + + nModes--The whole number value giving the number of bit positions needed for + the status flags for mode control. + +*) + +CONST + radix*= 2; + places*= 53; + expoMax*= 1023; + expoMin*= 1-expoMax; + large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) + (*small*= 2.2250738585072014D-308;*) + small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); + IEC559*= TRUE; + LIA1*= FALSE; + rounds*= FALSE; + gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) + exception*= FALSE; (* at least in the default implementation *) + extend*= FALSE; + nModes*= 0; + ONE=1.0D0; (* some commonly-used constants *) + ZERO=0.0D0; + TEN=1.0D1; + + DEBUG = TRUE; + + expOffset=expoMax; + hiBit=19; + expBit=hiBit+1; + nMask={0..hiBit,31}; (* number mask *) + expMask={expBit..30}; (* exponent mask *) + +TYPE + Modes*= SET; + LongInt=ARRAY 2 OF LONGINT; + LongSet=ARRAY 2 OF SET; + +VAR + (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) + isBigEndian-: BOOLEAN; (* set when target is big endian *) + (* + PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) + VAR k : INTEGER; + p : LONGREAL; + BEGIN + k := 1; + p := i; + REPEAT + p := p * i; + INC(k); + UNTIL k=j; + RETURN p; + END power0; +*) + +(* Errors are handled through the LowReal module *) + +PROCEDURE err*(): INTEGER; +BEGIN + RETURN Low.err +END err; + +PROCEDURE ClearError*; +BEGIN + Low.ClearError +END ClearError; + +PROCEDURE ErrorHandler*(err: INTEGER); +BEGIN + Low.ErrorHandler(err) +END ErrorHandler; + +(* type-casting utilities *) + +PROCEDURE Move (VAR x: LONGREAL; VAR ra: ARRAY OF LONGINT); +(* typecast a LONGREAL to an array of LONGINTs *) + VAR t: LONGINT; +BEGIN + S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END +END Move; + +PROCEDURE MoveSet (VAR x: LONGREAL; VAR ra: ARRAY OF SET); +(* typecast a LONGREAL to an array of LONGINTs *) + VAR t: SET; +BEGIN + S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END +END MoveSet; + +(* Note: The below should be done with a type cast -- + once the compiler supports such things. *) +(*<* PUSH; Warnings := FALSE *>*) +PROCEDURE Real * (ra: ARRAY OF LONGINT): LONGREAL; +(* typecast an array of big endian LONGINTs to a LONGREAL *) + VAR t: LONGINT; x: LONGREAL; +BEGIN + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; + S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); + RETURN x +END Real; + +PROCEDURE ToReal (ra: ARRAY OF SET): LONGREAL; +(* typecast an array of LONGINTs to a LONGREAL *) + VAR t: SET; x: LONGREAL; +BEGIN + IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; + S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); + RETURN x +END ToReal; +(*<* POP *> *) + +PROCEDURE exponent*(x: LONGREAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. + *) + VAR ra: LongInt; +BEGIN + (* NOTE: x=0.0 should raise exception *) + IF x=ZERO THEN RETURN 0 + ELSE Move(x, ra); + RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset + END +END exponent; + +PROCEDURE exponent10*(x: LONGREAL): INTEGER; +(* + The value of the call exponent10(x) shall be the base 10 exponent + value of `x'. An exception shall occur and may be raised if `x' is + equal to 0.0. + *) +VAR exp: INTEGER; +BEGIN + IF x=ZERO THEN RETURN 0 END; (* exception could be raised here *) + exp:=0; x:=ABS(x); + WHILE x>=TEN DO x:=x/TEN; INC(exp) END; + WHILE x<1 DO x:=x*TEN; DEC(exp) END; + RETURN exp +END exponent10; + +PROCEDURE fraction*(x: LONGREAL): LONGREAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + CONST eZero={(hiBit+2)..29}; + VAR ra: LongInt; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE Move(x, ra); + ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); + RETURN Real(ra)*2.0D0 + END +END fraction; + +PROCEDURE IsInfinity * (real: LONGREAL) : BOOLEAN; + CONST signMask={0..30}; + VAR ra: LongSet; +BEGIN + MoveSet(real, ra); + RETURN (ra[0]*signMask=expMask) & (ra[1]={}) +END IsInfinity; + +PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; + CONST fracMask={0..hiBit}; + VAR ra: LongSet; +BEGIN + MoveSet(real, ra); + RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) +END IsNaN; + +PROCEDURE sign*(x: LONGREAL): LONGREAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF xexpoMax THEN RETURN large*sign(x) (* exception raised here *) + ELSIF exp= TEN DO x := x/TEN; INC(exp) END; + WHILE (x > ZERO) & (x < 1.0) DO x := x*TEN; DEC(exp) END; + RETURN exp +END exponent10; + +(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) + +PROCEDURE fraction*(x: REAL): REAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) +VAR c: CHAR; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE + (* Set top 7 bits of exponent to 0111111 *) + S.GET(S.ADR(x)+3, c); + c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) + S.PUT(S.ADR(x)+3, c); + (* Set bottom bit of exponent to 0 *) + S.GET(S.ADR(x)+2, c); + c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) + S.PUT(S.ADR(x)+2, c); + RETURN x * 2.0; + END +(* + CONST eZero={(hiBit+2)..29}; +BEGIN + IF x=ZERO THEN RETURN ZERO + ELSE RETURN S.VAL(REAL,(S.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) + END +*) +END fraction; + +PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; + VAR c0, c1, c2, c3: CHAR; +BEGIN + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) +END IsInfinity; + +PROCEDURE IsNaN * (real: REAL) : BOOLEAN; + VAR c0, c1, c2, c3: CHAR; +BEGIN + S.GET(S.ADR(real)+0, c3); + S.GET(S.ADR(real)+1, c2); + S.GET(S.ADR(real)+2, c1); + S.GET(S.ADR(real)+3, c0); + RETURN (ORD(c0) MOD 128 = 127) + & (ORD(c1) DIV 128 = 1) + & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) +END IsNaN; + +PROCEDURE sign*(x: REAL): REAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + SetExponent(x, SHORT(exp)); + (* SetExponent replaces these 2 lines: + lexp := S.VAL(SET, S.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) + RETURN S.VAL(REAL, (S.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) + *) +END scale; + +PROCEDURE ulp*(x: REAL): REAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: REAL): REAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: REAL): REAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; + +PROCEDURE intpart*(x: REAL): REAL; +(* + The value of the call intpart(x) shall be the integral part of `x'. + For negative values, this shall be -intpart(abs(x)). +*) + VAR loBit: INTEGER; +BEGIN + loBit := (hiBit+1) - exponent(x); + IF loBit <= 0 THEN RETURN x (* no fractional part *) + ELSIF loBit <= hiBit+1 THEN + RETURN S.VAL(REAL,S.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) + ELSE RETURN ZERO (* no whole part *) + END +END intpart; + +PROCEDURE fractpart*(x: REAL): REAL; +(* + The value of the call fractpart(x) shall be the fractional part of + `x'. This satifies the relationship fractpart(x)+intpart(x)=x. +*) +BEGIN + RETURN x-intpart(x) +END fractpart; + +PROCEDURE trunc*(x: REAL; n: INTEGER): REAL; +(* + The value of the call trunc(x,n) shall be the value of the most + significant `n' places of `x'. An exception shall occur and may be + raised if `n' is less than or equal to zero. +*) + VAR loBit: INTEGER; mask: SET; +BEGIN loBit:=places-n; + IF n<=0 THEN RETURN ZERO (* exception should be raised *) + ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) + ELSE mask:={loBit..31}; (* truncation bit mask *) + RETURN S.VAL(REAL,S.VAL(SET,x)*mask) + END +END trunc; + +PROCEDURE round*(x: REAL; n: INTEGER): REAL; +(* + The value of the call round(x,n) shall be the value of `x' rounded to + the most significant `n' places. An exception shall occur and may be + raised if such a value does not exist, or if `n' is less than or equal + to zero. +*) + VAR loBit: INTEGER; num, mask: SET; r: REAL; +BEGIN loBit:=places-n; + IF n<=0 THEN RETURN ZERO (* exception should be raised *) + ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) + ELSE mask:={loBit..31}; num:=S.VAL(SET,x); (* truncation bit mask and number as SET *) + x:=S.VAL(REAL,num*mask); (* truncated result *) + IF loBit-1 IN num THEN (* check if result should be rounded *) + r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) + IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) + ELSE RETURN x+r (* positive rounding toward +infinity *) + END + ELSE RETURN x (* return truncated result *) + END + END +END round; + +PROCEDURE synthesize*(expart: INTEGER; frapart: REAL): REAL; +(* + The value of the call synthesize(expart,frapart) shall be a value of + the corresponding real number type contructed from the value of + `expart' and `frapart'. This value shall satisfy the relationship + synthesize(exponent(x),fraction(x)) = x. +*) +BEGIN + RETURN scale(frapart, expart) +END synthesize; + + +PROCEDURE setMode*(m: Modes); +(* + The call setMode(m) shall set status flags from the value of `m', + appropriate to the underlying implementation of the corresponding real + number type. + + NOTES + 3 -- Many implementations of floating point provide options for + setting flags within the system which control details of the handling + of the type. Although two procedures are provided, one for each real + number type, the effect may be the same. Typical effects that can be + obtained by this means are: + a) Ensuring that overflow will raise an exception; + b) Allowing underflow to raise an exception; + c) Controlling the rounding; + d) Allowing special values to be produced (e.g. NaNs in + implementations conforming to IEC 559:1989 (IEEE 754:1987)); + e) Ensuring that special valu access will raise an exception; + Since these effects are so varied, the values of type `Modes' that may + be used are not specified by this International Standard. + 4 -- The effects of `setMode' on operation on values of the + corresponding real number type in coroutines other than the calling + coroutine is not defined. Implementations are not require to preserve + the status flags (if any) with the coroutine state. +*) +BEGIN + (* hardware dependent mode setting of coprocessor *) +END setMode; + +PROCEDURE currentMode*(): Modes; +(* + The value of the call currentMode() shall be the current status flags + (in the form set by `setMode'), or the default status flags (if + `setMode' is not used). + + NOTE 5 -- The value of the call currentMode() is not necessarily the + value of set by `setMode', since a call of `setMode' might attempt to + set flags that cannot be set by the program. +*) +BEGIN + RETURN {} +END currentMode; + +PROCEDURE IsLowException*(): BOOLEAN; +(* + Returns TRUE if the current coroutine is in the exceptional execution state + because of the raising of the LowReal exception; otherwise returns FALSE. +*) +BEGIN + RETURN FALSE +END IsLowException; + +BEGIN + (* install the default error handler -- just sets err variable *) + ErrorHandler:=DefaultHandler; +(* tmp := power0(2,126); (* this is test to calculate small as a variable at runtime; -- noch *) + small := sml; + small := 1/power0(2,126); + *) +END LowReal. + + diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod new file mode 100644 index 00000000..c2a648c9 --- /dev/null +++ b/src/runtime/Math.Mod @@ -0,0 +1,612 @@ +(* $Id: RealMath.Mod,v 1.6 1999/09/02 13:19:17 acken Exp $ *) +MODULE oocRealMath; + +(* MathL - Oakwood REAL Mathematics. + Adapted (with minimal changes) from OOC RealMath.Mod *) + +(* + RealMath - Target independent mathematical functions for REAL + (IEEE single-precision) numbers. + + Numerical approximations are taken from "Software Manual for the + Elementary Functions" by Cody & Waite and "Computer Approximations" + by Hart et al. + + Copyright (C) 1995 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + +IMPORT l := LowReal, S := SYSTEM; + +CONST + pi* = 3.1415926535897932384626433832795028841972; + e* = 2.7182818284590452353602874713526624977572; + + ZERO=0.0; ONE=1.0; HALF=0.5; TWO=2.0; (* local constants *) + + (* internally-used constants *) + huge = l.large; (* largest number this package accepts *) + miny = ONE/huge; (* smallest number this package accepts *) + sqrtHalf = 0.70710678118654752440; + Limit = 2.4414062E-4; (* 2**(-MantBits/2) *) + eps = 2.9802322E-8; (* 2**(-MantBits-1) *) + piInv = 0.31830988618379067154; (* 1/pi *) + piByTwo = 1.57079632679489661923132; + piByFour = 0.78539816339744830962; + lnv = 0.6931610107421875; (* should be exact *) + vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213; + + (* error/exception codes *) + NoError*=0; IllegalRoot*=1; IllegalLog*=2; Overflow*=3; IllegalPower*=4; IllegalLogBase*=5; + IllegalTrig*=6; IllegalInvTrig*=7; HypInvTrigClipped*=8; IllegalHypInvTrig*=9; + LossOfAccuracy*=10; Underflow*=11; + +VAR + a1: ARRAY 18 OF REAL; (* lookup table for power function *) + a2: ARRAY 9 OF REAL; (* lookup table for power function *) + em: REAL; (* largest number such that 1+epsilon > 1.0 *) + LnInfinity: REAL; (* natural log of infinity *) + LnSmall: REAL; (* natural log of very small number *) + SqrtInfinity: REAL; (* square root of infinity *) + TanhMax: REAL; (* maximum Tanh value *) + t: REAL; (* internal variables *) + +(* internally used support routines *) + +PROCEDURE SinCos (x, y, sign: REAL): REAL; + CONST + ymax=9099; (* ENTIER(pi*2**(MantBits/2)) *) + r1=-0.1666665668E+0; + r2= 0.8333025139E-2; + r3=-0.1980741872E-3; + r4= 0.2601903036E-5; + VAR + n: LONGINT; xn, f, g: REAL; +BEGIN + IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine the reduced number *) + n:=ENTIER(y*piInv+HALF); xn:=n; + IF ODD(n) THEN sign:=-sign END; + x:=ABS(x); + IF x#y THEN xn:=xn-HALF END; + + (* fractional part of reduced number *) + f:=SHORT(ABS(LONG(x)) - LONG(xn)*pi); + + (* Pre: |f| <= pi/2 *) + IF ABS(f)= 0 *) + CONST + P0=0.41731; P1=0.59016; + VAR + xMant, yEst, z: REAL; xExp: INTEGER; +BEGIN + (* optimize zeros and check for illegal negative roots *) + IF x=ZERO THEN RETURN ZERO END; + IF x=LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF x 0 *) + CONST + c1=355.0/512.0; c2=-2.121944400546905827679E-4; + A0=-0.5527074855E+0; B0=-0.6632718214E+1; + VAR f, zn, zd, r, z, w, xn: REAL; n: INTEGER; +BEGIN + (* ensure illegal inputs are trapped and handled *) + IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + + (* reduce the range of the input *) + f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; + IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + END; + + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) + z:=zn/zd; w:=z*z; r:=z+z*(w*A0/(w+B0)); + + (* scale the output *) + xn:=n; + RETURN (xn*c2+r)+xn*c1 +END ln; + +(* The angle in all trigonometric functions is measured in radians *) + +PROCEDURE sin*(x: REAL): REAL; + (* Returns the sine of x for all x *) +BEGIN + IF xymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine n and the fraction f *) + n:=round(x*twoByPi); xn:=n; + f:=SHORT(LONG(x)-LONG(xn)*piByTwo); + + (* check for underflow *) + IF ABS(f)HALF THEN + i:=1-flag; + IF y>ONE THEN l.ErrorHandler(IllegalInvTrig); res:=huge; RETURN END; + + (* reduce the input argument *) + g:=(ONE-y)*HALF; r:=-sqrt(g); y:=r+r; + + (* compute approximation *) + r:=((P2*g+P1)*g)/((g+Q1)*g+Q0); + res:=y+(y*r) + ELSE + i:=flag; + IF yONE THEN f:=ONE/f; n:=2 + ELSE n:=0 + END; + + (* check if f should be scaled *) + IF f>rt32 THEN f:=(((a*f-HALF)-HALF)+f)/(rt3+f); INC(n) END; + + (* check for underflow *) + IF ABS(f)1 THEN res:=-res END; + CASE n OF + | 1: res:=res+piBySix + | 2: res:=res+piByTwo + | 3: res:=res+piByThree + | ELSE (* do nothing *) + END; + RETURN res +END atan; + +PROCEDURE arctan*(x: REAL): REAL; + (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +BEGIN + IF x<0 THEN RETURN -atan(-x) + ELSE RETURN atan(x) + END +END arctan; + +PROCEDURE power*(base, exponent: REAL): REAL; + (* Returns the value of the number base raised to the power exponent + for base > 0 *) + CONST P1=0.83357541E-1; K=0.4426950409; + Q1=0.69314675; Q2=0.24018510; Q3=0.54360383E-1; + OneOver16=0.0625; XMAX=16*(l.expoMax+1)-1; (*XMIN=16*l.expoMin;*) XMIN=-2016; (* to make it easier for voc; -- noch *) + VAR z, g, R, v, u2, u1, w1, w2: REAL; w: LONGREAL; + m, p, i: INTEGER; mp, pp, iw1: LONGINT; +BEGIN + (* handle all possible error conditions *) + IF base<=ZERO THEN + IF base#ZERO THEN l.ErrorHandler(IllegalPower); base:=-base + ELSIF exponent>ZERO THEN RETURN ZERO + ELSE l.ErrorHandler(IllegalPower); RETURN huge + END + END; + + (* extract the exponent of base to m and clear exponent of base in g *) + g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + + (* determine p table offset with an unrolled binary search *) + p:=1; + IF g<=a1[9] THEN p:=9 END; + IF g<=a1[p+4] THEN INC(p, 4) END; + IF g<=a1[p+2] THEN INC(p, 2) END; + + (* compute scaled z so that |z| <= 0.044 *) + z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + + (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) + v:=z*z; R:=P1*v*z; R:=R+K*R; u2:=(R+z*K)+z; + u1:=(m*16-p)*OneOver16; w:=LONG(exponent)*(LONG(u1)+LONG(u2)); (* need extra precision *) + + (* calculations below were modified to work properly -- incorrect in cited reference? *) + iw1:=ENTIER(16*w); w1:=iw1*OneOver16; w2:=SHORT(w-w1); + + (* check for overflow/underflow *) + IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; z:=((Q3*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + RETURN l.scale(z, SHORT(mp)) +END power; + +PROCEDURE IsRMathException*(): BOOLEAN; + (* Returns TRUE if the current coroutine is in the exceptional execution state + because of the raising of the RealMath exception; otherwise returns FALSE. + *) +BEGIN + RETURN FALSE +END IsRMathException; + + +(* + Following routines are provided as extensions to the ISO standard. + They are either used as the basis of other functions or provide + useful functions which are not part of the ISO standard. +*) + +PROCEDURE log* (x, base: REAL): REAL; +(* log(x,base) is the logarithm of x base 'base'. All positive arguments are + allowed but base > 0 and base # 1 *) +BEGIN + (* log(x, base) = ln(x) / ln(base) *) + IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + ELSE RETURN ln(x)/ln(base) + END +END log; + +PROCEDURE ipower* (x: REAL; base: INTEGER): REAL; +(* ipower(x, base) returns the x to the integer power base where Log2(x) < expoMax *) + VAR Exp: INTEGER; y: REAL; neg: BOOLEAN; + + PROCEDURE Adjust(xadj: REAL): REAL; + BEGIN + IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + END; + + (* trap potential overflows and underflows *) + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) + ELSIF Exp<-y THEN RETURN ZERO + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly + altered : p442, The Art Of Computer Programming, Vol 2 *) + y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + LOOP + IF ODD(base) THEN y:=y*x END; + base:=base DIV 2; IF base=0 THEN EXIT END; + x:=x*x; + END; + IF neg THEN RETURN ONE/y ELSE RETURN y END +END ipower; + +PROCEDURE sincos* (x: REAL; VAR Sin, Cos: REAL); +(* More efficient sin/cos implementation if both values are needed. *) +BEGIN + Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) +END sincos; + +PROCEDURE arctan2* (xn, xd: REAL): REAL; +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the + denominator xd is zero, then the numerator xn must not be zero. All + arguments are legal except xn = xd = 0. *) +VAR + res: REAL; xpdiff: LONGINT; +BEGIN + (* check for error conditions *) + IF xd=ZERO THEN + IF xn=ZERO THEN l.ErrorHandler(IllegalTrig); RETURN ZERO + ELSIF xn<0 THEN RETURN -piByTwo + ELSE RETURN piByTwo + END; + ELSE + xpdiff:=l.exponent(xn)-l.exponent(xd); + IF ABS(xpdiff)>=l.expoMax-3 THEN + (* overflow detected *) + IF xn<0 THEN RETURN -piByTwo + ELSE RETURN piByTwo + END + ELSE + res:=ABS(xn/xd); + IF res#ZERO THEN res:=atan(res) END; + IF xdLnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); f:=(f-ONE/f)*HALF + END; + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END +END sinh; + +PROCEDURE cosh* (x: REAL): REAL; +(* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large + that exp(|x|) overflows. *) + VAR y, f: REAL; +BEGIN y:=ABS(x); + IF y>LnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + END +END cosh; + +PROCEDURE tanh* (x: REAL): REAL; +(* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) + CONST P0=-0.8237728127; P1=-0.3831010665E-2; Q0=2.471319654; ln3over2=0.5493061443; + BIG=9.010913347; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + VAR f, t: REAL; +BEGIN f:=ABS(x); + IF f>BIG THEN t:=ONE + ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) + ELSIF fSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); + IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x+sqrt(x*x-ONE)) + END +END arccosh; + +PROCEDURE arctanh* (x: REAL): REAL; +(* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where + em is machine epsilon. Note that |x| must not be so close to 1 that the + result is less accurate than half precision. *) + CONST TanhLimit=0.999984991; (* Tanh(5.9) *) + VAR t: REAL; +BEGIN t:=ABS(x); + IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); + IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) + END; + RETURN arcsinh(x/sqrt(ONE-x*x)) +END arctanh; + +BEGIN + (* determine some fundamental constants used by hyperbolic trig functions *) + em:=l.ulp(ONE); + LnInfinity:=ln(huge); + LnSmall:=ln(miny); + SqrtInfinity:=sqrt(huge); + t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + + (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + a1[1] :=ONE; + a1[2] :=S.VAL(REAL, 3F75257DH); + a1[3] :=S.VAL(REAL, 3F6AC0C7H); + a1[4] :=S.VAL(REAL, 3F60CCDFH); + a1[5] :=S.VAL(REAL, 3F5744FDH); + a1[6] :=S.VAL(REAL, 3F4E248CH); + a1[7] :=S.VAL(REAL, 3F45672AH); + a1[8] :=S.VAL(REAL, 3F3D08A4H); + a1[9] :=S.VAL(REAL, 3F3504F3H); + a1[10]:=S.VAL(REAL, 3F2D583FH); + a1[11]:=S.VAL(REAL, 3F25FED7H); + a1[12]:=S.VAL(REAL, 3F1EF532H); + a1[13]:=S.VAL(REAL, 3F1837F0H); + a1[14]:=S.VAL(REAL, 3F11C3D3H); + a1[15]:=S.VAL(REAL, 3F0B95C2H); + a1[16]:=S.VAL(REAL, 3F05AAC3H); + a1[17]:=HALF; + + (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + a2[1]:=S.VAL(REAL, 31A92436H); + a2[2]:=S.VAL(REAL, 336C2A95H); + a2[3]:=S.VAL(REAL, 31A8FC24H); + a2[4]:=S.VAL(REAL, 331F580CH); + a2[5]:=S.VAL(REAL, 336A42A1H); + a2[6]:=S.VAL(REAL, 32C12342H); + a2[7]:=S.VAL(REAL, 32E75624H); + a2[8]:=S.VAL(REAL, 32CF9890H) +END oocRealMath. diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod new file mode 100644 index 00000000..8732fee9 --- /dev/null +++ b/src/runtime/MathL.Mod @@ -0,0 +1,562 @@ +MODULE MathL; + +(* MathL - Oakwood LONGREAL Mathematics. + Adapted (with minimal changes) from OOC LRealMath.Mod *) + +(* + LRealMath - Target independent mathematical functions for LONGREAL + (IEEE double-precision) numbers. + + Numerical approximations are taken from "Software Manual for the + Elementary Functions" by Cody & Waite and "Computer Approximations" + by Hart et al. + + Copyright (C) 1996-1998 Michael Griebling + + This module is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +*) + +IMPORT l := LowLReal, m := Math, SYSTEM; + +CONST + pi* = 3.1415926535897932384626433832795028841972D0; + e* = 2.7182818284590452353602874713526624977572D0; + + ZERO=0.0D0; ONE=1.0D0; HALF=0.5D0; TWO=2.0D0; (* local constants *) + + (* internally-used constants *) + huge = l.large; (* largest number this package accepts *) + miny = l.small; (* smallest number this package accepts *) + sqrtHalf = 0.70710678118654752440D0; + Limit = 1.0536712D-8; (* 2**(-MantBits/2) *) + eps = 5.5511151D-17; (* 2**(-MantBits-1) *) + piInv = 0.31830988618379067154D0; (* 1/pi *) + piByTwo = 1.57079632679489661923D0; + lnv = 0.6931610107421875D0; (* should be exact *) + vbytwo = 0.13830277879601902638D-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213D0; + + (* error/exception codes *) + NoError*=m.NoError; IllegalRoot*=m.IllegalRoot; IllegalLog*=m.IllegalLog; Overflow*=m.Overflow; + IllegalPower*=m.IllegalPower; IllegalLogBase*=m.IllegalLogBase; IllegalTrig*=m.IllegalTrig; + IllegalInvTrig*=m.IllegalInvTrig; HypInvTrigClipped*=m.HypInvTrigClipped; + IllegalHypInvTrig*=m.IllegalHypInvTrig; LossOfAccuracy*=m.LossOfAccuracy; + +VAR + a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1+epsilon > 1.0 *) + LnInfinity: LONGREAL; (* natural log of infinity *) + LnSmall: LONGREAL; (* natural log of very small number *) + SqrtInfinity: LONGREAL; (* square root of infinity *) + TanhMax: LONGREAL; (* maximum Tanh value *) + t: LONGREAL; (* internal variables *) + +(* internally used support routines *) + +PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; + CONST + ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) + c1=3.1416015625D0; + c2=-8.908910206761537356617D-6; + r1=-0.16666666666666665052D+0; + r2= 0.83333333333331650314D-2; + r3=-0.19841269841201840457D-3; + r4= 0.27557319210152756119D-5; + r5=-0.25052106798274584544D-7; + r6= 0.16058936490371589114D-9; + r7=-0.76429178068910467734D-12; + r8= 0.27204790957888846175D-14; + VAR + n: LONGINT; xn, f, x1, g: LONGREAL; +BEGIN + IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + + (* determine the reduced number *) + n:=ENTIER(y*piInv+HALF); xn:=n; + IF ODD(n) THEN sign:=-sign END; + x:=ABS(x); + IF x#y THEN xn:=xn-HALF END; + + (* fractional part of reduced number *) + x1:=ENTIER(x); + f:=((x1-xn*c1)+(x-x1))-xn*c2; + + (* Pre: |f| <= pi/2 *) + IF ABS(f)= 0 *) + CONST + P0=0.41731; P1=0.59016; + VAR + xMant, yEst, z: LONGREAL; xExp: INTEGER; +BEGIN + (* optimize zeros and check for illegal negative roots *) + IF x=ZERO THEN RETURN ZERO END; + IF xLnInfinity THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF x=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) + ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) + END; + xn:=n; g:=(x-xn*c1)-xn*c2; + + (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) + z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; + RETURN l.scale(HALF+p/(q-p), n+1) +END exp; + +PROCEDURE ln*(x: LONGREAL): LONGREAL; + (* Returns the natural logarithm of x for x > 0 *) + CONST + c1=355.0D0/512.0D0; c2=-2.121944400546905827679D-4; + P0=-0.64124943423745581147D+2; P1=0.16383943563021534222D+2; P2=-0.78956112887491257267D+0; + Q0=-0.76949932108494879777D+3; Q1=0.31203222091924532844D+3; Q2=-0.35667977739034646171D+2; + VAR f, zn, zd, r, z, w, p, q, xn: LONGREAL; n: INTEGER; +BEGIN + (* ensure illegal inputs are trapped and handled *) + IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + + (* reduce the range of the input *) + f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; + IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF + ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + END; + + (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) + z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); + + (* scale the output *) + xn:=n; + RETURN (xn*c2+r)+xn*c1 +END ln; + + +(* The angle in all trigonometric functions is measured in radians *) + +PROCEDURE sin* (x: LONGREAL): LONGREAL; +BEGIN + IF xONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + ELSE RETURN arctan2(x, sqrt(ONE-x*x)) + END +END arcsin; + +PROCEDURE arccos*(x: LONGREAL): LONGREAL; + (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) +BEGIN + IF ABS(x)>ONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + ELSE RETURN arctan2(sqrt(ONE-x*x), x) + END +END arccos; + +PROCEDURE arctan*(x: LONGREAL): LONGREAL; + (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +BEGIN + RETURN arctan2(x, ONE) +END arctan; + +PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; + (* Returns the value of the number base raised to the power exponent + for base > 0 *) + CONST + P1=0.83333333333333211405D-1; P2=0.12500000000503799174D-1; + P3=0.22321421285924258967D-2; P4=0.43445775672163119635D-3; + K=0.44269504088896340736D0; + Q1=0.69314718055994529629D+0; Q2=0.24022650695909537056D+0; + Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; + Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; + Q7=0.14928852680595608186D-4; + OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) + VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; +BEGIN + (* handle all possible error conditions *) + IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END + END; + + (* extract the exponent of base to m and clear exponent of base in g *) + g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + + (* determine p table offset with an unrolled binary search *) + p:=1; + IF g<=a1[9] THEN p:=9 END; + IF g<=a1[p+4] THEN INC(p, 4) END; + IF g<=a1[p+2] THEN INC(p, 2) END; + + (* compute scaled z so that |z| <= 0.044 *) + z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + + (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) + v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + + (* generate w with extra precision calculations *) + y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; + w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; + w1:=ENTIER(16*w)*OneOver16; w2:=w2+(w-w1); w:=ENTIER(16*w2)*OneOver16; + iw1:=ENTIER(16*(w+w1)); w2:=w2-w; + + (* check for overflow/underflow *) + IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge + ELSIF iw1ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; + mp:=div(iw1, 16)+i; pp:=16*mp-iw1; + z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; + RETURN l.scale(z, SHORT(mp)) +END power; + +PROCEDURE round*(x: LONGREAL): LONGINT; + (* Returns the value of x rounded to the nearest integer *) +BEGIN + IF x 0 and base # 1. *) +BEGIN + (* log(x, base) = log2(x) / log2(base) *) + IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + ELSE RETURN ln(x)/ln(base) + END +END log; + +PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; +(* ipower(x, base) returns the x to the integer power base where base*Log2(x) < Log2(Max) *) + VAR y: LONGREAL; neg: BOOLEAN; Exp: LONGINT; + + PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; + BEGIN + IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + END; + + (* trap potential overflows and underflows *) + Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; + IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) + ELSIF Exp<-y THEN RETURN ZERO + END; + + (* compute x**base using an optimised algorithm from Knuth, slightly + altered : p442, The Art Of Computer Programming, Vol 2 *) + y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + LOOP + IF ODD(base) THEN y:=y*x END; + base:=base DIV 2; IF base=0 THEN EXIT END; + x:=x*x; + END; + IF neg THEN RETURN ONE/y ELSE RETURN y END +END ipower; + +PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); +(* More efficient sin/cos implementation if both values are needed. *) +BEGIN + Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) +END sincos; + +PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; +(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the + denominator xd is zero, then the numerator xn must not be zero. All + arguments are legal except xn = xd = 0. *) + CONST + P0=0.216062307897242551884D+3; P1=0.3226620700132512059245D+3; + P2=0.13270239816397674701D+3; P3=0.1288838303415727934D+2; + Q0=0.2160623078972426128957D+3; Q1=0.3946828393122829592162D+3; + Q2=0.221050883028417680623D+3; Q3=0.3850148650835119501D+2; + PiOver2=pi/2; Sqrt3=1.7320508075688772935D0; + VAR atan, z, z2, p, q: LONGREAL; xnExp, xdExp: INTEGER; Quadrant: SHORTINT; +BEGIN + IF ABS(xd)=l.expoMax-3 THEN l.ErrorHandler(Overflow); atan:=PiOver2 + ELSIF xnExp-xdExpABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 + ELSE z:=ABS(xn/xd); Quadrant:=0 + END; + + (* further reduce range to within 0 to 2-sqrt(3) *) + IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; + + (* approximation from "Computer Approximations" table ARCTN 5075 *) + IF ABS(z)1 THEN atan:=-atan END; + CASE Quadrant OF + 1: atan:=atan+pi/6 + | 2: atan:=atan+PiOver2 + | 3: atan:=atan+pi/3 + | ELSE (* angle is correct *) + END + END; + + (* map negative xds into the correct quadrant *) + IF xdLnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); f:=(f-ONE/f)*HALF + END; + + (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) + IF x>ZERO THEN RETURN f ELSE RETURN -f END +END sinh; + +PROCEDURE cosh* (x: LONGREAL): LONGREAL; +(* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large + that exp(|x|) overflows. *) + VAR y, f: LONGREAL; +BEGIN y:=ABS(x); + IF y>LnInfinity THEN (* handle exp overflows *) + y:=y-lnv; + IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); + IF x>ZERO THEN RETURN huge ELSE RETURN -huge END + ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) + END + ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + END +END cosh; + +PROCEDURE tanh* (x: LONGREAL): LONGREAL; +(* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) + CONST + P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; + Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; + ln3over2=0.54930614433405484570D0; + BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + VAR f, t: LONGREAL; +BEGIN f:=ABS(x); + IF f>BIG THEN t:=ONE + ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) + ELSIF fSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); + IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x+sqrt(x*x-ONE)) + END +END arccosh; + +PROCEDURE arctanh* (x: LONGREAL): LONGREAL; +(* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where + em is machine epsilon. Note that |x| must not be so close to 1 that the + result is less accurate than half precision. *) + CONST TanhLimit=0.999984991D0; (* Tanh(5.9) *) + VAR t: LONGREAL; +BEGIN t:=ABS(x); + IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); + IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) + END; + RETURN arcsinh(x/sqrt(ONE-x*x)) +END arctanh; + +PROCEDURE ToLONGREAL(h: HUGEINT): LONGREAL; +BEGIN RETURN SYSTEM.VAL(LONGREAL, h) +END ToLONGREAL; + +BEGIN + (* determine some fundamental constants used by hyperbolic trig functions *) + em:=l.ulp(ONE); + LnInfinity:=ln(huge); + LnSmall:=ln(miny); + SqrtInfinity:=sqrt(huge); + t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + + (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + (* disable compiler warnings about 32-bit negative integers *) + (*<* PUSH; Warnings := FALSE *>*) + a1[ 1] := ONE; + a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); + a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); + a1[ 4] := ToLONGREAL(3FEC199BDD85529CH); + a1[ 5] := ToLONGREAL(3FEAE89F995AD3ADH); + a1[ 6] := ToLONGREAL(3FE9C49182A3F090H); + a1[ 7] := ToLONGREAL(3FE8ACE5422AA0DBH); + a1[ 8] := ToLONGREAL(3FE7A11473EB0186H); + a1[ 9] := ToLONGREAL(3FE6A09E667F3BCCH); + a1[10] := ToLONGREAL(3FE5AB07DD485429H); + a1[11] := ToLONGREAL(3FE4BFDAD5362A27H); + a1[12] := ToLONGREAL(3FE3DEA64C123422H); + a1[13] := ToLONGREAL(3FE306FE0A31B715H); + a1[14] := ToLONGREAL(3FE2387A6E756238H); + a1[15] := ToLONGREAL(3FE172B83C7D517AH); + a1[16] := ToLONGREAL(3FE0B5586CF9890FH); + a1[17] := HALF; + + (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + a2[1] := ToLONGREAL(3C90B1EE74320000H); + a2[2] := ToLONGREAL(3C71106589500000H); + a2[3] := ToLONGREAL(3C6C7C46B0700000H); + a2[4] := ToLONGREAL(3C9AFAA2047F0000H); + a2[5] := ToLONGREAL(3C86324C05460000H); + a2[6] := ToLONGREAL(3C7ADA0911F00000H); + a2[7] := ToLONGREAL(3C89B07EB6C80000H); + a2[8] := ToLONGREAL(3C88A62E4ADC0000H); + + (* reenable compiler warnings *) + (*<* POP *>*) +END MathL. + diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod new file mode 100644 index 00000000..26268749 --- /dev/null +++ b/src/runtime/Modules.Mod @@ -0,0 +1,96 @@ +MODULE Modules; (* jt 6.1.96 *) + + (* access to list of modules and commands, based on ETH Oberon *) + + + IMPORT SYSTEM, Heap; + + CONST + ModNameLen* = 20; + + TYPE + ModuleName* = ARRAY ModNameLen OF CHAR; + Module* = POINTER TO ModuleDesc; + Cmd* = POINTER TO CmdDesc; + ModuleDesc* = RECORD (* cf. SYSTEM.Mod *) + next-: Module; + name-: ModuleName; + refcnt-: LONGINT; + cmds-: Cmd; + types-: LONGINT; + enumPtrs-: PROCEDURE (P: PROCEDURE(p: LONGINT)); + reserved1, reserved2: LONGINT; + END ; + + Command* = PROCEDURE; + + CmdDesc* = RECORD + next-: Cmd; + name-: ARRAY 24 OF CHAR; + cmd-: Command + END ; + + VAR + res*: INTEGER; + resMsg*: ARRAY 256 OF CHAR; + imported*, importing*: ModuleName; + + + PROCEDURE -modules*(): Module + "(Modules_Module)Heap_modules"; + + PROCEDURE -setmodules*(m: Module) + "Heap_modules = m"; + + + PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); + VAR i, j: INTEGER; + BEGIN + i := 0; WHILE a[i] # 0X DO INC(i) END; + j := 0; WHILE b[j] # 0X DO a[i] := b[j]; INC(i); INC(j) END; + a[i] := 0X + END Append; + + PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; + VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; + BEGIN m := modules(); + WHILE (m # NIL) & (m.name # name) DO m := m.next END ; + IF m # NIL THEN res := 0; resMsg := "" + ELSE res := 1; COPY(name, importing); + resMsg := ' module "'; Append(resMsg, name); Append(resMsg, '" not found'); + END ; + RETURN m + END ThisMod; + + PROCEDURE ThisCommand* (mod: Module; name: ARRAY OF CHAR): Command; + VAR c: Cmd; + BEGIN c := mod.cmds; + WHILE (c # NIL) & (c.name # name) DO c := c.next END ; + IF c # NIL THEN res := 0; resMsg := ""; RETURN c.cmd + ELSE res := 2; resMsg := ' command "'; COPY(name, importing); + Append(resMsg, mod.name); Append(resMsg, "."); Append(resMsg, name); Append(resMsg, '" not found'); + RETURN NIL + END + END ThisCommand; + + PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); + VAR m, p: Module; + BEGIN m := modules(); + IF all THEN + res := 1; resMsg := 'unloading "all" not yet supported' + ELSE + WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END ; + IF (m # NIL) & (m.refcnt = 0) THEN + IF m = modules() THEN setmodules(m.next) + ELSE p.next := m.next + END ; + res := 0 + ELSE res := 1; + IF m = NIL THEN resMsg := "module not found" + ELSE resMsg := "clients of this module exist" + END + END + END + END Free; + +END Modules. diff --git a/src/runtime/Oberon.Mod b/src/runtime/Oberon.Mod new file mode 100644 index 00000000..fbc3abd4 --- /dev/null +++ b/src/runtime/Oberon.Mod @@ -0,0 +1,74 @@ +MODULE Oberon; + +(* this version should not have dependency on graphics -- noch *) + + IMPORT Platform, Texts, Out; + + TYPE + ParList* = POINTER TO ParRec; + ParRec* = RECORD + (* + vwr*: Viewers.Viewer; + frame*: Display.Frame; + *) + text*: Texts.Text; + pos*: LONGINT + END; + + VAR + Log*: Texts.Text; + Par*: ParList; (*actual parameters*) + OptionChar*: CHAR; + + R: Texts.Reader; + W: Texts.Writer; + + (*clocks*) + +PROCEDURE GetClock* (VAR t, d: LONGINT); +BEGIN Platform.GetClock(t, d) +END GetClock; + +PROCEDURE Time* (): LONGINT; +BEGIN RETURN Platform.Time() +END Time; + +PROCEDURE PopulateParams; + VAR W: Texts.Writer; i: INTEGER; str: ARRAY 256 OF CHAR; +BEGIN + Texts.OpenWriter(W); + i := 1; (* skip program name *) + WHILE i < Platform.ArgCount DO + Platform.GetArg(i, str); Texts.WriteString(W, str); Texts.Write(W, " "); + INC(i) + END; + Texts.Append (Par^.text, W.buf); +END PopulateParams; + +PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); +BEGIN text := NIL; beg := 0; end := 0; time := 0 +END GetSelection; + +(* --- Notifier for echoing to the comsole all text appended to the log. --- *) +PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT); + VAR ch: CHAR; +BEGIN + Texts.OpenReader(R, Log, beg); + WHILE ~R.eot & (beg < end) DO + Texts.Read(R, ch); + IF ch = 0DX THEN Out.Ln ELSE Out.Char(ch) END; + INC(beg) + END +END LogNotifier; + +BEGIN + NEW(Par); + NEW(Par.text); + Par.pos := 0; + OptionChar := '-'; + Texts.Open(Par.text, ""); + PopulateParams; + NEW(Log); + Texts.Open(Log, ""); + Log.notify := LogNotifier; +END Oberon. diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod new file mode 100644 index 00000000..245c67a8 --- /dev/null +++ b/src/runtime/Out.Mod @@ -0,0 +1,55 @@ +MODULE Out; (* D C W Brown. 2016-09-27 *) + + IMPORT SYSTEM, Platform; + +PROCEDURE Open*; +BEGIN +END Open; + +PROCEDURE Char*(ch: CHAR); + VAR error: Platform.ErrorCode; +BEGIN + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) +END Char; + +PROCEDURE String*(str: ARRAY OF CHAR); + VAR l: LONGINT; error: Platform.ErrorCode; +BEGIN + l := 0; WHILE (l < LEN(str)) & (str[l] # 0X) DO INC(l) END; + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) +END String; + +PROCEDURE Int*(x: HUGEINT; n: LONGINT); + CONST zero = ORD('0'); + VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; +BEGIN + negative := x < 0; + IF x = MIN(HUGEINT) THEN + s := "8085774586302733229"; i := 19 + ELSE + IF x < 0 THEN x := - x END; + s[0] := CHR(zero + (x MOD 10)); x := x DIV 10; + i := 1; WHILE x # 0 DO + s[i] := CHR(zero + (x MOD 10)); + x := x DIV 10; + INC(i) + END + END; + IF negative THEN s[i] := '-'; INC(i) END; + WHILE n > i DO Char(' '); DEC(n) END; + WHILE i > 0 DO DEC(i); Char(s[i]) END +END Int; + +PROCEDURE Real*(x: REAL; n: INTEGER); +BEGIN +END Real; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +BEGIN +END LongReal; + +PROCEDURE Ln*; +BEGIN String(Platform.NL) +END Ln; + +END Out. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod new file mode 100644 index 00000000..034906bd --- /dev/null +++ b/src/runtime/Platformunix.Mod @@ -0,0 +1,552 @@ +MODULE Platform; +IMPORT SYSTEM; + +CONST + StdIn- = 0; + StdOut- = 1; + StdErr- = 2; + +TYPE + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); + + ErrorCode* = INTEGER; + FileHandle* = LONGINT; + + FileIdentity* = RECORD + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + mtime: LONGINT; (* File modification time, value is system dependent *) + END; + + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; + + +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: SYSTEM.ADDRESS; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 256 OF CHAR; + ArgCount-: INTEGER; + + ArgVector-: SYSTEM.ADDRESS; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; + + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; + + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + + + +(* Unix headers to be included *) + +PROCEDURE -Aincludesystime '#include '; (* for gettimeofday *) +PROCEDURE -Aincludetime '#include '; (* for localtime *) +PROCEDURE -Aincludesystypes '#include '; +PROCEDURE -Aincludeunistd '#include '; +PROCEDURE -Aincludesysstat '#include '; +PROCEDURE -Aincludefcntl '#include '; +PROCEDURE -Aincludeerrno '#include '; +PROCEDURE -Astdlib '#include '; +PROCEDURE -Astdio '#include '; +PROCEDURE -Aerrno '#include '; + + + + +(* Error code tests *) + +PROCEDURE -EMFILE(): ErrorCode 'EMFILE'; +PROCEDURE -ENFILE(): ErrorCode 'ENFILE'; +PROCEDURE -ENOENT(): ErrorCode 'ENOENT'; +PROCEDURE -EXDEV(): ErrorCode 'EXDEV'; +PROCEDURE -EACCES(): ErrorCode 'EACCES'; +PROCEDURE -EROFS(): ErrorCode 'EROFS'; +PROCEDURE -EAGAIN(): ErrorCode 'EAGAIN'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'ETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'EINTR'; + + + + +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; + +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ENOENT() END NoSuchDirectory; + +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EXDEV() END DifferentFilesystems; + +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; + +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ENOENT() END Absent; + +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ETIMEDOUT() END TimedOut; + +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; + +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + + + + +(* OS memory allocaton *) + +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; + +PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; + + + + +(* Program startup *) + +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; + +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; + + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; + + + + +(* Program arguments and environment access *) + +PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; + +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR p: EnvPtr; +BEGIN + p := getenv(var); + IF p # NIL THEN COPY(p^, val) END; + RETURN p # NIL; +END getEnv; + +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~ getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; + +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; + +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; + +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; + + + + + +(* Signals and traps *) + +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; + +PROCEDURE SetInterruptHandler*(handler: SignalHandler); +BEGIN sethandler(2, handler); END SetInterruptHandler; + +PROCEDURE SetQuitHandler*(handler: SignalHandler); +BEGIN sethandler(3, handler); END SetQuitHandler; + +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN sethandler(4, handler); END SetBadInstructionHandler; + + + + +(* Time of day *) + +PROCEDURE -gettimeval "struct timeval tv; gettimeofday(&tv,0)"; +PROCEDURE -tvsec(): LONGINT "tv.tv_sec"; +PROCEDURE -tvusec(): LONGINT "tv.tv_usec"; +PROCEDURE -sectotm(s: LONGINT) "struct tm *time = localtime((time_t*)&s)"; +PROCEDURE -tmsec(): LONGINT "(LONGINT)time->tm_sec"; +PROCEDURE -tmmin(): LONGINT "(LONGINT)time->tm_min"; +PROCEDURE -tmhour(): LONGINT "(LONGINT)time->tm_hour"; +PROCEDURE -tmmday(): LONGINT "(LONGINT)time->tm_mday"; +PROCEDURE -tmmon(): LONGINT "(LONGINT)time->tm_mon"; +PROCEDURE -tmyear(): LONGINT "(LONGINT)time->tm_year"; + +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: LONGINT; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; + +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + gettimeval; sectotm(tvsec()); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END GetClock; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + gettimeval; sec := tvsec(); usec := tvusec(); +END GetTimeOfDay; + +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + gettimeval; + ms := (tvusec() DIV 1000) + (tvsec() * 1000); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -nanosleep(s: LONGINT; ns: LONGINT) "struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)"; + +PROCEDURE Delay*(ms: LONGINT); +VAR s, ns: LONGINT; +BEGIN + s := ms DIV 1000; + ns := (ms MOD 1000) * 1000000; + nanosleep(s, ns); +END Delay; + + + + +(* System call *) + +PROCEDURE -system(str: ARRAY OF CHAR): INTEGER "system((char*)str)"; +PROCEDURE -err(): INTEGER "errno"; + + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +BEGIN RETURN system(cmd); END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + + + +(* File system *) + +(* Note: Consider also using flags O_SYNC and O_DIRECT as we do buffering *) +PROCEDURE -openrw (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDWR)"; +PROCEDURE -openro (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDONLY)"; +PROCEDURE -opennew(n: ARRAY OF CHAR): INTEGER "open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)"; + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openro(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := openrw(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: INTEGER; +BEGIN + fd := opennew(n); + IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closefile(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; +PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; +PROCEDURE -structstats "struct stat s"; +PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; +PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; +PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; +PROCEDURE -statsize(): LONGINT "(address)s.st_size"; + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +BEGIN + structstats; + IF stat(n) < 0 THEN RETURN err() END; + identity.volume := statdev(); + identity.index := statino(); + identity.mtime := statmtime(); + RETURN 0 +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.index = i2.index) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN i1.mtime = i2.mtime +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtime := source.mtime; +END SetMTime; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + sectotm(i.mtime); + YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); +END MTimeAsClock; + + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + structstats; + IF fstat(h) < 0 THEN RETURN err() END; + l := statsize(); + RETURN 0; +END Size; + + + +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT +"(LONGINT)read(fd, (void*)(address)(p), l)"; + +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, p, l); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +BEGIN + n := readfile(h, SYSTEM.ADR(b), LEN(b)); + IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"write(fd, (void*)(address)(p), l)"; + +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; + VAR written: SYSTEM.ADDRESS; +BEGIN + written := writefile(h, p, l); + IF written < 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -fsync(fd: LONGINT): INTEGER "fsync(fd)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF fsync(h) < 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -lseek(fd: LONGINT; o: LONGINT; w: INTEGER): INTEGER "lseek(fd, o, w)"; +PROCEDURE -seekset(): INTEGER "SEEK_SET"; +PROCEDURE -seekcur(): INTEGER "SEEK_CUR"; +PROCEDURE -seekend(): INTEGER "SEEK_END"; + +PROCEDURE Seek*(h: FileHandle; offset: LONGINT; whence: INTEGER): ErrorCode; +BEGIN + IF lseek(h, offset, whence) < 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -ftruncate(fd: LONGINT; l: LONGINT): INTEGER "ftruncate(fd, l)"; + +PROCEDURE Truncate*(h: FileHandle; l: LONGINT): ErrorCode; +BEGIN + IF (ftruncate(h, l) < 0) THEN RETURN err() ELSE RETURN 0 END; +END Truncate; + + + +PROCEDURE -unlink(n: ARRAY OF CHAR): INTEGER "unlink((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF unlink(n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + + +PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; +PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 + ELSE RETURN err() END +END Chdir; + + + +PROCEDURE -rename(o,n: ARRAY OF CHAR): INTEGER "rename((char*)o, (char*)n)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF rename(o,n) < 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "exit(code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; +PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Assertion failure.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Implicit type guard in record assignment failed.") + | -7: errstring("Invalid case in WITH statement.") + | -8: errstring("Value out of range.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; + +BEGIN + TestLittleEndian; + + HaltCode := -128; + HaltHandler := NIL; + TimeStart := 0; TimeStart := Time(); + PID := getpid(); + IF getcwd(CWD) = NIL THEN CWD := "" END; + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + NL[0] := 0AX; (* LF *) + NL[1] := 0X; +END Platform. diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod new file mode 100644 index 00000000..a538fdc5 --- /dev/null +++ b/src/runtime/Platformwindows.Mod @@ -0,0 +1,622 @@ +MODULE Platform; +IMPORT SYSTEM; + +(* TODO: + Use Unicode APIs with manual UTF8 conversion and prepend '\\?\' to + file paths in order to get 32768 character path length limit (as + opposed to 256 bytes. *) + + +TYPE + HaltProcedure = PROCEDURE(n: LONGINT); + SignalHandler = PROCEDURE(signal: INTEGER); + + ErrorCode* = INTEGER; + FileHandle* = LONGINT; + + FileIdentity* = RECORD + volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) + indexhigh: LONGINT; (* inode on Unix filesystems, file id on NTFS *) + indexlow: LONGINT; + mtimehigh: LONGINT; (* File modification time, value is system dependent *) + mtimelow: LONGINT; (* File modification time, value is system dependent *) + END; + + EnvPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgPtr = POINTER TO ARRAY 1024 OF CHAR; + ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; + ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; + + +VAR + LittleEndian-: BOOLEAN; + MainStackFrame-: SYSTEM.ADDRESS; + HaltCode-: LONGINT; + PID-: INTEGER; (* Note: Must be updated by Fork implementation *) + CWD-: ARRAY 4096 OF CHAR; + ArgCount-: INTEGER; + + ArgVector-: SYSTEM.ADDRESS; + HaltHandler: HaltProcedure; + TimeStart: LONGINT; + + SeekSet-: INTEGER; + SeekCur-: INTEGER; + SeekEnd-: INTEGER; + + StdIn-: FileHandle; + StdOut-: FileHandle; + StdErr-: FileHandle; + + InterruptHandler: SignalHandler; + + nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + + + +PROCEDURE -AincludeWindowsWrapper '#include "WindowsWrapper.h"'; + + +(* Error code tests *) + +PROCEDURE -ERRORTOOMANYOPENFILES(): ErrorCode 'ERROR_TOO_MANY_OPEN_FILES'; +PROCEDURE -ERRORPATHNOTFOUND(): ErrorCode 'ERROR_PATH_NOT_FOUND'; +PROCEDURE -ERRORFILENOTFOUND(): ErrorCode 'ERROR_FILE_NOT_FOUND'; +PROCEDURE -ERRORNOTSAMEDEVICE(): ErrorCode 'ERROR_NOT_SAME_DEVICE'; +PROCEDURE -ERRORACCESSDENIED(): ErrorCode 'ERROR_ACCESS_DENIED'; +PROCEDURE -ERRORWRITEPROTECT(): ErrorCode 'ERROR_WRITE_PROTECT'; +PROCEDURE -ERRORSHARINGVIOLATION(): ErrorCode 'ERROR_SHARING_VIOLATION'; +PROCEDURE -ERRORNOTREADY(): ErrorCode 'ERROR_NOT_READY'; +PROCEDURE -ETIMEDOUT(): ErrorCode 'WSAETIMEDOUT'; +PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; +PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; +PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; +PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; +PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; + + + +PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORTOOMANYOPENFILES() END TooManyFiles; + +PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORPATHNOTFOUND() END NoSuchDirectory; + +PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = ERRORNOTSAMEDEVICE() END DifferentFilesystems; + +PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; +BEGIN + RETURN (e = ERRORACCESSDENIED()) OR (e = ERRORWRITEPROTECT()) + OR (e = ERRORNOTREADY()) OR (e = ERRORSHARINGVIOLATION()); +END Inaccessible; + +PROCEDURE Absent*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ERRORFILENOTFOUND()) OR (e = ERRORPATHNOTFOUND()) END Absent; + +PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; + +PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; +BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) + OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; + +PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; +BEGIN RETURN e = EINTR() END Interrupted; + + + +(* OS memory allocaton *) + +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; + +PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; + + + + +(* Program startup *) + +PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; +PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; + +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +VAR av: ArgVecPtr; +BEGIN + MainStackFrame := argvadr; + ArgCount := argc; + av := SYSTEM.VAL(ArgVecPtr, argvadr); + ArgVector := av[0]; + HaltCode := -128; + + (* This function (Platform.Init) is called at program startup BEFORE any + modules have been initalised. In turn we must initialise the heap + before module startup (xxx__init) code is run. *) + HeapInitHeap(); +END Init; + + + + +(* Program arguments and environmet access *) + +PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER +"(INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)"; + +PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; + VAR + buf: ARRAY 4096 OF CHAR; + res: INTEGER; +BEGIN + res := getenv(var, buf); + IF (res > 0) & (res < LEN(buf)) THEN + COPY(buf, val); + RETURN TRUE; + ELSE + RETURN FALSE; + END; +END getEnv; + +PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); +BEGIN + IF ~getEnv(var, val) THEN val[0] := 0X END; +END GetEnv; + +PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); + VAR av: ArgVec; +BEGIN + IF n < ArgCount THEN + av := SYSTEM.VAL(ArgVec,ArgVector); + COPY(av[n]^, val) + END +END GetArg; + +PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); + VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; +BEGIN + s := ""; GetArg(n, s); i := 0; + IF s[0] = "-" THEN i := 1 END ; + k := 0; d := ORD(s[i]) - ORD("0"); + WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; + IF s[0] = "-" THEN k := -k; DEC(i) END ; + IF i > 0 THEN val := k END +END GetIntArg; + +PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; arg: ARRAY 256 OF CHAR; +BEGIN + i := 0; GetArg(i, arg); + WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; + RETURN i +END ArgPos; + + + + + +(* Signals and traps *) + +(* PROCEDURE -signal(sig: LONGINT; func: SignalHandler) "signal(sig, func)"; *) + +(* TODO *) + +(* Ctrl/c handling *) + +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; + +PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); +BEGIN (* TODO *) END SetBadInstructionHandler; + + + + +(* Time of day *) + +PROCEDURE -getLocalTime "SYSTEMTIME st; GetLocalTime(&st)"; +PROCEDURE -stmsec(): INTEGER "(INTEGER)st.wMilliseconds"; +PROCEDURE -stsec(): INTEGER "(INTEGER)st.wSecond"; +PROCEDURE -stmin(): INTEGER "(INTEGER)st.wMinute"; +PROCEDURE -sthour(): INTEGER "(INTEGER)st.wHour"; +PROCEDURE -stmday(): INTEGER "(INTEGER)st.wDay"; +PROCEDURE -stmon(): INTEGER "(INTEGER)st.wMonth"; +PROCEDURE -styear(): INTEGER "(INTEGER)st.wYear"; + +PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: INTEGER; VAR t, d: LONGINT); +BEGIN + d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; + t := ASH(ho, 12) + ASH(mi, 6) + se; +END YMDHMStoClock; + +PROCEDURE GetClock*(VAR t, d: LONGINT); +BEGIN + getLocalTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END GetClock; + +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; + +PROCEDURE Time*(): LONGINT; +VAR ms: LONGINT; +BEGIN + ms := GetTickCount(); + RETURN (ms - TimeStart) MOD 7FFFFFFFH; +END Time; + + +PROCEDURE -sleep(ms: LONGINT) "Sleep((DWORD)ms)"; + +PROCEDURE Delay*(ms: LONGINT); +BEGIN + WHILE ms > 30000 DO sleep(30000); ms := ms-30000 END; + IF ms > 0 THEN sleep(ms) END; +END Delay; + + +PROCEDURE -stToFt "FILETIME ft; SystemTimeToFileTime(&st, &ft)"; +PROCEDURE -ftToUli "ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime"; +PROCEDURE -tous1970 "ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL"; +PROCEDURE -ulSec(): LONGINT "(LONGINT)(ul.QuadPart / 1000000LL)"; +PROCEDURE -uluSec(): LONGINT "(LONGINT)(ul.QuadPart % 1000000LL)"; + +PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); +BEGIN + getLocalTime; stToFt; ftToUli; tous1970; + sec := ulSec(); usec := uluSec(); +END GetTimeOfDay; + + + +(* System call *) + +PROCEDURE -startupInfo "STARTUPINFO si = {0}; si.cb = sizeof(si);"; +PROCEDURE -processInfo "PROCESS_INFORMATION pi = {0};"; +PROCEDURE -createProcess(str: ARRAY OF CHAR): INTEGER "(INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)"; +PROCEDURE -waitForProcess(): INTEGER "(INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)"; +PROCEDURE -getExitCodeProcess(VAR exitcode: INTEGER) "GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);"; +PROCEDURE -cleanupProcess "CloseHandle(pi.hProcess); CloseHandle(pi.hThread);"; +PROCEDURE -err(): INTEGER "(INTEGER)GetLastError()"; + +PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; +VAR + result: INTEGER; +BEGIN + result := 127; + startupInfo; processInfo; + IF createProcess(cmd) # 0 THEN + IF waitForProcess() = 0 THEN getExitCodeProcess(result) END; + cleanupProcess; + END; + RETURN result * 256; +END System; + +PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; + + +(* File system *) + +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; + +PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; + +PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; + + + + +(* File APIs *) + +PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openro(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRO; + +PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := openrw(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END OldRW; + +PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; +VAR fd: LONGINT; +BEGIN + fd := opennew(n); + IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; +END New; + + + +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; + +PROCEDURE Close*(h: FileHandle): ErrorCode; +BEGIN + IF closeHandle(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Close; + + + +PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; +PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; +PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; +PROCEDURE -bhfiIndexHigh(): LONGINT "(LONGINT)bhfi.nFileIndexHigh"; +PROCEDURE -bhfiIndexLow(): LONGINT "(LONGINT)bhfi.nFileIndexLow"; + + +PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; +BEGIN + byHandleFileInformation; + IF getFileInformationByHandle(h) = 0 THEN RETURN err() END; + identity.volume := bhfiVsn(); + identity.indexhigh := bhfiIndexHigh(); + identity.indexlow := bhfiIndexLow(); + identity.mtimehigh := bhfiMtimeHigh(); + identity.mtimelow := bhfiMtimeLow(); + RETURN 0 +END Identify; + +PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; +VAR + h: FileHandle; + e,i: ErrorCode; +BEGIN + e := OldRO(n, h); + IF e # 0 THEN RETURN e END; + e := Identify(h, identity); + i := Close(h); + RETURN e; +END IdentifyByName; + + +PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.indexhigh = i2.indexhigh) & (i1.indexlow = i2.indexlow) & (i1.volume = i2.volume) +END SameFile; + +PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; +BEGIN RETURN (i1.mtimehigh = i2.mtimehigh) & (i1.mtimelow = i2.mtimelow) +END SameFileTime; + +PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); +BEGIN target.mtimehigh := source.mtimehigh; target.mtimelow := source.mtimelow; +END SetMTime; + +PROCEDURE -identityToFileTime(i: FileIdentity) +"FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow"; + +PROCEDURE -fileTimeToSysTime +"SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)"; + +PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); +BEGIN + identityToFileTime(i); fileTimeToSysTime; + YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); +END MTimeAsClock; + +PROCEDURE -largeInteger "LARGE_INTEGER li"; +PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; + +PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; +BEGIN + largeInteger; + IF getFileSize(h) = 0 THEN RETURN err() END; + l := liLongint(); + RETURN 0; +END Size; + + +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; + +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; +BEGIN + result := readfile(h, p, l, lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END +END Read; + +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +VAR result: INTEGER; lengthread: SYSTEM.INT32; +BEGIN + result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); + IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END +END ReadBuf; + + + +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; + +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; +BEGIN + IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END +END Write; + + + +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; + +PROCEDURE Sync*(h: FileHandle): ErrorCode; +BEGIN + IF flushFileBuffers(h) = 0 THEN RETURN err() ELSE RETURN 0 END +END Sync; + + + +PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; + +PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; +PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; +PROCEDURE -seekend(): INTEGER "FILE_END"; + +PROCEDURE Seek*(h: FileHandle; o: LONGINT; r: INTEGER): ErrorCode; +VAR rc: INTEGER; +BEGIN + largeInteger; + setFilePointerEx(h, o, r, rc); + IF rc = 0 THEN RETURN err() ELSE RETURN 0 END +END Seek; + + + +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; + +PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; +VAR rc: INTEGER; oldpos: LONGINT; +BEGIN + largeInteger; + getFilePos(h, oldpos, rc); + IF rc = 0 THEN RETURN err() END; + setFilePointerEx(h, limit, seekset(), rc); + IF rc = 0 THEN RETURN err() END; + IF setEndOfFile(h) = 0 THEN RETURN err() END; + setFilePointerEx(h, oldpos, seekset(), rc); (* Restore original file position *) + IF rc = 0 THEN RETURN err() END; + RETURN 0; +END Truncate; + + + +PROCEDURE -deleteFile(n: ARRAY OF CHAR): INTEGER "(INTEGER)DeleteFile((char*)n)"; + +PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF deleteFile(n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Unlink; + + +PROCEDURE -setCurrentDirectory(n: ARRAY OF CHAR): INTEGER "(INTEGER)SetCurrentDirectory((char*)n)"; +PROCEDURE -getCurrentDirectory(VAR n: ARRAY OF CHAR) "GetCurrentDirectory(n__len, (char*)n)"; + +PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; + VAR r: INTEGER; +BEGIN + r := setCurrentDirectory(n); + IF r = 0 THEN RETURN err() END; + getCurrentDirectory(CWD); + RETURN 0; +END Chdir; + + + +PROCEDURE -moveFile(o,n: ARRAY OF CHAR): INTEGER +"(INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)"; + +PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; +BEGIN + IF moveFile(o,n) = 0 THEN RETURN err() ELSE RETURN 0 END +END Rename; + + + + +(* Process termination *) + +PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; +PROCEDURE Exit*(code: INTEGER); +BEGIN exit(code) END Exit; + + +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; +PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; + +PROCEDURE errposint(l: LONGINT); +BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + +PROCEDURE errint(l: LONGINT); +BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + +PROCEDURE DisplayHaltCode(code: LONGINT); +BEGIN + CASE code OF + | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Type equality failed.") + | -7: errstring("WITH statement type guard failed.") + | -8: errstring("SHORT: Value too large for shorter type.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END +END DisplayHaltCode; + +PROCEDURE Halt*(code: LONGINT); +BEGIN + HaltCode := code; + IF HaltHandler # NIL THEN HaltHandler(code) END; + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END Halt; + +PROCEDURE AssertFail*(code: LONGINT); +BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errln; + exit(SYSTEM.VAL(INTEGER,code)); +END AssertFail; + +PROCEDURE SetHalt*(p: HaltProcedure); +BEGIN HaltHandler := p; END SetHalt; + + + + +PROCEDURE TestLittleEndian; + VAR i: INTEGER; + BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; + + +PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; + +BEGIN + TestLittleEndian; + + HaltCode := -128; + HaltHandler := NIL; + TimeStart := 0; TimeStart := Time(); + CWD := ""; getCurrentDirectory(CWD); + PID := getpid(); + + SeekSet := seekset(); + SeekCur := seekcur(); + SeekEnd := seekend(); + + StdIn := getstdinhandle(); + StdOut := getstdouthandle(); + StdErr := getstderrhandle(); + + nl[0] := 0DX; (* CR *) + nl[1] := 0AX; (* LF *) + nl[2] := 0X; +END Platform. diff --git a/src/runtime/Reals.Mod b/src/runtime/Reals.Mod new file mode 100644 index 00000000..f9e6617b --- /dev/null +++ b/src/runtime/Reals.Mod @@ -0,0 +1,136 @@ +MODULE Reals; + (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) + (* DCWB 20160817 Made independent of INTEGER size *) + + IMPORT SYSTEM; + + PROCEDURE Ten*(e: INTEGER): REAL; + VAR r, power: LONGREAL; + BEGIN r := 1.0; + power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r * power END ; + power := power * power; e := e DIV 2 + END ; + RETURN SHORT(r) + END Ten; + + + PROCEDURE TenL*(e: INTEGER): LONGREAL; + VAR r, power: LONGREAL; + BEGIN r := 1.0; + power := 10.0; + LOOP + IF ODD(e) THEN r := r * power END ; + e := e DIV 2; + IF e <= 0 THEN RETURN r END ; + power := power * power + END + END TenL; + + + (* Real number format (IEEE 754) + + TYPE REAL - Single precision / binary32: + 1/sign, 8/exponent, 23/significand + + TYPE LONGREAL - Double precision / binary64: + 1/sign, 11/exponent, 52/significand + + exponent: + stored as exponent value + 127. + + significand (fraction): + excludes leading (most significant) bit which is assumed to be 1. + *) + + + PROCEDURE Expo*(x: REAL): INTEGER; + VAR i: INTEGER; + BEGIN + SYSTEM.GET(SYSTEM.ADR(x)+2, i); + RETURN (i DIV 128) MOD 256 + END Expo; + + PROCEDURE SetExpo*(VAR x: REAL; ex: INTEGER); + VAR c: CHAR; + BEGIN + (* Replace exponent bits within top byte of REAL *) + SYSTEM.GET(SYSTEM.ADR(x)+3, c); + SYSTEM.PUT(SYSTEM.ADR(x)+3, CHR(((ORD(c) DIV 128) * 128) + ((ex DIV 2) MOD 128))); + (* Replace exponent bits within 2nd byte of REAL *) + SYSTEM.GET(SYSTEM.ADR(x)+2, c); + SYSTEM.PUT(SYSTEM.ADR(x)+2, CHR((ORD(c) MOD 128) + ((ex MOD 2) * 128))) + END SetExpo; + + PROCEDURE ExpoL*(x: LONGREAL): INTEGER; + VAR i: INTEGER; + BEGIN + SYSTEM.GET(SYSTEM.ADR(x)+6, i); + RETURN (i DIV 16) MOD 2048 + END ExpoL; + + (* Convert LONGREAL: Write positive integer value of x into array d. + The value is stored backwards, i.e. least significant digit + first. n digits are written, with trailing zeros fill. + On entry x has been scaled to the number of digits required. *) + PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); + VAR i, j, k: LONGINT; + BEGIN + IF x < 0 THEN x := -x END; + k := 0; + + IF (SIZE(LONGINT) < 8) & (n > 9) THEN + (* There are more decimal digits than can be held in a single LONGINT *) + i := ENTIER(x / 1000000000.0D0); (* The 10th and higher digits *) + j := ENTIER(x - (i * 1000000000.0D0)); (* The low 9 digits *) + (* First generate the low 9 digits. *) + IF j < 0 THEN j := 0 END; + WHILE k < 9 DO + d[k] := CHR(j MOD 10 + 48); j := j DIV 10; INC(k) + END; + (* Fall through to generate the upper digits *) + ELSE + (* We can generate all the digits in one go. *) + i := ENTIER(x); + END; + + WHILE k < n DO + d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) + END + END ConvertL; + + + PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); + BEGIN ConvertL(x, n, d) + END Convert; + + PROCEDURE ToHex(i: INTEGER): CHAR; + BEGIN + IF i < 10 THEN RETURN CHR(i+48) + ELSE RETURN CHR(i+55) END + END ToHex; + + PROCEDURE BytesToHex(VAR b, d: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; l: LONGINT; by: CHAR; + BEGIN + i := 0; l := LEN(b); + WHILE i < l DO + by := SYSTEM.VAL(CHAR, b[i]); + d[i*2] := ToHex(ORD(by) DIV 16); + d[i*2+1] := ToHex(ORD(by) MOD 16); + INC(i) + END + END BytesToHex; + + (* Convert Hex *) + PROCEDURE ConvertH*(y: REAL; VAR d: ARRAY OF CHAR); + BEGIN BytesToHex(y, d) + END ConvertH; + + (* Convert Hex Long *) + PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); + BEGIN BytesToHex(x, d) + END ConvertHL; + +END Reals. diff --git a/src/runtime/Strings.Mod b/src/runtime/Strings.Mod new file mode 100644 index 00000000..e6fe12ac --- /dev/null +++ b/src/runtime/Strings.Mod @@ -0,0 +1,156 @@ +(*------------------------------------------------------------- +Strings provides a set of operations on strings (i.e., on string constants and character +arrays, both of which contain the character 0X as a terminator). All positions in +strings start at 0. +Strings.Length(s) + returns the number of characters in s up to and excluding the first 0X. +Strings.Insert(src, pos, dst) + inserts the string src into the string dst at position pos (0 <= pos <= Length(dst)). + If pos = Length(dst), src is appended to dst. If the size of dst is not large enough + to hold the result of the operation, the result is truncated so that dst is always + terminated with a 0X. +Strings.Append(s, dst) + has the same effect as Insert(s, Length(s), dst). +Strings.Delete(s, pos, n) + deletes n characters from s starting at position pos (0 <= pos < Length(s)). + If n > Length(s) - pos, the new length of s is pos. +Strings.Replace(src, pos, dst) + has the same effect as Delete(dst, pos, Length(src)) followed by an Insert(src, pos, dst). +Strings.Extract(src, pos, n, dst) + extracts a substring dst with n characters from position pos (0 <= pos < Length(src)) in src. + If n > Length(src) - pos, dst is only the part of src from pos to Length(src) - 1. If the size of + dst is not large enough to hold the result of the operation, the result is truncated so that + dst is always terminated with a 0X. +Strings.Pos(pat, s, pos) + returns the position of the first occurrence of pat in s after position pos (inclusive). + If pat is not found, -1 is returned. +Strings.Cap(s) + replaces each lower case letter in s by its upper case equivalent. +-------------------------------------------------------------*) +(* added from trianus v4 *) +MODULE Strings; (*HM 94-06-22 / *) + + +PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; + VAR i: INTEGER; +BEGIN + i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; + RETURN i +END Length; + + +PROCEDURE Append* (extra: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); + VAR n1, n2, i: INTEGER; +BEGIN + n1 := Length(dest); n2 := Length(extra); i := 0; + WHILE (i < n2) & (i + n1 < LEN(dest)) DO dest[i + n1] := extra[i]; INC(i) END ; + IF i + n1 < LEN(dest) THEN dest[i + n1] := 0X END +END Append; + + +PROCEDURE Insert* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); + VAR n1, n2, i: INTEGER; +BEGIN + n1 := Length(dest); n2 := Length(source); + IF pos < 0 THEN pos := 0 END ; + IF pos > n1 THEN Append(dest, source); RETURN END ; + IF pos + n2 < LEN(dest) THEN (*make room for source*) + i := n1; (*move also 0X if it is there*) + WHILE i >= pos DO + IF i + n2 < LEN(dest) THEN dest[i + n2] := dest[i] END ; + DEC(i) + END + END ; + i := 0; WHILE i < n2 DO dest[pos + i] := source[i]; INC(i) END +END Insert; + + +PROCEDURE Delete* (VAR s: ARRAY OF CHAR; pos, n: INTEGER); + VAR len, i: INTEGER; +BEGIN + len:=Length(s); + IF pos < 0 THEN pos:=0 ELSIF pos >= len THEN RETURN END ; + IF pos + n < len THEN + i:=pos + n; WHILE i < len DO s[i - n]:=s[i]; INC(i) END ; + IF i - n < LEN(s) THEN s[i - n]:=0X END + ELSE s[pos]:=0X + END +END Delete; + + +PROCEDURE Replace* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); +BEGIN + Delete(dest, pos, pos + Length(source)); + Insert(source, pos, dest) +END Replace; + + +PROCEDURE Extract* (source: ARRAY OF CHAR; pos, n: INTEGER; VAR dest: ARRAY OF CHAR); + VAR len, destLen, i: INTEGER; +BEGIN + len := Length(source); destLen := SHORT(LEN(dest)) - 1; + IF pos < 0 THEN pos := 0 END ; + IF pos >= len THEN dest[0] := 0X; RETURN END ; + i := 0; + WHILE (pos + i <= LEN(source)) & (source[pos + i] # 0X) & (i < n) DO + IF i < destLen THEN dest[i] := source[pos + i] END ; + INC(i) + END ; + dest[i] := 0X +END Extract; + + +PROCEDURE Pos* (pattern, s: ARRAY OF CHAR; pos: INTEGER): INTEGER; + VAR n1, n2, i, j: INTEGER; +BEGIN + n1 := Length(s); n2 := Length(pattern); + IF n2 = 0 THEN RETURN 0 END ; + i := pos; + WHILE i <= n1 - n2 DO + IF s[i] = pattern[0] THEN + j := 1; WHILE (j < n2) & (s[i + j] = pattern[j]) DO INC(j) END ; + IF j = n2 THEN RETURN i END + END ; + INC(i) + END ; + RETURN -1 +END Pos; + + +PROCEDURE Cap* (VAR s: ARRAY OF CHAR); + VAR i: INTEGER; +BEGIN + i := 0; + WHILE s[i] # 0X DO + IF ("a" <= s[i]) & (s[i] <= "z") THEN s[i] := CAP(s[i]) END ; + INC(i) + END +END Cap; + + +PROCEDURE Match* (string, pattern: ARRAY OF CHAR): BOOLEAN; + + PROCEDURE M (VAR name, mask: ARRAY OF CHAR; n, m: INTEGER): BOOLEAN; + BEGIN + WHILE (n >= 0) & (m >= 0) & (mask[m] # "*") DO + IF name[n] # mask[m] THEN RETURN FALSE END ; + DEC(n); DEC(m) + END ; + (* ----- name empty | mask empty | mask ends with "*" *) + IF m < 0 THEN RETURN n < 0 END ; + (* ----- name empty | mask ends with "*" *) + WHILE (m >= 0) & (mask[m] = "*") DO DEC(m) END ; + IF m < 0 THEN RETURN TRUE END ; + (* ----- name empty | mask still to be matched *) + WHILE n >= 0 DO + IF M(name, mask, n, m) THEN RETURN TRUE END ; + DEC(n) + END ; + RETURN FALSE + END M; + +BEGIN + RETURN M(string, pattern, Length(string)-1, Length(pattern)-1) +END Match; + +END Strings. diff --git a/src/runtime/Texts.Mod b/src/runtime/Texts.Mod new file mode 100644 index 00000000..305b225d --- /dev/null +++ b/src/runtime/Texts.Mod @@ -0,0 +1,881 @@ +MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) + IMPORT + Files, Modules, Reals, SYSTEM; + + (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) + + + CONST + Displaywhite = 15; + ElemChar* = 1CX; + TAB = 9X; CR = 0DX; maxD = 9; + (**FileMsg.id**) + load* = 0; store* = 1; + (**Notifier op**) + replace* = 0; insert* = 1; delete* = 2; unmark* = 3; + (**Scanner.class**) + Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; + + textTag = 0F0X; DocBlockId = 0F7X; version = 01X; + + TYPE + FontsFont = POINTER TO FontDesc; + FontDesc = RECORD + name: ARRAY 32 OF CHAR; + END ; + + Run = POINTER TO RunDesc; + RunDesc = RECORD + prev, next: Run; + len: LONGINT; + fnt: FontsFont; + col, voff: SYSTEM.INT8; + ascii: BOOLEAN (* << *) + END; + + Piece = POINTER TO PieceDesc; + PieceDesc = RECORD (RunDesc) + file: Files.File; + org: LONGINT + END; + + Elem* = POINTER TO ElemDesc; + Buffer* = POINTER TO BufDesc; + Text* = POINTER TO TextDesc; + + ElemMsg* = RECORD END; + Handler* = PROCEDURE (e: Elem; VAR msg: ElemMsg); + + ElemDesc* = RECORD (RunDesc) + W*, H*: LONGINT; + handle*: Handler; + base: Text + END; + + FileMsg* = RECORD (ElemMsg) + id*: INTEGER; + pos*: LONGINT; + r*: Files.Rider + END; + + CopyMsg* = RECORD (ElemMsg) + e*: Elem + END; + + IdentifyMsg* = RECORD (ElemMsg) + mod*, proc*: ARRAY 32 OF CHAR + END; + + + BufDesc* = RECORD + len*: LONGINT; + head: Run + END; + + Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); + TextDesc* = RECORD + len*: LONGINT; + notify*: Notifier; + head, cache: Run; + corg: LONGINT + END; + + Reader* = RECORD + eot*: BOOLEAN; + fnt*: FontsFont; + col*, voff*: SYSTEM.INT8; + elem*: Elem; + rider: Files.Rider; + run: Run; + org, off: LONGINT + END; + + Scanner* = RECORD (Reader) + nextCh*: CHAR; + line*, class*: INTEGER; + i*: LONGINT; + x*: REAL; + y*: LONGREAL; + c*: CHAR; + len*: SHORTINT; + s*: ARRAY 64 OF CHAR (* << *) + END; + + Writer* = RECORD + buf*: Buffer; + fnt*: FontsFont; + col*, voff*: SYSTEM.INT8; + rider: Files.Rider; + file: Files.File + END; + + Alien = POINTER TO RECORD (ElemDesc) + file: Files.File; + org, span: LONGINT; + mod, proc: ARRAY 32 OF CHAR + END; + + VAR + new*: Elem; + del: Buffer; + FontsDefault: FontsFont; + + + PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; + VAR F: FontsFont; + BEGIN + NEW(F); COPY(name, F.name); RETURN F + END FontsThis; + + (* run primitives *) + + PROCEDURE Find (T: Text; VAR pos: LONGINT; VAR u: Run; VAR org, off: LONGINT); + VAR v: Run; m: LONGINT; + BEGIN + IF pos >= T.len THEN pos := T.len; u := T.head; org := T.len; off := 0; T.cache := T.head; T.corg := 0 + ELSE v := T.cache.next; m := pos - T.corg; + IF pos >= T.corg THEN + WHILE m >= v.len DO DEC(m, v.len); v := v.next END + ELSE + WHILE m < 0 DO v := v.prev; INC(m, v.len) END; + END; + u := v; org := pos - m; off := m; T.cache := v.prev; T.corg := org + END + END Find; + + PROCEDURE Split (off: LONGINT; VAR u, un: Run); + VAR p, U: Piece; + BEGIN + IF off = 0 THEN un := u; u := un.prev + ELSIF off >= u.len THEN un := u.next + ELSE NEW(p); un := p; U := u(Piece); + p^ := U^; INC(p.org, off); DEC(p.len, off); DEC(U.len, p.len); + p.ascii := u.ascii; p.prev := U; p.next := U.next; p.next.prev := p; U.next := p (* << *) + END + END Split; + + PROCEDURE Merge (T: Text; u: Run; VAR v: Run); + VAR p, q: Piece; + BEGIN + IF (u IS Piece) & (v IS Piece) & (u.fnt.name = v.fnt.name) & (u.col = v.col) & (u.voff = v.voff) + & (u(Piece).ascii = v(Piece).ascii) THEN (* << *) + p := u(Piece); q := v(Piece); + IF (p.file = q.file) & (p.org + p.len = q.org) THEN + IF T.cache = u THEN INC(T.corg, q.len) + ELSIF T.cache = v THEN T.cache := T.head; T.corg := 0 + END; + INC(p.len, q.len); v := v.next + END + END + END Merge; + + PROCEDURE Splice (un, v, w: Run; base: Text); (* (u, un) -> (u, v, w, un) *) + VAR u: Run; + BEGIN + IF v # w.next THEN u := un.prev; + u.next := v; v.prev := u; un.prev := w; w.next := un; + REPEAT + IF v IS Elem THEN v(Elem).base := base END; + v := v.next + UNTIL v = un + END + END Splice; + + PROCEDURE ClonePiece (p: Piece): Piece; + VAR q: Piece; + BEGIN NEW(q); q^ := p^; RETURN q + END ClonePiece; + + PROCEDURE CloneElem (e: Elem): Elem; + VAR msg: CopyMsg; + BEGIN msg.e := NIL; e.handle(e, msg); RETURN msg.e + END CloneElem; + + + (** Elements **) + + PROCEDURE CopyElem* (SE, DE: Elem); + BEGIN DE.len := SE.len; DE.fnt := SE.fnt; DE.col := SE.col; DE.voff := SE.voff; + DE.W := SE.W; DE.H := SE.H; DE.handle := SE.handle + END CopyElem; + + PROCEDURE ElemBase* (E: Elem): Text; + BEGIN RETURN E.base + END ElemBase; + + PROCEDURE ElemPos* (E: Elem): LONGINT; + VAR u: Run; pos: LONGINT; + BEGIN u := E.base.head.next; pos := 0; + WHILE u # E DO pos := pos + u.len; u := u.next END; + RETURN pos + END ElemPos; + + + PROCEDURE HandleAlien (E: Elem; VAR msg: ElemMsg); + VAR e: Alien; r: Files.Rider; i: LONGINT; ch: CHAR; + BEGIN + WITH E: Alien DO + IF msg IS CopyMsg THEN + WITH msg: CopyMsg DO NEW(e); CopyElem(E, e); + e.file := E.file; e.org := E.org; e.span := E.span; e.mod := E.mod; e.proc := E.proc; + msg.e := e + END + ELSIF msg IS IdentifyMsg THEN + WITH msg: IdentifyMsg DO + COPY(E.mod, msg.mod); COPY(E.proc, msg.proc); msg.mod[31] := 1X (*alien*) + END + ELSIF msg IS FileMsg THEN + WITH msg: FileMsg DO + IF msg.id = store THEN Files.Set(r, E.file, E.org); i := E.span; + WHILE i > 0 DO Files.Read(r, ch); Files.Write(msg.r, ch); DEC(i) END + END + END + END + END + END HandleAlien; + + + (** Buffers **) + + PROCEDURE OpenBuf* (B: Buffer); + VAR u: Run; + BEGIN NEW(u); u.next := u; u.prev := u; B.head := u; B.len := 0 + END OpenBuf; + + PROCEDURE Copy* (SB, DB: Buffer); + VAR u, v, vn: Run; + BEGIN u := SB.head.next; v := DB.head.prev; + WHILE u # SB.head DO + IF u IS Piece THEN vn := ClonePiece(u(Piece)) ELSE vn := CloneElem(u(Elem)) END; + v.next := vn; vn.prev := v; v := vn; u := u.next + END; + v.next := DB.head; DB.head.prev := v; + INC(DB.len, SB.len) + END Copy; + + PROCEDURE Recall* (VAR B: Buffer); + BEGIN B := del; del := NIL + END Recall; + + + (** Texts **) + + PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); + VAR u, v, w, wn: Run; uo, ud, vo, vd: LONGINT; + BEGIN Find(T, beg, u, uo, ud); Find(T, end, v, vo, vd); + w := B.head.prev; + WHILE u # v DO + IF u IS Piece THEN wn := ClonePiece(u(Piece)); DEC(wn.len, ud); INC(wn(Piece).org, ud) + ELSE wn := CloneElem(u(Elem)) + END; + w.next := wn; wn.prev := w; w := wn; u := u.next; ud := 0 + END; + IF vd > 0 THEN (*v IS Piece*) wn := ClonePiece(v(Piece)); wn.len := vd - ud; INC(wn(Piece).org, ud); + w.next := wn; wn.prev := w; w := wn + END; + w.next := B.head; B.head.prev := w; + INC(B.len, end - beg) + END Save; + + PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); + VAR u, un, v: Run; p, q: Piece; uo, ud, len: LONGINT; + BEGIN Find(T, pos, u, uo, ud); Split(ud, u, un); + len := B.len; v := B.head.next; + Merge(T, u, v); Splice(un, v, B.head.prev, T); + INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END + END Insert; + + PROCEDURE Append* (T: Text; B: Buffer); + VAR v: Run; pos, len: LONGINT; + BEGIN pos := T.len; len := B.len; v := B.head.next; + Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); + INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; + IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END + END Append; + + PROCEDURE Delete* (T: Text; beg, end: LONGINT); + VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; + BEGIN + Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; + Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; + NEW(del); OpenBuf(del); del.len := end - beg; + Splice(del.head, un, v, NIL); + Merge(T, u, vn); u.next := vn; vn.prev := u; + DEC(T.len, end - beg); + IF T.notify # NIL THEN T.notify(T, delete, beg, end) END + END Delete; + + PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SYSTEM.INT8); + VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; + BEGIN Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; + Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; + WHILE un # vn DO + IF (0 IN sel) & (fnt # NIL) THEN un.fnt := fnt END; + IF 1 IN sel THEN un.col := col END; + IF 2 IN sel THEN un.voff := voff END; + Merge(T, u, un); + IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END + END; + Merge(T, u, un); u.next := un; un.prev := u; + IF T.notify # NIL THEN T.notify(T, replace, beg, end) END + END ChangeLooks; + + + (** Readers **) + + PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); + VAR u: Run; + BEGIN + IF pos >= T.len THEN pos := T.len END; + Find(T, pos, u, R.org, R.off); R.run := u; R.eot := FALSE; + IF u IS Piece THEN + Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) + END + END OpenReader; + + PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); + VAR u: Run; pos: LONGINT; nextch: CHAR; + BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); + IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; + IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) + ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) + pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); + IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END + END + ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) + ELSE ch := 0X; R.elem := NIL; R.eot := TRUE + END; + IF R.off = u.len THEN INC(R.org, u.len); u := u.next; + IF u IS Piece THEN + WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END + END; + R.run := u; R.off := 0 + END + END Read; + + PROCEDURE ReadElem* (VAR R: Reader); + VAR u, un: Run; + BEGIN u := R.run; + WHILE u IS Piece DO INC(R.org, u.len); u := u.next END; + IF u IS Elem THEN un := u.next; R.run := un; INC(R.org); R.off := 0; + R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem); + IF un IS Piece THEN + WITH un: Piece DO Files.Set(R.rider, un.file, un.org) END + END + ELSE R.eot := TRUE; R.elem := NIL + END + END ReadElem; + + PROCEDURE ReadPrevElem* (VAR R: Reader); + VAR u: Run; + BEGIN u := R.run.prev; + WHILE u IS Piece DO DEC(R.org, u.len); u := u.prev END; + IF u IS Elem THEN R.run := u; DEC(R.org); R.off := 0; + R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem) + ELSE R.eot := TRUE; R.elem := NIL + END + END ReadPrevElem; + + PROCEDURE Pos* (VAR R: Reader): LONGINT; + BEGIN RETURN R.org + R.off + END Pos; + + + (** Scanners --------------- NW --------------- **) + + PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); + BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " + END OpenScanner; + + (*IEEE floating point formats: + x = 2^(e-127) * 1.m bit 0: sign, bits 1- 8: e, bits 9-31: m + x = 2^(e-1023) * 1.m bit 0: sign, bits 1-11: e, bits 12-63: m *) + + PROCEDURE Scan* (VAR S: Scanner); + CONST maxD = 32; + VAR ch, term: CHAR; + neg, negE, hex: BOOLEAN; + i, j, h: SHORTINT; + e: INTEGER; k: LONGINT; + x, f: REAL; y, g: LONGREAL; + d: ARRAY maxD OF CHAR; + + PROCEDURE ReadScaleFactor; + BEGIN Read(S, ch); + IF ch = "-" THEN negE := TRUE; Read(S, ch) + ELSE negE := FALSE; + IF ch = "+" THEN Read(S, ch) END + END; + WHILE ("0" <= ch) & (ch <= "9") DO + e := e*10 + ORD(ch) - 30H; Read(S, ch) + END + END ReadScaleFactor; + + BEGIN ch := S.nextCh; i := 0; + LOOP + IF ch = CR THEN INC(S.line) + ELSIF (ch # " ") & (ch # TAB) THEN EXIT + END ; + Read(S, ch) + END; + IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") OR (ch = "/") OR (ch = ".") THEN (*name*) (* << *) + REPEAT S.s[i] := ch; INC(i); Read(S, ch) + UNTIL (CAP(ch) > "Z") & (ch # "_") (* << *) + OR ("A" > CAP(ch)) & (ch > "9") + OR ("0" > ch) & (ch # ".") & (ch # "/") (* << *) + OR (i = 63); (* << *) + S.s[i] := 0X; S.len := i; S.class := 1 + ELSIF ch = 22X THEN (*literal string*) + Read(S, ch); + WHILE (ch # 22X) & (ch >= " ") & (i # 63) DO (* << *) + S.s[i] := ch; INC(i); Read(S, ch) + END; + S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := 2 + ELSE + IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; + IF ("0" <= ch) & (ch <= "9") THEN (*number*) + hex := FALSE; j := 0; + LOOP d[i] := ch; INC(i); Read(S, ch); + IF ch < "0" THEN EXIT END; + IF "9" < ch THEN + IF ("A" <= ch) & (ch <= "F") THEN hex := TRUE; ch := CHR(ORD(ch)-7) + ELSIF ("a" <= ch) & (ch <= "f") THEN hex := TRUE; ch := CHR(ORD(ch)-27H) + ELSE EXIT + END + END + END; + IF ch = "H" THEN (*hex number*) + Read(S, ch); S.class := 3; + IF i-j > 8 THEN j := i-8 END ; + k := ORD(d[j]) - 30H; INC(j); + IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; + WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; + IF neg THEN S.i := -k ELSE S.i := k END + ELSIF ch = "." THEN (*read real*) + Read(S, ch); h := i; + WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; + IF ch = "D" THEN + e := 0; y := 0; g := 1; + REPEAT y := y*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; + WHILE j < i DO g := g/10; y := (ORD(d[j]) - 30H)*g + y; INC(j) END ; + ReadScaleFactor; + IF negE THEN + IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END + ELSIF e > 0 THEN + IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END + END ; + IF neg THEN y := -y END ; + S.class := 5; S.y := y + ELSE e := 0; x := 0; f := 1; + REPEAT x := x*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; + WHILE j < i DO f := f/10; x := (ORD(d[j])-30H)*f + x; INC(j) END; + IF ch = "E" THEN ReadScaleFactor END ; + IF negE THEN + IF e <= 38 THEN x := x / Reals.Ten(e) ELSE x := 0 END + ELSIF e > 0 THEN + IF e <= 38 THEN x := Reals.Ten(e) * x ELSE HALT(40) END + END ; + IF neg THEN x := -x END ; + S.class := 4; S.x := x + END ; + IF hex THEN S.class := 0 END + ELSE (*decimal integer*) + S.class := 3; k := 0; + REPEAT k := k*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = i; + IF neg THEN S.i := -k ELSE S.i := k END; + IF hex THEN S.class := 0 ELSE S.class := 3 END + END + ELSE S.class := 6; + IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END + END + END; + S.nextCh := ch + END Scan; + + + (** Writers **) + + PROCEDURE OpenWriter* (VAR W: Writer); + BEGIN NEW(W.buf); OpenBuf(W.buf); + W.fnt := FontsDefault; W.col := Displaywhite; W.voff := 0; + W.file := Files.New(""); Files.Set(W.rider, W.file, 0) + END OpenWriter; + + PROCEDURE SetFont* (VAR W: Writer; fnt: FontsFont); + BEGIN W.fnt := fnt + END SetFont; + + PROCEDURE SetColor* (VAR W: Writer; col: SYSTEM.INT8); + BEGIN W.col := col + END SetColor; + + PROCEDURE SetOffset* (VAR W: Writer; voff: SYSTEM.INT8); + BEGIN W.voff := voff + END SetOffset; + + + PROCEDURE Write* (VAR W: Writer; ch: CHAR); + VAR u, un: Run; p: Piece; + BEGIN Files.Write(W.rider, ch); INC(W.buf.len); un := W.buf.head; u := un.prev; + IF (u IS Piece) & (u(Piece).file = W.file) & (u.fnt.name = W.fnt.name) & (u.col = W.col) & (u.voff = W.voff) + & ~u(Piece).ascii THEN (* << *) + INC(u.len) + ELSE NEW(p); u.next := p; p.prev := u; p.next := un; un.prev := p; + p.len := 1; p.fnt := W.fnt; p.col := W.col; p.voff := W.voff; + p.file := W.file; p.org := Files.Length(W.file) - 1; p.ascii := FALSE (* << *) + END + END Write; + + PROCEDURE WriteElem* (VAR W: Writer; e: Elem); + VAR u, un: Run; + BEGIN + IF e.base # NIL THEN HALT(99) END; + INC(W.buf.len); e.len := 1; e.fnt := W.fnt; e.col := W.col; e.voff := W.voff; + un := W.buf.head; u := un.prev; u.next := e; e.prev := u; e.next := un; un.prev := e + END WriteElem; + + PROCEDURE WriteLn* (VAR W: Writer); + BEGIN Write(W, CR) + END WriteLn; + + PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); + VAR i: INTEGER; + BEGIN i := 0; + WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END + END WriteString; + + PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); + VAR + i: INTEGER; x0: SYSTEM.INT64; + a: ARRAY 24 OF CHAR; + BEGIN i := 0; + IF x < 0 THEN + IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN + ELSE DEC(n); x0 := -x + END + ELSE x0 := x + END; + REPEAT + a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) + UNTIL x0 = 0; + WHILE n > i DO Write(W, " "); DEC(n) END; + IF x < 0 THEN Write(W, "-") END; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + END WriteInt; + + PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); + VAR i: INTEGER; y: LONGINT; + a: ARRAY 20 OF CHAR; + BEGIN i := 0; Write(W, " "); + REPEAT y := x MOD 10H; + IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; + x := x DIV 10H; INC(i) + UNTIL i = 8; + REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 + END WriteHex; + + PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); + VAR e: INTEGER; x0: REAL; + d: ARRAY maxD OF CHAR; + BEGIN e := Reals.Expo(x); + IF e = 0 THEN + WriteString(W, " 0"); + REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 + ELSIF e = 255 THEN + WriteString(W, " NaN"); + WHILE n > 4 DO Write(W, " "); DEC(n) END + ELSE + IF n <= 9 THEN n := 3 ELSE DEC(n, 6) END; + REPEAT Write(W, " "); DEC(n) UNTIL n <= 8; + (*there are 2 < n <= 8 digits to be written*) + IF x < 0.0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; + e := (e - 127) * 77 DIV 256; + IF e >= 0 THEN x := x / Reals.Ten(e) ELSE x := Reals.Ten(-e) * x END; + IF x >= 10.0 THEN x := 0.1*x; INC(e) END; + x0 := Reals.Ten(n-1); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN x := x*0.1; INC(e) END; + Reals.Convert(x, n, d); + DEC(n); Write(W, d[n]); Write(W, "."); + REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; + Write(W, "E"); + IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; + Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) + END + END WriteReal; + + PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); + VAR e, i: INTEGER; sign: CHAR; x0: REAL; + d: ARRAY maxD OF CHAR; + + PROCEDURE seq(ch: CHAR; n: INTEGER); + BEGIN WHILE n > 0 DO Write(W, ch); DEC(n) END + END seq; + + PROCEDURE dig(n: INTEGER); + BEGIN + WHILE n > 0 DO + DEC(i); Write(W, d[i]); DEC(n) + END + END dig; + + BEGIN e := Reals.Expo(x); + IF k < 0 THEN k := 0 END; + IF e = 0 THEN seq(" ", n-k-2); Write(W, "0"); seq(" ", k+1) + ELSIF e = 255 THEN WriteString(W, " NaN"); seq(" ", n-4) + ELSE e := (e - 127) * 77 DIV 256; + IF x < 0 THEN sign := "-"; x := -x ELSE sign := " " END; + IF e >= 0 THEN (*x >= 1.0, 77/256 = log 2*) x := x/Reals.Ten(e) + ELSE (*x < 1.0*) x := Reals.Ten(-e) * x + END; + IF x >= 10.0 THEN x := 0.1*x; INC(e) END; + (* 1 <= x < 10 *) + IF k+e >= maxD-1 THEN k := maxD-1-e + ELSIF k+e < 0 THEN k := -e; x := 0.0 + END; + x0 := Reals.Ten(k+e); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN INC(e) END; + (*e = no. of digits before decimal point*) + INC(e); i := k+e; Reals.Convert(x, i, d); + IF e > 0 THEN + seq(" ", n-e-k-2); Write(W, sign); dig(e); + Write(W, "."); dig(k) + ELSE seq(" ", n-k-3); + Write(W, sign); Write(W, "0"); Write(W, "."); + seq("0", -e); dig(k+e) + END + END + END WriteRealFix; + + PROCEDURE WriteRealHex* (VAR W: Writer; x: REAL); + VAR i: INTEGER; + d: ARRAY 8 OF CHAR; + BEGIN Reals.ConvertH(x, d); i := 0; + REPEAT Write(W, d[i]); INC(i) UNTIL i = 8 + END WriteRealHex; + + PROCEDURE WriteLongReal* (VAR W: Writer; x: LONGREAL; n: INTEGER); + CONST maxD = 16; + VAR e: INTEGER; x0: LONGREAL; + d: ARRAY maxD OF CHAR; + BEGIN e := Reals.ExpoL(x); + IF e = 0 THEN + WriteString(W, " 0"); + REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 + ELSIF e = 2047 THEN + WriteString(W, " NaN"); + WHILE n > 4 DO Write(W, " "); DEC(n) END + ELSE + IF n <= 10 THEN n := 3 ELSE DEC(n, 7) END; + REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; + (*there are 2 <= n <= maxD digits to be written*) + IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := SHORT(LONG(e - 1023) * 77 DIV 256); + IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; + IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; + + (* Scale x to the number of digits requested *) + x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; + IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; + + (* Generate the mantissa digits of x *) + Reals.ConvertL(x, n, d); + + DEC(n); Write(W, d[n]); Write(W, "."); + REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; + + Write(W, "D"); + IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; + Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; + Write(W, CHR(e DIV 10 + 30H)); + Write(W, CHR(e MOD 10 + 30H)) + END + END WriteLongReal; + + PROCEDURE WriteLongRealHex* (VAR W: Writer; x: LONGREAL); + VAR i: INTEGER; + d: ARRAY 16 OF CHAR; + BEGIN Reals.ConvertHL(x, d); i := 0; + REPEAT Write(W, d[i]); INC(i) UNTIL i = 16 + END WriteLongRealHex; + + PROCEDURE WriteDate* (VAR W: Writer; t, d: LONGINT); + + PROCEDURE WritePair(ch: CHAR; x: LONGINT); + BEGIN Write(W, ch); + Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) + END WritePair; + + BEGIN + WritePair(" ", d MOD 32); WritePair(".", d DIV 32 MOD 16); WritePair(".", d DIV 512 MOD 128); + WritePair(" ", t DIV 4096 MOD 32); WritePair(":", t DIV 64 MOD 64); WritePair(":", t MOD 64) + END WriteDate; + + + (** Text Filing **) + + PROCEDURE Load0 (VAR r: Files.Rider; T: Text); + VAR u, un: Run; p: Piece; e: Elem; + org, pos, hlen, plen: LONGINT; ecnt, fcnt: SHORTINT; + fno, col, voff: SYSTEM.INT8; + f: Files.File; + msg: FileMsg; + mods, procs: ARRAY 64, 32 OF CHAR; + name: ARRAY 32 OF CHAR; + fnts: ARRAY 32 OF FontsFont; + + PROCEDURE LoadElem (VAR r: Files.Rider; pos, span: LONGINT; VAR e: Elem); + VAR M: Modules.Module; Cmd: Modules.Command; a: Alien; + org, ew, eh: LONGINT; eno: SYSTEM.INT8; + BEGIN new := NIL; + Files.ReadLInt(r, ew); Files.ReadLInt(r, eh); Files.Read(r, eno); + IF eno > ecnt THEN ecnt := eno; Files.ReadString(r, mods[eno]); Files.ReadString(r, procs[eno]) END; + org := Files.Pos(r); M := Modules.ThisMod(mods[eno]); + IF M # NIL THEN Cmd := Modules.ThisCommand(M, procs[eno]); + IF Cmd # NIL THEN Cmd END + END; + e := new; + IF e # NIL THEN e.W := ew; e.H := eh; e.base := T; + msg.pos := pos; e.handle(e, msg); + IF Files.Pos(r) # org + span THEN e := NIL END + END; + IF e = NIL THEN Files.Set(r, f, org + span); + NEW(a); a.W := ew; a.H := eh; a.handle := HandleAlien; a.base := T; + a.file := f; a.org := org; a.span := span; + COPY(mods[eno], a.mod); COPY(procs[eno], a.proc); + e := a + END + END LoadElem; + + BEGIN pos := Files.Pos(r); f := Files.Base(r); + NEW(u); u.len := MAX(LONGINT); (*u.fnt := FontsDefault;*)u.fnt := NIL; u.col := Displaywhite; + T.head := u; ecnt := 0; fcnt := 0; + msg.id := load; msg.r := r; + Files.ReadLInt(msg.r, hlen); (*!!!org := pos + hlen;*) org := pos -2 + hlen; pos := org; Files.Read(msg.r, fno); + WHILE fno # 0 DO + IF fno > fcnt THEN fcnt := fno; Files.ReadString(msg.r, name); fnts[fno] := FontsThis(name) END; + Files.Read(msg.r, col); Files.Read(msg.r, voff); Files.ReadLInt(msg.r, plen); + IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen + ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 + END; + (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; + INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) + END; + u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; + Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) + END Load0; + + PROCEDURE Load* (VAR r: Files.Rider; T: Text); + CONST oldTag = -4095; + VAR tag: INTEGER; + BEGIN + (* for compatibility inner text tags are checked and skipped; remove this in a later version *) + Files.ReadInt(r, tag); IF tag # oldTag THEN Files.Set(r, Files.Base(r), Files.Pos(r)-2) END; + Load0(r, T) + END Load; + + PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; r: Files.Rider; u: Run; p: Piece; tag, version: CHAR; hlen: LONGINT; + BEGIN f := Files.Old(name); + IF f = NIL THEN f := Files.New("") END; + Files.Set(r, f, 0); Files.Read(r, tag); Files.Read(r, version); + IF (tag = textTag) OR (tag = 01X) & (version = textTag) THEN Load0(r, T) + ELSE (*ascii*) + NEW(u); u.len := MAX(LONGINT); u.fnt := NIL; u.col := Displaywhite; + NEW(p); + IF (tag = DocBlockId) & (version = 07X) THEN (* extract ascii text from System 3 text document *) + Files.Set(r, f, 28); Files.ReadLInt(r, hlen); + Files.Set(r, f, 22 + hlen); Files.ReadLInt(r, T.len); p.org := 26 + hlen + ELSE + T.len := Files.Length(f); p.org := 0 + END ; + IF T.len > 0 THEN p.len := T.len; p.fnt := FontsDefault; + p.col := Displaywhite; p.voff := 0; p.file := f; p.ascii := TRUE; + u.next := p; u.prev := p; p.next := u; p.prev := u + ELSE u.next := u; u.prev := u + END; + T.head := u; T.cache := T.head; T.corg := 0 + END + END Open; + + PROCEDURE Store* (VAR r: Files.Rider; T: Text); + VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fcnt: SHORTINT; ch: CHAR; (* << *) + fno: SYSTEM.INT8; + msg: FileMsg; iden: IdentifyMsg; + mods, procs: ARRAY 64, 32 OF CHAR; + fnts: ARRAY 32 OF FontsFont; + block: ARRAY 1024 OF CHAR; + + PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); + VAR r1: Files.Rider; org, span: LONGINT; eno: SYSTEM.INT8; + BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; + WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; + Files.Set(r1, Files.Base(r), Files.Pos(r)); + Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) + Files.Write(r, eno); + IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; + msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; + Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) + END StoreElem; + + BEGIN + org := Files.Pos(r); msg.id := store; msg.r := r; Files.WriteLInt(msg.r, 0); (*fixup slot*) + u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; + WHILE u # T.head DO + IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; + IF iden.mod[0] # 0X THEN + fnts[fcnt] := u.fnt; fno := 1; + WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; + Files.Write(msg.r, fno); + IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; + Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) + END; + IF u IS Piece THEN rlen := u.len; un := u.next; + WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO + INC(rlen, un.len); un := un.next + END; + Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un + ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next + ELSE INC(delta); u := u.next + END + END; + Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); + (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; + Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) + u := T.head.next; + WHILE u # T.head DO + IF u IS Piece THEN + WITH u: Piece DO + IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) + WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); + IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE Files.Write(msg.r, ch) END + END + ELSE Files.Set(r1, u.file, u.org); delta := u.len; + WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); + Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) + END; + Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) + END + END + ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); + IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END + END; + u := u.next + END; + r := msg.r; + IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END + END Store; + + PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); + VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; + BEGIN + f := Files.New(name); Files.Set(r, f, 0); Files.Write(r, textTag); Files.Write(r, version); Store(r, T); + i := 0; WHILE name[i] # 0X DO INC(i) END; + COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; + Files.Rename(name, bak, res); Files.Register(f) + END Close; + +BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" +END Texts. diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 288fc04b..034906bd 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -41,7 +41,7 @@ VAR SeekCur-: INTEGER; SeekEnd-: INTEGER; - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) @@ -547,6 +547,6 @@ BEGIN SeekCur := seekcur(); SeekEnd := seekend(); - nl[0] := 0AX; (* LF *) - nl[1] := 0X; + NL[0] := 0AX; (* LF *) + NL[1] := 0X; END Platform. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 16311bd0..862ee483 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -155,16 +155,20 @@ installable: # May require root access. install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/$(MODEL)" + @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/2 "$(INSTALLDIR)/C + @mkdir -p "$(INSTALLDIR)/bin" + @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" + @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" + + @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/*.h "$(INSTALLDIR)/2/include/" + @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/2/sym/" + @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" + @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" + @mkdir -p "$(INSTALLDIR)/lib" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/include" - @mkdir -p "$(INSTALLDIR)/$(MODEL)/sym" - @cp $(BUILDDIR)/*.h "$(INSTALLDIR)/$(MODEL)/include/" - @cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/$(MODEL)/sym/" - @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" - @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi @@ -184,176 +188,194 @@ uninstall: if which ldconfig >/dev/null 2>&1; then ldconfig; fi +runtime: + @printf "\nMaking v4 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowReal.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowLReal.Mod +# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod v4: @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/v4/Sets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Real0.Mod TODO: Comment disabled lines contain use of VAL that reads beyond source variable ooc: @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/pow/powStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/system/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/Listen.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethZip.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethDates.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethSets.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZip.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethDates.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethReals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethStrings.Mod -librarybinary: - @printf "\nMaking lib$(ONAME)\n" -# Remove objects that should not be part of the library +O2library: v4 ooc2 ooc ulm pow32 misc s3 + @printf "\nMaking lib$(ONAME)2\n" rm -f $(BUILDDIR)/Compiler.o - # Note: remining compiler files are retained in the library allowing the building # of utilities like BrowserCmd.Mod (aka showdef). - # Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/*.o - + ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o # Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o + @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o -library: v4 ooc2 ooc ulm pow32 misc s3 librarybinary +OakwoodLibrary: + @printf "\nMaking lib$(ONAME)$(MODEL)\n" + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) + @make -f src/tools/make/oberon.mk -s runtime MODEL=$(MODEL) + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o From 25d99fd36af45b9d33d65f97784e6075dff0151d Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 28 Sep 2016 18:48:56 +0100 Subject: [PATCH 062/140] Add SYSTEM.SET32 and 64 types. Fix 32 bit build. --- makefile | 10 ++++++++-- src/compiler/Compiler.Mod | 8 +++++++- src/compiler/OPC.Mod | 6 ++++-- src/compiler/OPT.Mod | 28 +++++++++++++++++++--------- src/compiler/OPV.Mod | 2 ++ src/runtime/Files.Mod | 5 +++-- src/runtime/Platformunix.Mod | 2 +- src/tools/make/oberon.mk | 16 +++++++--------- 8 files changed, 51 insertions(+), 26 deletions(-) diff --git a/makefile b/makefile index 5202abb7..fc481183 100644 --- a/makefile +++ b/makefile @@ -157,7 +157,7 @@ full: configuration @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C + @make -f src/tools/make/oberon.mk -s runtime MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges @make -f src/tools/make/oberon.mk -s install @@ -192,7 +192,13 @@ browsercmd: configuration # library: build all directories under src/library library: configuration @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s OakwoodLibrary MODEL=C + @make -f src/tools/make/oberon.mk -s runtime MODEL=C + +runtime: configuration + @make -f src/tools/make/oberon.mk -s runtime MODEL=C + + + # Individual library components v4: configuration diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index e5acdac7..f21ef95d 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -55,7 +55,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *) BEGIN OPT.sysptrtyp.size := OPM.AddressSize; OPT.adrtyp.size := OPM.AddressSize; - OPT.settyp.size := OPM.SetSize; adrinttyp := OPT.IntType(OPM.AddressSize); OPT.adrtyp.strobj := adrinttyp.strobj; @@ -68,6 +67,13 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; + (*OPT.settyp.size := OPM.SetSize;*) + CASE OPM.LongintSize OF + |4: OPT.settyp := OPT.set32typ + ELSE OPT.settyp := OPT.set64typ + END; + OPT.setobj.typ := OPT.settyp; + (* Enable or disable (non-system) BYTE type *) IF OPM.Model = "C" THEN OPT.cpbytetyp.strobj.name[4] := 0X (* Enable Component Pascal non-system BYTE type *) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e0313bbe..e601db3a 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -111,9 +111,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF hashtab[h] >= 0 THEN IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END - ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN + ELSIF (mode = OPT.Typ) & (obj.typ.form IN {OPT.Int, OPT.Set}) THEN IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") - ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) + ELSE + IF obj.typ.form = OPT.Int THEN OPM.WriteString("int") ELSE OPM.WriteString("uint") END; + OPM.WriteInt(obj.typ.size*8) END ELSE IF (mode # OPT.Typ) OR (obj^.linkadr # PredefinedType) THEN diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 3732b2cb..ac134c9c 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,10 +155,11 @@ VAR bytetyp*, cpbytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, hinttyp*, int8typ*, int16typ*, int32typ*, int64typ*, - realtyp*, lrltyp*, settyp*, stringtyp*, + settyp*, set32typ*, set64typ*, + realtyp*, lrltyp*, stringtyp*, adrtyp*, sysptrtyp*: Struct; - sintobj*, intobj*, lintobj*: Object; + sintobj*, intobj*, lintobj*, setobj*: Object; nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) @@ -229,6 +230,12 @@ BEGIN RETURN int64typ END IntType; +PROCEDURE SetType*(size: LONGINT): Struct; +BEGIN + IF size = set32typ.size THEN RETURN set32typ END; + RETURN set64typ +END SetType; + PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN @@ -803,10 +810,9 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; BEGIN - IF tag = Int THEN - RETURN IntType(OPM.SymRInt()) - ELSE - RETURN impCtxt.ref[tag] + IF tag = Int THEN RETURN IntType(OPM.SymRInt()) + ELSIF tag = Set THEN RETURN SetType(OPM.SymRInt()) + ELSE RETURN impCtxt.ref[tag] END END InTyp; @@ -1124,7 +1130,7 @@ END Import; VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); - IF typ.ref = Int THEN OPM.SymWInt(typ.size) END + IF typ.ref IN {Int, Set} THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1170,7 +1176,7 @@ END Import; | Bool, Char: OPM.SymWCh(CHR(obj^.conval^.intval)) | Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) - | Set: OPM.SymWSet(obj^.conval^.setval) + | Set: OPM.SymWSet(obj^.conval^.setval); OPM.SymWInt(obj.typ.size) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) | String: OutName(obj^.conval^.ext^) @@ -1301,6 +1307,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterTyp("SET32", Set, 4, set32typ); + EnterTyp("SET64", Set, 8, set64typ); EnterProc("ADR", adrfn); EnterProc("CC", ccfn); @@ -1321,7 +1329,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); - EnterTyp("SET", Set, -1, settyp); (* Size set in Compiler.PropagateElementaryTypeSize *) +(*EnterTyp("SET", Set, -1, settyp);*) (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); @@ -1330,6 +1338,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); EnterTypeAlias("LONGINT", lintobj); + EnterTypeAlias("SET", setobj); + EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 39bfeded..0d29d56d 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -145,6 +145,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; + OPT.set32typ^.strobj^.linkadr := PredefinedType; + OPT.set64typ^.strobj^.linkadr := PredefinedType; OPT.hinttyp.strobj.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 7e497627..46f16c85 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -73,6 +73,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); @@ -427,7 +428,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) END; r.res := 0; r.eof := FALSE @@ -465,7 +466,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; restInBuf := bufsize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 034906bd..3db3f2d7 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 862ee483..af0cbe2c 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -189,7 +189,9 @@ uninstall: runtime: - @printf "\nMaking v4 library for -O$(MODEL)\n" + @printf "\nMaking run time library for -O$(MODEL)\n" + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod @@ -204,6 +206,10 @@ runtime: # cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod + @printf "\nMaking lib$(ONAME)$(MODEL)\n" + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o + v4: @@ -369,14 +375,6 @@ O2library: v4 ooc2 ooc ulm pow32 misc s3 -OakwoodLibrary: - @printf "\nMaking lib$(ONAME)$(MODEL)\n" - mkdir -p $(BUILDDIR)/$(MODEL) - cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) - @make -f src/tools/make/oberon.mk -s runtime MODEL=$(MODEL) - ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o - @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o - From 08bf8d2fc3bae52e3a82e0d3aeb016449dc63728 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 29 Sep 2016 10:28:40 +0100 Subject: [PATCH 063/140] Propagate NL spelling change to PlatformWindows. --- src/runtime/Platformwindows.Mod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index a538fdc5..8471eabb 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -50,7 +50,7 @@ VAR InterruptHandler: SignalHandler; - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) + NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) @@ -616,7 +616,7 @@ BEGIN StdOut := getstdouthandle(); StdErr := getstderrhandle(); - nl[0] := 0DX; (* CR *) - nl[1] := 0AX; (* LF *) - nl[2] := 0X; + NL[0] := 0DX; (* CR *) + NL[1] := 0AX; (* LF *) + NL[2] := 0X; END Platform. From 6dedf34785440708335a5581503a2cce74064b93 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 16:38:22 +0100 Subject: [PATCH 064/140] SET32 and SET64 compatibility and bootstrap update. --- bootstrap/unix-44/Compiler.c | 24 ++++-- bootstrap/unix-44/Configuration.c | 11 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 9 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 52 ++++-------- bootstrap/unix-44/Files.h | 10 +-- bootstrap/unix-44/Heap.c | 9 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 9 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 28 ++++--- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 33 ++++---- bootstrap/unix-44/OPM.h | 10 +-- bootstrap/unix-44/OPP.c | 13 +-- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 9 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 54 ++++++++---- bootstrap/unix-44/OPT.h | 11 +-- bootstrap/unix-44/OPV.c | 12 ++- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 15 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/Reals.c | 9 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 9 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 13 +-- bootstrap/unix-44/Texts.h | 4 +- bootstrap/unix-44/errors.c | 9 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 9 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 9 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 24 ++++-- bootstrap/unix-48/Configuration.c | 11 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 9 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 52 ++++-------- bootstrap/unix-48/Files.h | 10 +-- bootstrap/unix-48/Heap.c | 9 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 9 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 28 ++++--- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 33 ++++---- bootstrap/unix-48/OPM.h | 10 +-- bootstrap/unix-48/OPP.c | 13 +-- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 9 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 54 ++++++++---- bootstrap/unix-48/OPT.h | 11 +-- bootstrap/unix-48/OPV.c | 12 ++- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 15 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/Reals.c | 9 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 9 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 13 +-- bootstrap/unix-48/Texts.h | 4 +- bootstrap/unix-48/errors.c | 9 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 9 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 9 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 24 ++++-- bootstrap/unix-88/Configuration.c | 11 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 9 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 52 ++++-------- bootstrap/unix-88/Files.h | 10 +-- bootstrap/unix-88/Heap.c | 9 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 9 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 120 ++++++++++++++++----------- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 28 ++++--- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 33 ++++---- bootstrap/unix-88/OPM.h | 10 +-- bootstrap/unix-88/OPP.c | 13 +-- bootstrap/unix-88/OPP.h | 4 +- bootstrap/unix-88/OPS.c | 9 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 54 ++++++++---- bootstrap/unix-88/OPT.h | 11 +-- bootstrap/unix-88/OPV.c | 12 ++- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 15 ++-- bootstrap/unix-88/Platform.h | 4 +- bootstrap/unix-88/Reals.c | 9 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 9 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 13 +-- bootstrap/unix-88/Texts.h | 4 +- bootstrap/unix-88/errors.c | 9 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 9 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 9 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 24 ++++-- bootstrap/windows-48/Configuration.c | 11 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 9 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 52 ++++-------- bootstrap/windows-48/Files.h | 10 +-- bootstrap/windows-48/Heap.c | 9 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 9 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 120 ++++++++++++++++----------- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 28 ++++--- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 33 ++++---- bootstrap/windows-48/OPM.h | 10 +-- bootstrap/windows-48/OPP.c | 13 +-- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 9 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 54 ++++++++---- bootstrap/windows-48/OPT.h | 11 +-- bootstrap/windows-48/OPV.c | 12 ++- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 9 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 9 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 9 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 13 +-- bootstrap/windows-48/Texts.h | 4 +- bootstrap/windows-48/errors.c | 9 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 9 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 9 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 24 ++++-- bootstrap/windows-88/Configuration.c | 11 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 9 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 52 ++++-------- bootstrap/windows-88/Files.h | 10 +-- bootstrap/windows-88/Heap.c | 9 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 9 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 120 ++++++++++++++++----------- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 28 ++++--- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 33 ++++---- bootstrap/windows-88/OPM.h | 10 +-- bootstrap/windows-88/OPP.c | 13 +-- bootstrap/windows-88/OPP.h | 4 +- bootstrap/windows-88/OPS.c | 9 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 54 ++++++++---- bootstrap/windows-88/OPT.h | 11 +-- bootstrap/windows-88/OPV.c | 12 ++- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 9 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 9 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 9 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 13 +-- bootstrap/windows-88/Texts.h | 4 +- bootstrap/windows-88/errors.c | 9 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 9 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 9 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 14 +++- src/compiler/OPM.Mod | 24 +++++- src/compiler/OPT.Mod | 3 + src/runtime/Files.Mod | 33 +++----- src/runtime/LowReal.Mod | 69 ++++++++------- src/runtime/Math.Mod | 54 ++++++------ src/system/Files.Mod | 116 ++++++++++++-------------- 202 files changed, 1650 insertions(+), 1272 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4800d53c..b1a7e280 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 55e5fa16..fd146132 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 7efc4cc4..9682088a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 18c66534..defb84f0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 158cb341..01e08432 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index efc9fd98..a8af28c1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e402259d..2d6de22a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -129,7 +129,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4800d53c..b1a7e280 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 55e5fa16..fd146132 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3f54ed72..5bfcda58 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 18c66534..defb84f0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 158cb341..01e08432 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 28f099a4..09661382 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0afd65f7..86f8f5b7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index c2089f05..206f8024 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index efa49511..8e446a1c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5aebf125..edb43852 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -48,9 +48,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -62,10 +61,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 71ad15a1..571a7dd2 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 0cd62e2b..2187094a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 0e05b5aa..e18d29cf 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 297ade25..9ecaaba2 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index c9986e20..6bfd4b38 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index b0a12a18..98ef4a7f 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 07fa214f..5171284e 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 26dc3ce5..4d9d1fb1 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -40,7 +41,7 @@ export int64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -798,7 +799,7 @@ export void *Platform__init(void) Platform_SeekSet = Platform_seekset(); Platform_SeekCur = Platform_seekcur(); Platform_SeekEnd = Platform_seekend(); - Platform_nl[0] = 0x0a; - Platform_nl[1] = 0x00; + Platform_NL[0] = 0x0a; + Platform_NL[1] = 0x00; __ENDMOD; } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c9b53f3c..c308ce3a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a71cf72a..9a4efb22 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 47f1e428..7f02a3aa 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 7d63057e..d6ad8ef3 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index ef927317..39445fd2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE(((address)buf->data) + offset, ((address)x) + xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE(((address)x) + xpos, ((address)buf->data) + offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 20), {8, -8}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8d274283..1b482bb6 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -46,9 +46,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -60,10 +59,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 1f66b283..b3eea6a3 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 9e9400e1..a7135c5b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index f165488e..2984f32f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 534a5c0d..32bb978e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 010efab1..1eff447d 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3f54ed72..5bfcda58 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ff99f665..99e7aa6a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 41a1da42..38a8dd6e 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 7917d958..0d3476b4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 28f099a4..09661382 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0afd65f7..86f8f5b7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 1b3b14f1..637fd329 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -83,7 +84,6 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; OPT_adrtyp->size = OPM_AddressSize; - OPT_settyp->size = OPM_SetSize; adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); @@ -92,6 +92,20 @@ static void Compiler_PropagateElementaryTypeSizes (void) OPT_sintobj->typ = OPT_sinttyp; OPT_intobj->typ = OPT_inttyp; OPT_lintobj->typ = OPT_linttyp; + switch (OPM_LongintSize) { + case 4: + OPT_settyp = OPT_set32typ; + break; + default: + OPT_settyp = OPT_set64typ; + break; + } + OPT_setobj->typ = OPT_settyp; + if (__STRCMP(OPM_Model, "C") == 0) { + OPT_cpbytetyp->strobj->name[4] = 0x00; + } else { + OPT_cpbytetyp->strobj->name[4] = '@'; + } } void Compiler_Translate (void) diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 85c8cf89..a3240e8e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" @@ -18,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index a365d693..4d4279da 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7d63057e..d6ad8ef3 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 08f4e38e..6549e2cc 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 72ef67df..8d9e0113 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,13 +1,13 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" -#include "Configuration.h" -#include "Console.h" #include "Heap.h" +#include "Console.h" #include "Platform.h" #include "Strings.h" @@ -89,9 +89,8 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -104,13 +103,13 @@ export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) +#define Files_ToAdr(x) (address)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { @@ -662,7 +661,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + (int64)offset, (address)x + (int64)xpos, min); + __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + (int64)xpos, (address)buf->data + (int64)offset, min); + __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -862,13 +861,13 @@ void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x) +void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) { CHAR b[4]; int32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (SET)l; + *x = (uint32)l; } void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) @@ -932,13 +931,6 @@ void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) *x = n; } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x) -{ - int32 n; - Files_ReadNum(&*R, R__typ, &n); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); @@ -962,7 +954,7 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, SET x) +void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) { CHAR b[4]; int32 i; @@ -998,16 +990,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x) -{ - while (x < -64 || x > 63) { - Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); - x = __ASHR(x, 7); - } - Files_Write(&*R, R__typ, (CHAR)__MASK(x, -128)); -} - -void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -1059,9 +1042,8 @@ __TDESC(Files_Rider, 1, 1) = {__TDFLDS("Rider", 24), {8, -16}}; export void *Files__init(void) { __DEFMOD; - __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Console); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 668d8ebf..acb178a5 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -48,9 +48,8 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, int64 *x); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, SET *x); +import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); @@ -62,10 +61,9 @@ import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, L import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteNum64 (Files_Rider *R, address *R__typ, int64 x); +import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, SET x); +import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 71ad15a1..571a7dd2 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 0cd62e2b..2187094a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 0e05b5aa..e18d29cf 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a2ceebdf..9b84521f 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index e370e621..d099cad7 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -55,6 +56,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static void OPB_SetSetType (OPT_Node node); export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); export void OPB_StPar0 (OPT_Node *par0, int16 fctno); export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); @@ -223,6 +225,17 @@ static void OPB_SetIntType (OPT_Node node) node->typ = OPT_IntType(OPT_IntSize(node->conval->intval)); } +static void OPB_SetSetType (OPT_Node node) +{ + int32 i32; + __GET((address)&node->conval->setval + 4, i32, int32); + if (i32 == 0) { + node->typ = OPT_set32typ; + } else { + node->typ = OPT_set64typ; + } +} + OPT_Node OPB_NewIntConst (int64 intval) { OPT_Node _o_result; @@ -364,16 +377,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__57 { +static struct TypTest__58 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__57 *lnk; -} *TypTest__57_s; + struct TypTest__58 *lnk; +} *TypTest__58_s; -static void GTT__58 (OPT_Struct t0, OPT_Struct t1); +static void GTT__59 (OPT_Struct t0, OPT_Struct t1); -static void GTT__58 (OPT_Struct t0, OPT_Struct t1) +static void GTT__59 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -386,54 +399,54 @@ static void GTT__58 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__57_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__57_s->x, NIL); - (*TypTest__57_s->x)->readonly = (*TypTest__57_s->x)->left->readonly; + if (*TypTest__58_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__58_s->x, NIL); + (*TypTest__58_s->x)->readonly = (*TypTest__58_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__57_s->guard) { - if ((*TypTest__57_s->x)->class == 5) { + } else if (!*TypTest__58_s->guard) { + if ((*TypTest__58_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__57_s->x; - node->obj = *TypTest__57_s->obj; - *TypTest__57_s->x = node; + node->left = *TypTest__58_s->x; + node->obj = *TypTest__58_s->obj; + *TypTest__58_s->x = node; } else { - *TypTest__57_s->x = OPB_NewBoolConst(1); + *TypTest__58_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__57 _s; + struct TypTest__58 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__57_s; - TypTest__57_s = &_s; + _s.lnk = TypTest__58_s; + TypTest__58_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 11) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 11) { - GTT__58((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__59((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__58((*x)->typ, obj->typ); + GTT__59((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -442,7 +455,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__57_s = _s.lnk; + TypTest__58_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -1109,7 +1122,13 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (f == 4) { + if ((((f == 7 && g == 7)) && (*x)->typ->size > typ->size)) { + OPB_SetSetType(*x); + if ((*x)->typ->size > typ->size) { + OPB_err(203); + (*x)->conval->setval = 0x0; + } + } else if (f == 4) { if (g == 4) { if ((*x)->typ->size > typ->size) { OPB_SetIntType(*x); @@ -1243,6 +1262,13 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; + case 7: + if ((g == 7 && y->typ->size < z->typ->size)) { + OPB_Convert(&y, z->typ); + } else { + OPB_err(100); + } + break; case 5: if (g == 4) { OPB_Convert(&y, z->typ); @@ -1969,13 +1995,13 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) *par0 = x; } -static struct StPar1__52 { - struct StPar1__52 *lnk; -} *StPar1__52_s; +static struct StPar1__53 { + struct StPar1__53 *lnk; +} *StPar1__53_s; -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__53 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -1992,9 +2018,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) int16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__52 _s; - _s.lnk = StPar1__52_s; - StPar1__52_s = &_s; + struct StPar1__53 _s; + _s.lnk = StPar1__53_s; + StPar1__53_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2010,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2021,7 +2047,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2046,7 +2072,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__53(12, 19, p, x); + p = NewOp__54(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2068,7 +2094,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) t = x; x = p; p = t; - p = NewOp__53(19, 18, p, x); + p = NewOp__54(19, 18, p, x); } else { OPB_err(111); } @@ -2094,7 +2120,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) } p->obj = NIL; } else { - p = NewOp__53(12, 17, p, x); + p = NewOp__54(12, 17, p, x); p->typ = p->left->typ; } } else { @@ -2125,9 +2151,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__53(12, 27, p, x); + p = NewOp__54(12, 27, p, x); } else { - p = NewOp__53(12, 28, p, x); + p = NewOp__54(12, 28, p, x); } p->typ = p->left->typ; } @@ -2144,7 +2170,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) x = p; p = t; } - p = NewOp__53(19, fctno, p, x); + p = NewOp__54(19, fctno, p, x); } else { OPB_err(111); } @@ -2154,7 +2180,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(12, 26, p, x); + p = NewOp__54(12, 26, p, x); } else { OPB_err(111); } @@ -2182,7 +2208,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - p = NewOp__53(19, 30, p, x); + p = NewOp__54(19, 30, p, x); } else { OPB_err(111); } @@ -2228,7 +2254,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) break; } *par0 = p; - StPar1__52_s = _s.lnk; + StPar1__53_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 8c0fd594..07dda5db 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4c9ae495..545deb33 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -193,11 +194,15 @@ void OPC_Ident (OPT_Object obj) OPM_Write('_'); } } - } else if ((mode == 5 && obj->typ->form == 4)) { + } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { OPM_WriteString((CHAR*)"address", 8); } else { - OPM_WriteString((CHAR*)"int", 4); + if (obj->typ->form == 4) { + OPM_WriteString((CHAR*)"int", 4); + } else { + OPM_WriteString((CHAR*)"uint", 5); + } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } } else { @@ -1233,13 +1238,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 20); + OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); + OPM_WriteLn(); + OPM_WriteString((CHAR*)"#define INTEGER int", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 20); + OPM_WriteString((CHAR*)"#define LONGINT int", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 21); + OPM_WriteString((CHAR*)"#define SET uint", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1851,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - SET s; + uint32 s; int32 hex; BOOLEAN skipLeading; switch (form) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e681f43d..c9cf0ace 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 297ade25..9ecaaba2 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" @@ -25,7 +26,7 @@ static int16 OPM_GlobalAddressSize; export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; -export SET OPM_GlobalOptions, OPM_Options; +export uint32 OPM_GlobalOptions, OPM_Options; export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -52,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, SET set); +export void OPM_FPrintSet (int32 *fp, uint32 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -80,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (SET *s); +export void OPM_SymRSet (uint32 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (SET s); +export void OPM_SymWSet (uint32 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -329,7 +330,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)", 79); + OPM_LogWStr((CHAR*)" Size model for elementary types (default O2)", 47); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET.", 95); OPM_LogWLn(); @@ -709,10 +710,10 @@ void OPM_err (int16 n) void OPM_FPrint (int32 *fp, int64 val) { - *fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32); + *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, SET set) +void OPM_FPrintSet (int32 *fp, uint32 set) { OPM_FPrint(&*fp, (int32)set); } @@ -751,13 +752,11 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, &k); - _o_result = k; + _o_result = OPM_SymRInt(); return _o_result; } -void OPM_SymRSet (SET *s) +void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); } @@ -808,10 +807,10 @@ void OPM_SymWCh (CHAR ch) void OPM_SymWInt (int64 i) { - Files_WriteNum64(&OPM_newSF, Files_Rider__typ, i); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (SET s) +void OPM_SymWSet (uint32 s) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 933ef1b5..dd3c0c27 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -8,7 +8,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; -import SET OPM_GlobalOptions, OPM_Options; +import uint32 OPM_GlobalOptions, OPM_Options; import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, SET set); +import void OPM_FPrintSet (int32 *fp, uint32 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (SET *s); +import void OPM_SymRSet (uint32 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (SET s); +import void OPM_SymWSet (uint32 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index c9986e20..6bfd4b38 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPB.h" @@ -39,7 +40,7 @@ static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, SET opt); +export void OPP_Module (OPT_Node *prog, uint32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); @@ -1775,7 +1776,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, SET opt) +void OPP_Module (OPT_Node *prog, uint32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 373d8daa..c759545a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, SET opt); +import void OPP_Module (OPT_Node *prog, uint32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f8ed61bf..18c3c066 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 1f02668b..260fcd01 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index b0a12a18..98ef4a7f 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPM.h" @@ -19,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -88,8 +89,8 @@ typedef export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -137,7 +138,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); static OPT_Object OPT_InTProc (int8 mno); static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, SET opt); +export void OPT_Init (OPS_Name name, uint32 opt); export void OPT_InitRecno (void); static void OPT_InitStruct (OPT_Struct *typ, int8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); @@ -159,6 +160,7 @@ static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); +export OPT_Struct OPT_SetType (int32 size); export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); export int32 OPT_SizeAlignment (int32 size); export void OPT_TypSize (OPT_Struct typ); @@ -209,6 +211,17 @@ OPT_Struct OPT_IntType (int32 size) return _o_result; } +OPT_Struct OPT_SetType (int32 size) +{ + OPT_Struct _o_result; + if (size == OPT_set32typ->size) { + _o_result = OPT_set32typ; + return _o_result; + } + _o_result = OPT_set64typ; + return _o_result; +} + OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { OPT_Struct _o_result; @@ -449,7 +462,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, SET opt) +void OPT_Init (OPS_Name name, uint32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -1171,6 +1184,9 @@ static OPT_Struct OPT_InTyp (int32 tag) if (tag == 4) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; + } else if (tag == 7) { + _o_result = OPT_SetType(OPM_SymRInt()); + return _o_result; } else { _o_result = OPT_impCtxt.ref[__X(tag, 255)]; return _o_result; @@ -1628,7 +1644,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (typ->ref == 4) { + if (__IN(typ->ref, 0x90, 32)) { OPM_SymWInt(typ->size); } } else { @@ -1732,6 +1748,7 @@ static void OPT_OutConstant (OPT_Object obj) break; case 7: OPM_SymWSet(obj->conval->setval); + OPM_SymWInt(obj->typ->size); break; case 5: rval = obj->conval->realval; @@ -1959,28 +1976,32 @@ static void EnumPtrs(void (*P)(void*)) { P(OPT_topScope); P(OPT_undftyp); + P(OPT_niltyp); + P(OPT_notyp); P(OPT_bytetyp); + P(OPT_cpbytetyp); P(OPT_booltyp); P(OPT_chartyp); P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); P(OPT_hinttyp); - P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); P(OPT_int64typ); + P(OPT_settyp); + P(OPT_set32typ); + P(OPT_set64typ); P(OPT_realtyp); P(OPT_lrltyp); - P(OPT_settyp); P(OPT_stringtyp); - P(OPT_niltyp); - P(OPT_notyp); + P(OPT_adrtyp); P(OPT_sysptrtyp); P(OPT_sintobj); P(OPT_intobj); P(OPT_lintobj); + P(OPT_setobj); __ENUMP(OPT_GlbMod, 64, P); P(OPT_universe); P(OPT_syslink); @@ -2056,6 +2077,8 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT64", 4, 8, &OPT_int64typ); + OPT_EnterTyp((CHAR*)"SET32", 7, 4, &OPT_set32typ); + OPT_EnterTyp((CHAR*)"SET64", 7, 8, &OPT_set64typ); OPT_EnterProc((CHAR*)"ADR", 20); OPT_EnterProc((CHAR*)"CC", 21); OPT_EnterProc((CHAR*)"LSH", 22); @@ -2073,13 +2096,14 @@ export void *OPT__init(void) OPT_topScope->right = NIL; OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp); - OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp); + OPT_EnterTyp((CHAR*)"BYTE@", 4, 1, &OPT_cpbytetyp); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); + OPT_EnterTypeAlias((CHAR*)"SET", &OPT_setobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 202c8278..2bc05576 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - SET setval; + uint32 setval; LONGREAL realval; } OPT_ConstDesc; @@ -67,8 +67,8 @@ typedef import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; -import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; +import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; +import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; @@ -92,7 +92,7 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, SET opt); +import void OPT_Init (OPS_Name name, uint32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); @@ -104,6 +104,7 @@ import OPT_Node OPT_NewNode (int8 class); import OPT_Object OPT_NewObj (void); import OPT_Struct OPT_NewStr (int8 form, int8 comp); import void OPT_OpenScope (int8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (int32 size); import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); import int32 OPT_SizeAlignment (int32 size); import void OPT_TypSize (OPT_Struct typ); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 07fa214f..5171284e 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "OPC.h" @@ -187,6 +188,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPV_Traverse(topScope->right, topScope, 1); OPV_Traverse(topScope->right, topScope, 0); OPT_chartyp->strobj->linkadr = 2; + OPT_cpbytetyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; @@ -194,6 +196,8 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; + OPT_set32typ->strobj->linkadr = 2; + OPT_set64typ->strobj->linkadr = 2; OPT_hinttyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index a44fb5b5..f5e41d45 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 95dd629a..5a5ee14a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index b99b4747..b8d8c5e7 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 57e22100..d7d2994c 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index f3404dda..8c1ff819 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index bcf3cb9b..ac03bada 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9418692a..cc9d99a1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a71cf72a..9a4efb22 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Files.h" @@ -183,7 +184,7 @@ export address *Texts_Writer__typ; export address *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); @@ -565,7 +566,7 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; int32 co, uo, ud, vo, vd; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 47f1e428..7f02a3aa 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -130,7 +130,7 @@ import address *Texts_Scanner__typ; import address *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, SET sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index ba890a17..f284397b 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index d8124792..5aa2a5f6 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 76fdc084..fe7eb545 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index bb5be954..8cdd8e01 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index c44586d2..a4bc9ec1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,8 +1,9 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index c9a01a7c..44d81f73 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/26]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 547f2521..b29f6b49 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -107,6 +107,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN node.typ := OPT.IntType(OPT.IntSize(node.conval.intval)) END SetIntType; + PROCEDURE SetSetType(node: OPT.Node); + VAR i32: SYSTEM.INT32; + BEGIN SYSTEM.GET(SYSTEM.ADR(node.conval.setval)+4, i32); (* See if upper 32 bits are zero *) + IF i32 = 0 THEN node.typ := OPT.set32typ ELSE node.typ := OPT.set64typ END + END SetSetType; + PROCEDURE NewIntConst*(intval: SYSTEM.INT64): OPT.Node; VAR x: OPT.Node; BEGIN @@ -593,7 +599,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR node: OPT.Node; f, g: INTEGER; k: SYSTEM.INT64; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; (* f: old form, g: new form *) IF x^.class = OPT.Nconst THEN - IF f = OPT.Int THEN + IF (f = OPT.Set) & (g = OPT.Set) & (x.typ.size > typ.size) THEN + SetSetType(x); + IF x.typ.size > typ.size THEN err(203); x^.conval^.setval := {} END + ELSIF f = OPT.Int THEN IF g = OPT.Int THEN IF x.typ.size > typ.size THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END @@ -663,6 +672,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ) ELSE err(100) END + |OPT.Set: IF (g = OPT.Set) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSE err(100) + END |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) ELSE err(100) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c0f59250..3dd56c16 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -268,7 +268,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; - LogWStr(" Size model for elementary types (default O2 on 32 bit builds, OV on 64 bits)"); LogWLn; + LogWStr(" Size model for elementary types (default O2)"); LogWLn; LogWStr(" -O2 Original Oberon / Oberon-2: 8 bit SHORTINT, 16 bit INTEGER, 32 bit LONGINT and SET."); LogWLn; LogWStr(" -OC Component Pascal: 16 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; LogWStr(" -OV Alternate large model: 8 bit SHORTINT, 32 bit INTEGER, 64 bit LONGINT and SET."); LogWLn; @@ -597,10 +597,22 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; + (* todo PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum64(oldSF, k); RETURN k + BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; + *) + + PROCEDURE SymRInt64*(): SYSTEM.INT64; + BEGIN RETURN SymRInt() + END SymRInt64; + + (* todo + PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); + BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(SYSTEM.INT64, s)) + END SymRSet; + *) PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) @@ -644,9 +656,15 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END SymWCh; PROCEDURE SymWInt*(i: SYSTEM.INT64); - BEGIN Files.WriteNum64(newSF, i) + BEGIN Files.WriteNum(newSF, i) END SymWInt; + (* todo + PROCEDURE SymWSet*(s: SYSTEM.SET64); + BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) + END SymWSet; + *) + PROCEDURE SymWSet*(s: SET); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(LONGINT, s)) END SymWSet; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index ac134c9c..e55c7d3c 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,6 +15,9 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) + (* todo + setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) + *) setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 46f16c85..73d527cf 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -58,8 +58,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files res*: LONGINT; eof*: BOOLEAN; buf: Buffer; - org: LONGINT; - offset: LONGINT + org: LONGINT; (* File offset of block containing current position *) + offset: LONGINT (* Current position offset within block at org. *) END; @@ -654,6 +654,7 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; + (* PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; BEGIN s := 0; n := 0; Read(R, ch); @@ -661,18 +662,16 @@ Especially Length would become fairly complex. INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); x := n END ReadNum; - - PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); - (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms - VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n *) - VAR n: LONGINT; - BEGIN ReadNum(R, n); x := n - END ReadNum64; + + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; + BEGIN s := 0; q := 0; Read(R, b); + WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); + ASSERT(LEN(x) <= 8); + SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) + END ReadNum; PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) @@ -715,18 +714,12 @@ Especially Length would become fairly complex. WriteBytes(R, x, i+1) END WriteString; - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); BEGIN WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; Write(R, CHR(x MOD 128)) END WriteNum; - PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum64; - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); diff --git a/src/runtime/LowReal.Mod b/src/runtime/LowReal.Mod index 98f2a8a9..e5a8f8a6 100644 --- a/src/runtime/LowReal.Mod +++ b/src/runtime/LowReal.Mod @@ -23,7 +23,7 @@ MODULE LowReal; *) -IMPORT S := SYSTEM, Reals; +IMPORT SYSTEM; (* @@ -99,13 +99,13 @@ CONST ZERO = 0.0; expOffset = expoMax; - hiBit = 22; - expBit = hiBit+1; - nMask = {0..hiBit,31}; (* number mask *) - expMask = {expBit..30}; (* exponent mask *) + (*hiBit = 22;*) + (*expBit = hiBit+1;*) + nMask = {0..22,31}; (* number mask *) + expMask = {23..30}; (* exponent mask *) TYPE - Modes*= SET; + Modes* = SET; VAR (*small* : REAL; tmp: REAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) @@ -131,15 +131,24 @@ PROCEDURE exponent*(x: REAL): INTEGER; that lies between `expoMin' and `expoMax'. An exception shall occur and may be raised if `x' is equal to 0.0. *) + VAR w: SYSTEM.INT16; BEGIN (* NOTE: x=0.0 should raise exception *) - IF x = ZERO THEN RETURN 0 - ELSE RETURN Reals.Expo(x) - expOffset - END + IF x = ZERO THEN RETURN 0 END; + + RETURN SYSTEM.VAL(INTEGER, SYSTEM.LSH((SYSTEM.VAL(SYSTEM.SET32, x) * expMask), -23)); + + + SYSTEM.GET(SYSTEM.ADR(x)+2, w); (* Load most significant word *) + RETURN ((w DIV 128) MOD 256) - expOffset END exponent; -PROCEDURE SetExponent(VAR x: REAL; ex: INTEGER); -BEGIN Reals.SetExpo(x, ex + expOffset) +PROCEDURE SetExponent(VAR x: REAL; ex: SYSTEM.INT32); + VAR s: SYSTEM.SET32; +BEGIN + ex := SYSTEM.LSH(ex + expOffset, 23); + s := SYSTEM.VAL(SYSTEM.SET32, s) * nMask + SYSTEM.VAL(SYSTEM.SET32, ex) * expMask; + SYSTEM.PUT(SYSTEM.ADR(x), s) END SetExponent; PROCEDURE exponent10*(x: REAL): INTEGER; @@ -170,20 +179,20 @@ BEGIN IF x=ZERO THEN RETURN ZERO ELSE (* Set top 7 bits of exponent to 0111111 *) - S.GET(S.ADR(x)+3, c); + SYSTEM.GET(SYSTEM.ADR(x)+3, c); c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) - S.PUT(S.ADR(x)+3, c); + SYSTEM.PUT(SYSTEM.ADR(x)+3, c); (* Set bottom bit of exponent to 0 *) - S.GET(S.ADR(x)+2, c); + SYSTEM.GET(SYSTEM.ADR(x)+2, c); c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) - S.PUT(S.ADR(x)+2, c); + SYSTEM.PUT(SYSTEM.ADR(x)+2, c); RETURN x * 2.0; END (* CONST eZero={(hiBit+2)..29}; BEGIN IF x=ZERO THEN RETURN ZERO - ELSE RETURN S.VAL(REAL,(S.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) + ELSE RETURN SYSTEM.VAL(REAL,(SYSTEM.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) END *) END fraction; @@ -191,20 +200,20 @@ END fraction; PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; VAR c0, c1, c2, c3: CHAR; BEGIN - S.GET(S.ADR(real)+0, c3); - S.GET(S.ADR(real)+1, c2); - S.GET(S.ADR(real)+2, c1); - S.GET(S.ADR(real)+3, c0); + SYSTEM.GET(SYSTEM.ADR(real)+0, c3); + SYSTEM.GET(SYSTEM.ADR(real)+1, c2); + SYSTEM.GET(SYSTEM.ADR(real)+2, c1); + SYSTEM.GET(SYSTEM.ADR(real)+3, c0); RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) END IsInfinity; PROCEDURE IsNaN * (real: REAL) : BOOLEAN; VAR c0, c1, c2, c3: CHAR; BEGIN - S.GET(S.ADR(real)+0, c3); - S.GET(S.ADR(real)+1, c2); - S.GET(S.ADR(real)+2, c1); - S.GET(S.ADR(real)+3, c0); + SYSTEM.GET(SYSTEM.ADR(real)+0, c3); + SYSTEM.GET(SYSTEM.ADR(real)+1, c2); + SYSTEM.GET(SYSTEM.ADR(real)+2, c1); + SYSTEM.GET(SYSTEM.ADR(real)+3, c0); RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) DIV 128 = 1) & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) @@ -235,8 +244,8 @@ BEGIN END; SetExponent(x, SHORT(exp)); (* SetExponent replaces these 2 lines: - lexp := S.VAL(SET, S.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) - RETURN S.VAL(REAL, (S.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) + lexp := SYSTEM.VAL(SET, SYSTEM.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(REAL, (SYSTEM.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) *) END scale; @@ -280,7 +289,7 @@ BEGIN loBit := (hiBit+1) - exponent(x); IF loBit <= 0 THEN RETURN x (* no fractional part *) ELSIF loBit <= hiBit+1 THEN - RETURN S.VAL(REAL,S.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) + RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) ELSE RETURN ZERO (* no whole part *) END END intpart; @@ -305,7 +314,7 @@ BEGIN loBit:=places-n; IF n<=0 THEN RETURN ZERO (* exception should be raised *) ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) ELSE mask:={loBit..31}; (* truncation bit mask *) - RETURN S.VAL(REAL,S.VAL(SET,x)*mask) + RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*mask) END END trunc; @@ -320,8 +329,8 @@ PROCEDURE round*(x: REAL; n: INTEGER): REAL; BEGIN loBit:=places-n; IF n<=0 THEN RETURN ZERO (* exception should be raised *) ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) - ELSE mask:={loBit..31}; num:=S.VAL(SET,x); (* truncation bit mask and number as SET *) - x:=S.VAL(REAL,num*mask); (* truncated result *) + ELSE mask:={loBit..31}; num:=SYSTEM.VAL(SET,x); (* truncation bit mask and number as SET *) + x:=SYSTEM.VAL(REAL,num*mask); (* truncated result *) IF loBit-1 IN num THEN (* check if result should be rounded *) r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index c2a648c9..392534bd 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -573,6 +573,10 @@ BEGIN t:=ABS(x); RETURN arcsinh(x/sqrt(ONE-x*x)) END arctanh; +PROCEDURE ToREAL(h: HUGEINT): REAL; +BEGIN RETURN SYSTEM.VAL(REAL, h) +END ToREAL; + BEGIN (* determine some fundamental constants used by hyperbolic trig functions *) em:=l.ulp(ONE); @@ -582,31 +586,31 @@ BEGIN t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) - a1[1] :=ONE; - a1[2] :=S.VAL(REAL, 3F75257DH); - a1[3] :=S.VAL(REAL, 3F6AC0C7H); - a1[4] :=S.VAL(REAL, 3F60CCDFH); - a1[5] :=S.VAL(REAL, 3F5744FDH); - a1[6] :=S.VAL(REAL, 3F4E248CH); - a1[7] :=S.VAL(REAL, 3F45672AH); - a1[8] :=S.VAL(REAL, 3F3D08A4H); - a1[9] :=S.VAL(REAL, 3F3504F3H); - a1[10]:=S.VAL(REAL, 3F2D583FH); - a1[11]:=S.VAL(REAL, 3F25FED7H); - a1[12]:=S.VAL(REAL, 3F1EF532H); - a1[13]:=S.VAL(REAL, 3F1837F0H); - a1[14]:=S.VAL(REAL, 3F11C3D3H); - a1[15]:=S.VAL(REAL, 3F0B95C2H); - a1[16]:=S.VAL(REAL, 3F05AAC3H); - a1[17]:=HALF; + a1[1] := ONE; + a1[2] := ToREAL(3F75257DH); + a1[3] := ToREAL(3F6AC0C7H); + a1[4] := ToREAL(3F60CCDFH); + a1[5] := ToREAL(3F5744FDH); + a1[6] := ToREAL(3F4E248CH); + a1[7] := ToREAL(3F45672AH); + a1[8] := ToREAL(3F3D08A4H); + a1[9] := ToREAL(3F3504F3H); + a1[10] := ToREAL(3F2D583FH); + a1[11] := ToREAL(3F25FED7H); + a1[12] := ToREAL(3F1EF532H); + a1[13] := ToREAL(3F1837F0H); + a1[14] := ToREAL(3F11C3D3H); + a1[15] := ToREAL(3F0B95C2H); + a1[16] := ToREAL(3F05AAC3H); + a1[17] := HALF; (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) - a2[1]:=S.VAL(REAL, 31A92436H); - a2[2]:=S.VAL(REAL, 336C2A95H); - a2[3]:=S.VAL(REAL, 31A8FC24H); - a2[4]:=S.VAL(REAL, 331F580CH); - a2[5]:=S.VAL(REAL, 336A42A1H); - a2[6]:=S.VAL(REAL, 32C12342H); - a2[7]:=S.VAL(REAL, 32E75624H); - a2[8]:=S.VAL(REAL, 32CF9890H) + a2[1] := ToREAL(31A92436H); + a2[2] := ToREAL(336C2A95H); + a2[3] := ToREAL(31A8FC24H); + a2[4] := ToREAL(331F580CH); + a2[5] := ToREAL(336A42A1H); + a2[6] := ToREAL(32C12342H); + a2[7] := ToREAL(32E75624H); + a2[8] := ToREAL(32CF9890H) END oocRealMath. diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 76732ebc..04495ccb 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -1,6 +1,6 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - IMPORT SYSTEM, Platform, Heap, Strings, Configuration, Console; + IMPORT SYSTEM, Platform, Heap, Strings, Out := Console; (* standard data type I/O @@ -58,8 +58,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files res*: LONGINT; eof*: BOOLEAN; buf: Buffer; - org: LONGINT; - offset: LONGINT + org: LONGINT; (* File offset of block containing current position *) + offset: LONGINT (* Current position offset within block at org. *) END; @@ -73,18 +73,19 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); BEGIN - Console.Ln; Console.String("-- "); Console.String(s); Console.String(": "); + Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); IF f # NIL THEN - IF f.registerName # "" THEN Console.String(f.registerName) ELSE Console.String(f.workName) END; - IF f.fd # 0 THEN Console.String("f.fd = "); Console.Int(f.fd,1) END + IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; + IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END END; - IF errcode # 0 THEN Console.String(" errcode = "); Console.Int(errcode, 1) END; - Console.Ln; + IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; + Out.Ln; HALT(99) END Err; @@ -124,11 +125,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files err: ARRAY 32 OF CHAR; BEGIN (* - Console.String("Files.Create fd = "); Console.Int(f.fd,1); - Console.String(", registerName = "); Console.String(f.registerName); - Console.String(", workName = "); Console.String(f.workName); - Console.String(", state = "); Console.Int(f.state,1); - Console.Ln; + Out.String("Files.Create fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; *) IF f.fd = noDesc THEN IF f.state = create THEN @@ -164,17 +165,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files (* identity: Platform.FileIdentity; *) BEGIN (* - Console.String("Files.Flush buf.f.registername = "); Console.String(buf.f.registerName); - Console.String(", buf.f.fd = "); Console.Int(buf.f.fd,1); - Console.String(", buffer at $"); Console.Hex(SYSTEM.ADR(buf.data)); - Console.String(", size "); Console.Int(buf.size,1); Console.Ln; + Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); + Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); + Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); + Out.String(", size "); Out.Int(buf.size,1); Out.Ln; *) IF buf.chg THEN f := buf.f; Create(f); IF buf.org # f.pos THEN error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); (* - Console.String("Seeking to "); Console.Int(buf.org,1); - Console.String(", error code "); Console.Int(error,1); Console.Ln; + Out.String("Seeking to "); Out.Int(buf.org,1); + Out.String(", error code "); Out.Int(error,1); Out.Ln; *) END; error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); @@ -295,7 +296,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error: Platform.ErrorCode; identity: Platform.FileIdentity; BEGIN - (* Console.String("Files.Old "); Console.String(name); Console.Ln; *) + (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) IF name # "" THEN IF HasDir(name) THEN dir := ""; COPY(name, path) ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) @@ -307,11 +308,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files error := Platform.OldRO(path, fd); done := error = 0; END; IF ~done & ~Platform.Absent(error) THEN - Console.String("Warning: Files.Old "); Console.String(name); - Console.String(" error = "); Console.Int(error, 0); Console.Ln; + Out.String("Warning: Files.Old "); Out.String(name); + Out.String(" error = "); Out.Int(error, 0); Out.Ln; END; IF done THEN - (* Console.String(" fd = "); Console.Int(fd,1); Console.Ln; *) + (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) error := Platform.Identify(fd, identity); f := CacheEntry(identity); IF f # NIL THEN @@ -365,11 +366,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN IF f # NIL THEN (* - Console.String("Files.Set rider on fd = "); Console.Int(f.fd,1); - Console.String(", registerName = "); Console.String(f.registerName); - Console.String(", workName = "); Console.String(f.workName); - Console.String(", state = "); Console.Int(f.state,1); - Console.Ln; + Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); + Out.String(", registerName = "); Out.String(f.registerName); + Out.String(", workName = "); Out.String(f.workName); + Out.String(", state = "); Out.Int(f.state,1); + Out.Ln; *) IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; offset := pos MOD bufsize; org := pos - offset; i := 0; @@ -427,7 +428,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files restInBuf := buf.size - offset; IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + offset, SYSTEM.ADR(x) + xpos, min); + SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) END; r.res := 0; r.eof := FALSE @@ -465,7 +466,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END; restInBuf := bufsize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + xpos, SYSTEM.ADR(buf.data) + offset, min); + SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE @@ -518,8 +519,8 @@ Especially Length would become fairly complex. buf: ARRAY 4096 OF CHAR; BEGIN (* - Console.String("Files.Rename old = "); Console.String(old); - Console.String(", new = "); Console.String(new); Console.Ln; + Out.String("Files.Rename old = "); Out.String(old); + Out.String(", new = "); Out.String(new); Out.Ln; *) error := Platform.IdentifyByName(old, oldidentity); IF error = 0 THEN @@ -528,7 +529,7 @@ Especially Length would become fairly complex. Delete(new, error); (* work around stale nfs handles *) END; error := Platform.Rename(old, new); - (* Console.String("Platform.Rename error code "); Console.Int(error,1); Console.Ln; *) + (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) IF ~Platform.DifferentFilesystems(error) THEN res := error; RETURN ELSE @@ -564,18 +565,18 @@ Especially Length would become fairly complex. VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; BEGIN (* - Console.String("Files.Register f.registerName = "); Console.String(f.registerName); - Console.String(", fd = "); Console.Int(f.fd,1); Console.Ln; + Out.String("Files.Register f.registerName = "); Out.String(f.registerName); + Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; *) IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; Close(f); IF f.registerName # "" THEN Rename(f.workName, f.registerName, errcode); (* - Console.String("Renamed (for register) f.fd = "); Console.Int(f.fd,1); - Console.String(" from workname "); Console.String(f.workName); - Console.String(" to registerName "); Console.String(f.registerName); - Console.String(" errorcode = "); Console.Int(errcode,1); Console.Ln; + Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); + Out.String(" from workname "); Out.String(f.workName); + Out.String(" to registerName "); Out.String(f.registerName); + Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; *) IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE @@ -653,6 +654,17 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; + (* todo + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; + BEGIN s := 0; q := 0; Read(R, b); + WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); + ASSERT(LEN(x) <= 8); + SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) + END ReadNum; + *) + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; BEGIN s := 0; n := 0; Read(R, ch); @@ -661,18 +673,6 @@ Especially Length would become fairly complex. x := n END ReadNum; - PROCEDURE ReadNum64* (VAR R: Rider; VAR x: SYSTEM.INT64); - (* todo. use proper code when INC/ASH properly support INT64 on 32 bit platforms - VAR s: SHORTINT; ch: CHAR; n: SYSTEM.INT64; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - *) - VAR n: LONGINT; - BEGIN ReadNum(R, n); x := n - END ReadNum64; - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); BEGIN Write(R, SYSTEM.VAL(CHAR, x)) END WriteBool; @@ -714,18 +714,12 @@ Especially Length would become fairly complex. WriteBytes(R, x, i+1) END WriteString; - PROCEDURE WriteNum* (VAR R: Rider; x: LONGINT); + PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); BEGIN WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; Write(R, CHR(x MOD 128)) END WriteNum; - PROCEDURE WriteNum64* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum64; - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); BEGIN COPY (f.workName, name); @@ -736,9 +730,9 @@ Especially Length would become fairly complex. BEGIN f := SYSTEM.VAL(File, o); (* - Console.String("Files.Finalize f.fd = "); Console.Int(f.fd,1); - Console.String(", f.registername = "); Console.String(f.registerName); - Console.String(", f.workName = "); Console.String(f.workName); Console.Ln; + Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); + Out.String(", f.registername = "); Out.String(f.registerName); + Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; *) IF f.fd >= 0 THEN CloseOSFile(f); From 3dc5049d5a637f9aa83a1d23a35a602820815deb Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 17:19:26 +0100 Subject: [PATCH 065/140] Stepping toward generalised ReadNum. --- bootstrap/unix-44/Files.c | 18 ++++++++++++++++++ bootstrap/unix-44/Files.h | 1 + bootstrap/unix-44/OPM.c | 10 +++++++++- bootstrap/unix-44/OPM.h | 1 + bootstrap/unix-48/Files.c | 18 ++++++++++++++++++ bootstrap/unix-48/Files.h | 1 + bootstrap/unix-48/OPM.c | 10 +++++++++- bootstrap/unix-48/OPM.h | 1 + bootstrap/unix-88/Files.c | 18 ++++++++++++++++++ bootstrap/unix-88/Files.h | 1 + bootstrap/unix-88/OPM.c | 10 +++++++++- bootstrap/unix-88/OPM.h | 1 + bootstrap/windows-48/Files.c | 18 ++++++++++++++++++ bootstrap/windows-48/Files.h | 1 + bootstrap/windows-48/OPM.c | 10 +++++++++- bootstrap/windows-48/OPM.h | 1 + bootstrap/windows-88/Files.c | 18 ++++++++++++++++++ bootstrap/windows-88/Files.h | 1 + bootstrap/windows-88/OPM.c | 10 +++++++++- bootstrap/windows-88/OPM.h | 1 + src/compiler/OPM.Mod | 18 ++++++------------ src/runtime/Files.Mod | 10 ---------- src/system/Files.Mod | 8 ++++---- src/tools/make/oberon.mk | 2 +- 24 files changed, 156 insertions(+), 32 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index b1a7e280..81252466 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index fd146132..af64d06f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index b1a7e280..81252466 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index fd146132..af64d06f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 8e446a1c..75dee180 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index edb43852..0ba00834 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -48,6 +48,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 9ecaaba2..deeaaa1d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 39445fd2..003173fa 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 1b482bb6..12fa2cfa 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -46,6 +46,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 32bb978e..7e770a33 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8d9e0113..36fc4d53 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -89,6 +89,7 @@ export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -914,6 +915,23 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } +void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +{ + int8 s, b; + int64 q; + s = 0; + q = 0; + Files_Read(&*R, R__typ, (void*)&b); + while ((int16)b >= 128) { + q += (int64)__ASH(((int16)b - 128), s); + s += 7; + Files_Read(&*R, R__typ, (void*)&b); + } + q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + __ASSERT(x__len <= 8, 0); + __MOVE((address)&q, (address)x, x__len); +} + void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) { int8 s; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index acb178a5..35d709e7 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -48,6 +48,7 @@ import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); +import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 9ecaaba2..deeaaa1d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -82,6 +82,7 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -752,10 +753,17 @@ int32 OPM_SymRInt (void) int64 OPM_SymRInt64 (void) { int64 _o_result; - _o_result = OPM_SymRInt(); + int64 k; + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + _o_result = k; return _o_result; } +void OPM_SymRSet64 (uint64 *s) +{ + Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); +} + void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index dd3c0c27..12db4754 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -50,6 +50,7 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 3dd56c16..6db573f6 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -592,27 +592,21 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.Read(oldSF, ch) END SymRCh; + (* todo - combine RInt64 and RInt *) PROCEDURE SymRInt*(): LONGINT; VAR k: LONGINT; BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt; - (* todo PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum(oldSF, k); RETURN k - END SymRInt64; - *) - - PROCEDURE SymRInt64*(): SYSTEM.INT64; - BEGIN RETURN SymRInt() + BEGIN Files.ReadNum64(oldSF, k); RETURN k END SymRInt64; - (* todo - PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(SYSTEM.INT64, s)) - END SymRSet; - *) + (* todo - combine RSet64 and RSet *) + PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); + BEGIN Files.ReadNum64(oldSF, s) + END SymRSet64; PROCEDURE SymRSet*(VAR s: SET); BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 73d527cf..893abf1f 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -654,16 +654,6 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n - END ReadNum; - *) - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 04495ccb..94ef014a 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -654,16 +654,16 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* todo - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + (* todo combine ReadNum and ReadNum64 *) + PROCEDURE ReadNum64*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum; - *) + END ReadNum64; + PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); VAR s: SHORTINT; ch: CHAR; n: LONGINT; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index af0cbe2c..6d2a9c24 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -155,7 +155,7 @@ installable: # May require root access. install: @printf "\nInstalling into \"$(INSTALLDIR)\"\n" - @rm -rf "$(INSTALLDIR)/bin" "$(INSTALLDIR)/2 "$(INSTALLDIR)/C + @rm -rf "$(INSTALLDIR)" @mkdir -p "$(INSTALLDIR)/bin" @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" From 1fa182c7ce76103c4c37649eb35bd51f71b5b662 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 18:15:46 +0100 Subject: [PATCH 066/140] Fix generalised ReadNum and use for Sym reading. --- bootstrap/unix-44/Files.c | 26 ++++---------------------- bootstrap/unix-44/Files.h | 3 +-- bootstrap/unix-44/OPM.c | 8 ++++---- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-48/Files.c | 26 ++++---------------------- bootstrap/unix-48/Files.h | 3 +-- bootstrap/unix-48/OPM.c | 8 ++++---- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-88/Files.c | 26 ++++---------------------- bootstrap/unix-88/Files.h | 3 +-- bootstrap/unix-88/OPM.c | 8 ++++---- bootstrap/unix-88/extTools.c | 2 +- bootstrap/windows-48/Files.c | 26 ++++---------------------- bootstrap/windows-48/Files.h | 3 +-- bootstrap/windows-48/OPM.c | 8 ++++---- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-88/Files.c | 26 ++++---------------------- bootstrap/windows-88/Files.h | 3 +-- bootstrap/windows-88/OPM.c | 8 ++++---- bootstrap/windows-88/extTools.c | 2 +- src/compiler/OPM.Mod | 6 +++--- src/runtime/Files.Mod | 2 +- src/system/Files.Mod | 17 ++++------------- src/tools/make/configure.c | 2 +- 24 files changed, 59 insertions(+), 163 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 81252466..7a06dc47 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index af64d06f..69903ae1 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 81252466..7a06dc47 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index af64d06f..69903ae1 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 75dee180..a884abf3 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 0ba00834..02e44bed 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -47,8 +47,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index deeaaa1d..0c2ad2b1 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 003173fa..6163931f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 12fa2cfa..56c229a3 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -45,8 +45,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7e770a33..1457a09c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 36fc4d53..ff0e4a78 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -88,8 +88,7 @@ export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); @@ -915,15 +914,15 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { int8 s, b; int64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); - while ((int16)b >= 128) { - q += (int64)__ASH(((int16)b - 128), s); + while (b < 0) { + q += (int64)__ASH(((int16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } @@ -932,23 +931,6 @@ void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x __MOVE((address)&q, (address)x, x__len); } -void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x) -{ - int8 s; - CHAR ch; - int32 n; - s = 0; - n = 0; - Files_Read(&*R, R__typ, (void*)&ch); - while ((int16)ch >= 128) { - n += __ASH(((int16)ch - 128), s); - s += 7; - Files_Read(&*R, R__typ, (void*)&ch); - } - n += __ASH((__MASK((int16)ch, -64) - __ASHL(__ASHR((int16)ch, 6), 6)), s); - *x = n; -} - void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 35d709e7..e00e603f 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -47,8 +47,7 @@ import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadNum64 (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index deeaaa1d..0c2ad2b1 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -745,7 +745,7 @@ int32 OPM_SymRInt (void) { int32 _o_result; int32 k; - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); _o_result = k; return _o_result; } @@ -754,19 +754,19 @@ int64 OPM_SymRInt64 (void) { int64 _o_result; int64 k; - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); _o_result = k; return _o_result; } void OPM_SymRSet64 (uint64 *s) { - Files_ReadNum64(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRSet (uint32 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); } void OPM_SymRReal (REAL *r) diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fe7eb545..b082e82c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -O1", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 6db573f6..a2beb450 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -600,16 +600,16 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE SymRInt64*(): SYSTEM.INT64; VAR k: SYSTEM.INT64; - BEGIN Files.ReadNum64(oldSF, k); RETURN k + BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; (* todo - combine RSet64 and RSet *) PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum64(oldSF, s) + BEGIN Files.ReadNum(oldSF, s) END SymRSet64; PROCEDURE SymRSet*(VAR s: SET); - BEGIN Files.ReadNum(oldSF, SYSTEM.VAL(LONGINT, s)) + BEGIN Files.ReadNum(oldSF, s) END SymRSet; PROCEDURE SymRReal*(VAR r: REAL); diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 893abf1f..a8246ace 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -657,7 +657,7 @@ Especially Length would become fairly complex. PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; BEGIN s := 0; q := 0; Read(R, b); - WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) diff --git a/src/system/Files.Mod b/src/system/Files.Mod index 94ef014a..e4add256 100644 --- a/src/system/Files.Mod +++ b/src/system/Files.Mod @@ -654,23 +654,14 @@ Especially Length would become fairly complex. UNTIL b END ReadLine; - (* todo combine ReadNum and ReadNum64 *) - PROCEDURE ReadNum64*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); + PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; - BEGIN s := 0; q := 0; Read(R, b); - WHILE b >= 128 DO INC(q, ASH(b-128, s)); INC(s, 7); Read(R, b) END; + BEGIN + s := 0; q := 0; Read(R, b); + WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); ASSERT(LEN(x) <= 8); SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum64; - - - PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT); - VAR s: SHORTINT; ch: CHAR; n: LONGINT; - BEGIN s := 0; n := 0; Read(R, ch); - WHILE ORD(ch) >= 128 DO INC(n, ASH(ORD(ch) - 128, s) ); INC(s, 7); Read(R, ch) END; - INC(n, ASH(ORD(ch) MOD 64 - ORD(ch) DIV 64 * 64, s) ); - x := n END ReadNum; PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index b8d261dd..d3ccc2d1 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -126,7 +126,7 @@ void determineOS() { #endif } -#define optimize " -O1" +#define optimize "" // " -O1" void determineCCompiler() { snprintf(libspec, sizeof(libspec), " -l %s", oname); From 2e02f9204cf33846c143b49a14397d07d990a421 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 18:42:59 +0100 Subject: [PATCH 067/140] Accept all SET types in INCL. --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-44/OPM.c | 6 ------ bootstrap/unix-44/OPM.h | 1 - bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-48/OPM.c | 6 ------ bootstrap/unix-48/OPM.h | 1 - bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/unix-88/OPM.c | 6 ------ bootstrap/unix-88/OPM.h | 1 - bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-48/OPM.c | 6 ------ bootstrap/windows-48/OPM.h | 1 - bootstrap/windows-88/OPB.c | 4 ++-- bootstrap/windows-88/OPM.c | 6 ------ bootstrap/windows-88/OPM.h | 1 - src/compiler/OPB.Mod | 14 +++++++------- src/compiler/OPM.Mod | 11 +++-------- src/compiler/OPT.Mod | 6 ++---- 18 files changed, 22 insertions(+), 64 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0c2ad2b1..41d574f6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1457a09c..1ef195b4 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d099cad7..0b88b1ea 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1879,7 +1879,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) case 15: case 16: if (OPB_NotVar(x)) { OPB_err(112); - } else if (x->typ != OPT_settyp) { + } else if (x->typ->form != 7) { OPB_err(111); x->typ = OPT_settyp; } else if (x->readonly) { @@ -2044,7 +2044,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int64)OPM_MaxSet))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0c2ad2b1..41d574f6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -82,7 +82,6 @@ export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); export void OPM_SymRSet (uint32 *s); -export void OPM_SymRSet64 (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); @@ -759,11 +758,6 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet64 (uint64 *s) -{ - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); -} - void OPM_SymRSet (uint32 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 12db4754..dd3c0c27 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -50,7 +50,6 @@ import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); import void OPM_SymRSet (uint32 *s); -import void OPM_SymRSet64 (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index b29f6b49..c1a317d2 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -811,11 +811,11 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(201); x^.conval^.setval := {l..k} END ; x^.obj := NIL - ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) + ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) (* todo choose appropriate set type ? *) END ELSE err(93) END ; - x^.typ := OPT.settyp + x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); @@ -829,9 +829,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(202) END ; x^.obj := NIL - ELSE Convert(x, OPT.settyp) + ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) END ; - x^.typ := OPT.settyp + x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) @@ -1027,7 +1027,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF NotVar(x) THEN err(112) - ELSIF x^.typ # OPT.settyp THEN err(111); x^.typ := OPT.settyp + ELSIF x.typ.form # OPT.Set THEN err(111); x^.typ := OPT.settyp ELSIF x^.readonly THEN err(76) END |OPT.lenfn: (*LEN*) @@ -1124,8 +1124,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.exclfn: (*INCL, EXCL*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF f = OPT.Int THEN - IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) - END ; + IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval >= p.typ.size*8)) THEN err(202) + END; p := NewOp(OPT.Nassign, fctno, p, x) ELSE err(111) END ; diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a2beb450..a18953a7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -552,7 +552,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FPrint; - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); + PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); (*SYSTEM.SET64);*) BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) END FPrintSet; @@ -603,12 +603,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; - (* todo - combine RSet64 and RSet *) - PROCEDURE SymRSet64*(VAR s: SYSTEM.SET64); - BEGIN Files.ReadNum(oldSF, s) - END SymRSet64; - - PROCEDURE SymRSet*(VAR s: SET); + PROCEDURE SymRSet*(VAR s: SET); (*SYSTEM.SET64);*) BEGIN Files.ReadNum(oldSF, s) END SymRSet; @@ -653,7 +648,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.WriteNum(newSF, i) END SymWInt; - (* todo + (* PROCEDURE SymWSet*(s: SYSTEM.SET64); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) END SymWSet; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index e55c7d3c..a3960ac2 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,10 +15,8 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) - (* todo - setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) - *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + (*setval*: SYSTEM.SET64;*) (* constant value, procedure body present or "ELSE" present in case *) + setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; From 7238be5257d3827e1e0e504ac291158f29347291 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 19:00:33 +0100 Subject: [PATCH 068/140] Use SET64 representation in the compiler. --- bootstrap/unix-44/OPB.c | 4 ++-- bootstrap/unix-44/OPM.c | 18 +++++++++--------- bootstrap/unix-44/OPM.h | 6 +++--- bootstrap/unix-44/OPP.c | 10 +++++----- bootstrap/unix-44/OPT.c | 4 ++-- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-48/OPB.c | 4 ++-- bootstrap/unix-48/OPM.c | 18 +++++++++--------- bootstrap/unix-48/OPM.h | 6 +++--- bootstrap/unix-48/OPP.c | 10 +++++----- bootstrap/unix-48/OPT.c | 4 ++-- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-88/OPB.c | 4 ++-- bootstrap/unix-88/OPM.c | 18 +++++++++--------- bootstrap/unix-88/OPM.h | 6 +++--- bootstrap/unix-88/OPP.c | 10 +++++----- bootstrap/unix-88/OPT.c | 4 ++-- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/windows-48/OPB.c | 4 ++-- bootstrap/windows-48/OPM.c | 18 +++++++++--------- bootstrap/windows-48/OPM.h | 6 +++--- bootstrap/windows-48/OPP.c | 10 +++++----- bootstrap/windows-48/OPT.c | 4 ++-- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-88/OPB.c | 4 ++-- bootstrap/windows-88/OPM.c | 18 +++++++++--------- bootstrap/windows-88/OPM.h | 6 +++--- bootstrap/windows-88/OPP.c | 10 +++++----- bootstrap/windows-88/OPT.c | 4 ++-- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- src/compiler/OPM.Mod | 10 ++-------- src/compiler/OPT.Mod | 3 +-- src/test/confidence/planned-binary-change | 2 +- 38 files changed, 119 insertions(+), 126 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9682088a..b178bfbc 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 28), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 5bfcda58..930f9138 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 41d574f6..e894697a 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 6bfd4b38..4aa1322a 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 98ef4a7f..c3766e15 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5171284e..4657f6d3 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1ef195b4..b77fcb9c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 1eff447d..d4bdcf39 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 5bfcda58..930f9138 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -8}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -8}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 304), {0, 4, 8, 12, 284, 288, -28}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 56), {44, 48, 52, -16}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 28), {0, 4, 8, 16, 20, 24, -28}}; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 99e7aa6a..a07e28a6 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 0b88b1ea..43c9e328 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -471,7 +471,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) if (k < 0 || k > (int64)OPM_MaxSet) { OPB_err(202); } else if (y->class == 7) { - (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 32)); + (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); (*x)->obj = NIL; } else { OPB_BindNodes(12, OPT_booltyp, &*x, y); @@ -2483,7 +2483,7 @@ void OPB_StaticLink (int8 dlev) scope = OPT_topScope; while (dlev > 0) { dlev -= 1; - scope->link->conval->setval |= __SETOF(3,32); + scope->link->conval->setval |= __SETOF(3,64); scope = scope->left; } } diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 41d574f6..e894697a 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -53,7 +53,7 @@ export void OPM_DeleteNewSym (void); export void OPM_FPrint (int32 *fp, int64 val); export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint32 set); +export void OPM_FPrintSet (int32 *fp, uint64 set); static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); @@ -81,12 +81,12 @@ export int32 OPM_SymRInt (void); export int64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint32 *s); +export void OPM_SymRSet (uint64 *s); export void OPM_SymWCh (CHAR ch); export void OPM_SymWInt (int64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint32 s); +export void OPM_SymWSet (uint64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); export void OPM_WriteHex (int64 i); @@ -713,9 +713,9 @@ void OPM_FPrint (int32 *fp, int64 val) *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint32 set) +void OPM_FPrintSet (int32 *fp, uint64 set) { - OPM_FPrint(&*fp, (int32)set); + OPM_FPrint(&*fp, __VAL(int32, set)); } void OPM_FPrintReal (int32 *fp, REAL real) @@ -758,9 +758,9 @@ int64 OPM_SymRInt64 (void) return _o_result; } -void OPM_SymRSet (uint32 *s) +void OPM_SymRSet (uint64 *s) { - Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 4); + Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } void OPM_SymRReal (REAL *r) @@ -812,9 +812,9 @@ void OPM_SymWInt (int64 i) Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint32 s) +void OPM_SymWSet (uint64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index dd3c0c27..aec6ed54 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -26,7 +26,7 @@ import void OPM_DeleteNewSym (void); import void OPM_FPrint (int32 *fp, int64 val); import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint32 set); +import void OPM_FPrintSet (int32 *fp, uint64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); @@ -49,12 +49,12 @@ import int32 OPM_SymRInt (void); import int64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint32 *s); +import void OPM_SymRSet (uint64 *s); import void OPM_SymWCh (CHAR ch); import void OPM_SymWInt (int64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint32 s); +import void OPM_SymWSet (uint64 s); import void OPM_Write (CHAR ch); import void OPM_WriteHex (int64 i); import void OPM_WriteInt (int64 i); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 6bfd4b38..4aa1322a 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -967,7 +967,7 @@ static void GetCode__19 (void) } } } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); } static void GetParams__21 (void) @@ -999,7 +999,7 @@ static void Body__17 (void) OPT_Node procdec = NIL, statseq = NIL; int32 c; c = OPM_errpos; - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); OPP_Block(&procdec, &statseq); OPB_Enter(&procdec, statseq, *ProcedureDeclaration__16_s->proc); @@ -1042,7 +1042,7 @@ static void TProcDecl__23 (void) if ((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mnolev != OPP_level)) { *ProcedureDeclaration__16_s->fwd = NIL; } - if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 32))) { + if ((((*ProcedureDeclaration__16_s->fwd != NIL && (*ProcedureDeclaration__16_s->fwd)->mode == 13)) && !__IN(1, (*ProcedureDeclaration__16_s->fwd)->conval->setval, 64))) { *ProcedureDeclaration__16_s->proc = OPT_NewObj(); (*ProcedureDeclaration__16_s->proc)->leaf = 1; if ((*ProcedureDeclaration__16_s->fwd)->vis != *ProcedureDeclaration__16_s->vis) { @@ -1076,7 +1076,7 @@ static void TProcDecl__23 (void) if ((((((baseProc->vis == 1 && (*ProcedureDeclaration__16_s->proc)->vis == 0)) && recTyp->strobj != NIL)) && recTyp->strobj->vis == 1)) { OPP_err(109); } - (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,32); + (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(2,64); } if (!*ProcedureDeclaration__16_s->forward) { Body__17(); @@ -1136,7 +1136,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) if ((fwd != NIL && (fwd->mnolev != OPP_level || fwd->mode == 8))) { fwd = NIL; } - if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 32))) { + if ((((fwd != NIL && __IN(fwd->mode, 0xc0, 32))) && !__IN(1, fwd->conval->setval, 64))) { proc = OPT_NewObj(); proc->leaf = 1; if (fwd->vis != vis) { diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 98ef4a7f..c3766e15 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -20,7 +20,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -2008,7 +2008,7 @@ static void EnumPtrs(void (*P)(void*)) __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 5184, 1, P); } -__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 32), {0, -16}}; +__TDESC(OPT_ConstDesc, 1, 1) = {__TDFLDS("ConstDesc", 40), {0, -16}}; __TDESC(OPT_ObjDesc, 1, 6) = {__TDFLDS("ObjDesc", 336), {0, 8, 16, 24, 304, 312, -56}}; __TDESC(OPT_StrDesc, 1, 3) = {__TDFLDS("StrDesc", 72), {48, 56, 64, -32}}; __TDESC(OPT_NodeDesc, 1, 6) = {__TDFLDS("NodeDesc", 56), {0, 8, 16, 32, 40, 48, -56}}; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 2bc05576..624d4fe0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -17,7 +17,7 @@ typedef OPT_ConstExt ext; int64 intval; int32 intval2; - uint32 setval; + uint64 setval; LONGREAL realval; } OPT_ConstDesc; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5171284e..4657f6d3 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -72,7 +72,7 @@ static void OPV_GetTProcNum (OPT_Object obj) OPT_FindField(obj->name, typ->BaseTyp, &redef); if (redef != NIL) { obj->adr = __ASHL(__ASHR(redef->adr, 16), 16); - if (!__IN(2, obj->conval->setval, 32)) { + if (!__IN(2, obj->conval->setval, 64)) { OPM_err(119); } } else { diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index a18953a7..1af3cde7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -552,7 +552,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END FPrint; - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SET); (*SYSTEM.SET64);*) + PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SYSTEM.SET64); BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) END FPrintSet; @@ -603,7 +603,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.ReadNum(oldSF, k); RETURN k END SymRInt64; - PROCEDURE SymRSet*(VAR s: SET); (*SYSTEM.SET64);*) + PROCEDURE SymRSet*(VAR s: SYSTEM.SET64); BEGIN Files.ReadNum(oldSF, s) END SymRSet; @@ -648,15 +648,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN Files.WriteNum(newSF, i) END SymWInt; - (* PROCEDURE SymWSet*(s: SYSTEM.SET64); BEGIN Files.WriteNum(newSF, SYSTEM.VAL(SYSTEM.INT64, s)) END SymWSet; - *) - - PROCEDURE SymWSet*(s: SET); - BEGIN Files.WriteNum(newSF, SYSTEM.VAL(LONGINT, s)) - END SymWSet; PROCEDURE SymWReal*(r: REAL); BEGIN Files.WriteReal(newSF, r) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index a3960ac2..93db3e5e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -15,8 +15,7 @@ TYPE ext*: ConstExt; (* string or code for code proc *) intval*: SYSTEM.INT64; (* constant value or adr, proc par size, text position or least case label *) intval2*: LONGINT; (* string length, proc var size or larger case label *) - (*setval*: SYSTEM.SET64;*) (* constant value, procedure body present or "ELSE" present in case *) - setval*: SET; (* constant value, procedure body present or "ELSE" present in case *) + setval*: SYSTEM.SET64; (* constant value, procedure body present or "ELSE" present in case *) realval*: LONGREAL (* real or longreal constant value *) END; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 0a38b805..0e593b78 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -25 Sep 2016 15:50:01 +30 Sep 2016 18:58:19 From d344c9ce807581c6894eb5e87dc3f1ab10837fd9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 30 Sep 2016 20:30:58 +0100 Subject: [PATCH 069/140] Set size testing and constant size propagation. --- bootstrap/unix-44/OPB.c | 26 ++++++++++++++------- bootstrap/unix-44/OPC.c | 4 ++-- bootstrap/unix-48/OPB.c | 26 ++++++++++++++------- bootstrap/unix-48/OPC.c | 4 ++-- bootstrap/unix-88/OPB.c | 26 ++++++++++++++------- bootstrap/unix-88/OPC.c | 4 ++-- bootstrap/windows-48/OPB.c | 26 ++++++++++++++------- bootstrap/windows-48/OPC.c | 4 ++-- bootstrap/windows-88/OPB.c | 26 ++++++++++++++------- bootstrap/windows-88/OPC.c | 4 ++-- src/compiler/OPB.Mod | 39 ++++++++++++++++++-------------- src/compiler/OPC.Mod | 4 ++-- src/tools/browser/BrowserCmd.Mod | 4 ++-- 13 files changed, 126 insertions(+), 71 deletions(-) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 43c9e328..61ddc369 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k > (int64)OPM_MaxSet) { + if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -584,7 +584,11 @@ void OPB_MOp (int8 op, OPT_Node *x) } else if (__IN(f, 0x60, 32)) { z->conval->realval = -z->conval->realval; } else { - z->conval->setval = ~z->conval->setval; + if (z->typ->size == 8) { + z->conval->setval = ~z->conval->setval; + } else { + z->conval->setval = z->conval->setval ^ 0xffffffff; + } } z->obj = NIL; } else { @@ -959,6 +963,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(101); } @@ -983,6 +988,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval ^ yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(102); } @@ -1037,6 +1043,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = xval->setval | yval->setval; + OPB_SetSetType(x); } else if (f != 0) { OPB_err(105); } @@ -1059,6 +1066,7 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) } } else if (f == 7) { xval->setval = (xval->setval & ~yval->setval); + OPB_SetSetType(x); } else if (f != 0) { OPB_err(106); } @@ -1514,19 +1522,20 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > (int64)OPM_MaxSet) { + if (0 > k || k > 31) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > (int64)OPM_MaxSet) { + if (0 > l || l > 31) { OPB_err(202); } } if (((*x)->class == 7 && y->class == 7)) { if (k <= l) { (*x)->conval->setval = __SETRNG(k, l, 32); + OPB_SetSetType(*x); } else { OPB_err(201); (*x)->conval->setval = __SETRNG(l, k, 32); @@ -1550,8 +1559,9 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= (int64)OPM_MaxSet)) { + if ((0 <= k && k <= 31)) { (*x)->conval->setval = __SETOF(k,32); + OPB_SetSetType(*x); } else { OPB_err(202); } @@ -1581,13 +1591,13 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 2: case 3: case 7: + case 2: case 3: if (g != f) { OPB_err(113); } break; - case 4: - if (g != 4 || x->size < y->size) { + case 4: case 7: + if (g != f || x->size < y->size) { OPB_err(113); } break; diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 545deb33..5a228db9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1859,7 +1859,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) void OPC_Constant (OPT_Const con, int16 form) { int16 i; - uint32 s; + uint64 s; int32 hex; BOOLEAN skipLeading; switch (form) { @@ -1891,7 +1891,7 @@ void OPC_Constant (OPT_Const con, int16 form) do { i -= 1; hex = __ASHL(hex, 1); - if (__IN(i, s, 32)) { + if (__IN(i, s, 64)) { hex += 1; } } while (!(__MASK(i, -8) == 0)); diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index c1a317d2..17b4be1b 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -243,7 +243,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) + IF (k < 0) OR (k >= y.typ.size*8) THEN err(202) ELSIF y^.class = OPT.Nconst THEN x^.conval^.intval := BoolToInt(k IN y^.conval^.setval); x^.obj := NIL ELSE BindNodes(OPT.Ndop, OPT.booltyp, x, y); x^.subcl := OPS.in END @@ -305,8 +305,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END ELSIF f IN OPT.realSet THEN z^.conval^.realval := -z^.conval^.realval - ELSE z^.conval^.setval := -z^.conval^.setval - END ; + ELSE + IF z.typ.size = 8 THEN + z^.conval^.setval := -z^.conval^.setval + ELSE + z.conval.setval := z.conval.setval / {0..31} + END + END; z^.obj := NIL ELSE z := NewOp(op, typ, z) END @@ -503,7 +508,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(204) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval * yval^.setval + xval^.setval := xval^.setval * yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(101) END |OPS.slash: IF f = OPT.Int THEN @@ -519,7 +524,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(205) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval / yval^.setval + xval^.setval := xval^.setval / yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(102) END |OPS.div: IF f = OPT.Int THEN @@ -553,7 +558,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(206) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval + yval^.setval + xval^.setval := xval^.setval + yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(105) END |OPS.minus: IF f = OPT.Int THEN @@ -569,7 +574,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(207) END ELSIF f = OPT.Set THEN - xval^.setval := xval^.setval - yval^.setval + xval^.setval := xval^.setval - yval^.setval; SetSetType(x) ELSIF f # OPT.Undef THEN err(106) END |OPS.or: IF f = OPT.Bool THEN @@ -799,23 +804,23 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END + IF (0 > k) OR (k > MAX(SYSTEM.SET64)) THEN err(202) END END ; IF y^.class = OPT.Nconst THEN l := y^.conval^.intval; - IF (0 > l) OR (l > OPM.MaxSet) THEN err(202) END + IF (0 > l) OR (l > MAX(SYSTEM.SET64)) THEN err(202) END END ; IF (x^.class = OPT.Nconst) & (y^.class = OPT.Nconst) THEN IF k <= l THEN - x^.conval^.setval := {k..l} + x^.conval^.setval := {k..l}; SetSetType(x) ELSE err(201); x^.conval^.setval := {l..k} END ; x^.obj := NIL - ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) (* todo choose appropriate set type ? *) + ELSE BindNodes(OPT.Nupto, OPT.settyp, x, y) END ELSE err(93) END ; - x^.typ := OPT.settyp (* todo choose appropriate set type ? *) + x^.typ := OPT.settyp (* todo: syntax for specifying set type e.g. SYSTEM.SET64{n1..n2} *) END SetRange; PROCEDURE SetElem*(VAR x: OPT.Node); @@ -825,12 +830,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} + IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN x^.conval^.setval := {k}; SetSetType(x) ELSE err(202) END ; x^.obj := NIL ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) - END ; + END; x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; @@ -859,9 +864,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.String: | OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END | OPT.Bool, - OPT.Char, - OPT.Set: IF g # f THEN err(113) END - | OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END + OPT.Char: IF g # f THEN err(113) END + | OPT.Int, + OPT.Set: IF (g # f) OR (x.size < y.size) THEN err(113) END | OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END | OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index e601db3a..06252183 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1227,7 +1227,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END Len; PROCEDURE Constant* (con: OPT.Const; form: INTEGER); - VAR i: INTEGER; s: SET; + VAR i: INTEGER; s: SYSTEM.SET64; hex: LONGINT; skipLeading: BOOLEAN; BEGIN CASE form OF @@ -1239,7 +1239,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPT.LReal: OPM.WriteReal(con^.realval, 0X) | OPT.Set: OPM.WriteString("0x"); skipLeading := TRUE; - s := con^.setval; i := MAX(SET) + 1; + s := con^.setval; i := MAX(SYSTEM.SET64) + 1; REPEAT hex := 0; REPEAT diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 28573293..b017c028 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -41,7 +41,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END Wsign; PROCEDURE Objects(obj: OPT.Object; mode: SET); - VAR i: SYSTEM.INT64; m: INTEGER; s: SET; ext: OPT.ConstExt; + VAR i: SYSTEM.INT64; m: INTEGER; s: SYSTEM.SET64; ext: OPT.ConstExt; BEGIN IF obj # NIL THEN Objects(obj^.left, mode); @@ -61,7 +61,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END |OPT.Int: Wi(obj^.conval^.intval) |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; - WHILE i <= MAX(SET) DO + WHILE i <= MAX(SYSTEM.SET64) DO IF i IN s THEN Wi(i); EXCL(s, i); IF s # {} THEN Ws(", ") END END ; From c924a33a056a6385d2bacfc2aea02ad3409643ad Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 10:49:25 +0100 Subject: [PATCH 070/140] Better set constant checking. --- src/compiler/OPB.Mod | 13 +++++++------ src/compiler/OPC.Mod | 2 +- src/compiler/OPM.Mod | 2 -- src/system/SYSTEM.h | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 17b4be1b..a6b8cf67 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -830,13 +830,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; - IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN x^.conval^.setval := {k}; SetSetType(x) + IF (0 <= k) & (k <= MAX(SYSTEM.SET64)) THEN + x^.conval^.setval := {}; INCL(x.conval.setval, k); ELSE err(202) - END ; - x^.obj := NIL - ELSE Convert(x, OPT.settyp) (* todo choose appropriate set type ? *) + END; + SetSetType(x); x^.obj := NIL + ELSE + Convert(x, OPT.settyp); x^.typ := OPT.settyp END; - x^.typ := OPT.settyp (* todo choose appropriate set type ? *) END SetElem; PROCEDURE CheckAssign(x: OPT.Struct; ynode: OPT.Node); (* x := y *) @@ -994,7 +995,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPT.Bool: x := NewBoolConst(TRUE) | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp | OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) - | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp + | OPT.Set: x := NewIntConst(x.typ.size*8-1); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) ELSE err(111) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 06252183..72e13291 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1228,7 +1228,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE Constant* (con: OPT.Const; form: INTEGER); VAR i: INTEGER; s: SYSTEM.SET64; - hex: LONGINT; skipLeading: BOOLEAN; + hex: SYSTEM.INT64; skipLeading: BOOLEAN; BEGIN CASE form OF | OPT.Byte: OPM.WriteInt(con^.intval) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 1af3cde7..be89719c 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -93,7 +93,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; - MaxSet*: INTEGER; MaxIndex*: SYSTEM.INT64; MinReal*, MaxReal*, MinLReal*, MaxLReal*: LONGREAL; @@ -344,7 +343,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 END; - MaxSet := SetSize * 8 - 1; IF verbose IN Options THEN VerboseListSizes END; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index 7c55807b..4e1bfe18 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -229,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ODD(x) ((x)&1) #define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +// todo tested versions of SETOF and SETRNG: check that x, l and h fit size #define __SETOF(x, size) ((uint##size)1<<(x)) #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) From c2567a2600f3aea2ac5c9c174a90ece4005c5f2c Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 17:26:44 +0100 Subject: [PATCH 071/140] Reorganise system and runtime library modules for both O2 and OC builds. --- bootstrap/SYSTEM.h | 1 + bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 157 ----- bootstrap/unix-44/Console.h | 23 - bootstrap/unix-44/Files.c | 38 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 4 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 17 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 6 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 17 +- bootstrap/unix-44/OPM.h | 4 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 105 ++++ bootstrap/unix-44/Out.h | 21 + bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 7 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 34 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 16 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 157 ----- bootstrap/unix-48/Console.h | 23 - bootstrap/unix-48/Files.c | 38 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 4 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 17 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 6 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 17 +- bootstrap/unix-48/OPM.h | 4 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 105 ++++ bootstrap/unix-48/Out.h | 21 + bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 7 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 34 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 16 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 157 ----- bootstrap/unix-88/Console.h | 23 - bootstrap/unix-88/Files.c | 38 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 4 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 17 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 6 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 17 +- bootstrap/unix-88/OPM.h | 4 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 105 ++++ bootstrap/unix-88/Out.h | 21 + bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 7 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 34 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 16 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 157 ----- bootstrap/windows-48/Console.h | 23 - bootstrap/windows-48/Files.c | 38 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 4 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 17 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 6 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 17 +- bootstrap/windows-48/OPM.h | 4 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 105 ++++ bootstrap/windows-48/Out.h | 21 + bootstrap/windows-48/Platform.c | 10 +- bootstrap/windows-48/Platform.h | 4 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 7 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 34 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 16 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 157 ----- bootstrap/windows-88/Console.h | 23 - bootstrap/windows-88/Files.c | 38 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 4 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 17 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 6 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 17 +- bootstrap/windows-88/OPM.h | 4 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 105 ++++ bootstrap/windows-88/Out.h | 21 + bootstrap/windows-88/Platform.c | 10 +- bootstrap/windows-88/Platform.h | 4 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 7 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 34 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 16 +- bootstrap/windows-88/vt100.h | 2 +- makefile | 10 +- src/compiler/OPM.Mod | 10 +- src/compiler/extTools.Mod | 14 +- src/{system => library/v4}/Console.Mod | 0 src/runtime/Out.Mod | 2 +- src/runtime/Platformunix.Mod | 2 +- src/{system => runtime}/SYSTEM.c | 0 src/{system => runtime}/SYSTEM.h | 0 src/{system => runtime}/WindowsWrapper.h | 0 src/runtime/vt100.Mod | 342 +++++++++++ src/system/Files.Mod | 749 ----------------------- src/system/Heap.Mod | 578 ----------------- src/system/Oberon.Mod | 86 --- src/system/Platformunix.Mod | 552 ----------------- src/system/Platformwindows.Mod | 622 ------------------- src/tools/browser/BrowserCmd.Mod | 6 +- src/tools/make/oberon.mk | 31 +- 223 files changed, 1521 insertions(+), 4039 deletions(-) delete mode 100644 bootstrap/unix-44/Console.c delete mode 100644 bootstrap/unix-44/Console.h create mode 100644 bootstrap/unix-44/Out.c create mode 100644 bootstrap/unix-44/Out.h delete mode 100644 bootstrap/unix-48/Console.c delete mode 100644 bootstrap/unix-48/Console.h create mode 100644 bootstrap/unix-48/Out.c create mode 100644 bootstrap/unix-48/Out.h delete mode 100644 bootstrap/unix-88/Console.c delete mode 100644 bootstrap/unix-88/Console.h create mode 100644 bootstrap/unix-88/Out.c create mode 100644 bootstrap/unix-88/Out.h delete mode 100644 bootstrap/windows-48/Console.c delete mode 100644 bootstrap/windows-48/Console.h create mode 100644 bootstrap/windows-48/Out.c create mode 100644 bootstrap/windows-48/Out.h delete mode 100644 bootstrap/windows-88/Console.c delete mode 100644 bootstrap/windows-88/Console.h create mode 100644 bootstrap/windows-88/Out.c create mode 100644 bootstrap/windows-88/Out.h rename src/{system => library/v4}/Console.Mod (100%) rename src/{system => runtime}/SYSTEM.c (100%) rename src/{system => runtime}/SYSTEM.h (100%) rename src/{system => runtime}/WindowsWrapper.h (100%) create mode 100644 src/runtime/vt100.Mod delete mode 100644 src/system/Files.Mod delete mode 100644 src/system/Heap.Mod delete mode 100644 src/system/Oberon.Mod delete mode 100644 src/system/Platformunix.Mod delete mode 100644 src/system/Platformwindows.Mod diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 7c55807b..4e1bfe18 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -229,6 +229,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ODD(x) ((x)&1) #define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +// todo tested versions of SETOF and SETRNG: check that x, l and h fit size #define __SETOF(x, size) ((uint##size)1<<(x)) #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-44/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-44/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 7a06dc47..25192376 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 69903ae1..1a38cc40 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b178bfbc..66d53030 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-44/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-44/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index defb84f0..addd94c0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 01e08432..18008f62 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index a8af28c1..ac457f52 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 2d6de22a..80ab5a77 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-48/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-48/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 7a06dc47..25192376 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 69903ae1..1a38cc40 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 930f9138..a23ac389 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-48/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-48/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index defb84f0..addd94c0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 01e08432..18008f62 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 09661382..8fd544dc 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 86f8f5b7..3d119274 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c deleted file mode 100644 index 206f8024..00000000 --- a/bootstrap/unix-88/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(1, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(0, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/unix-88/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a884abf3..010c9d80 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 02e44bed..87c48fa5 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 571a7dd2..6ab9f1ca 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2187094a..b183ffa4 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e18d29cf..dab15898 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e894697a..732baf46 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 4aa1322a..bf1c6c9b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index c3766e15..186ab7e3 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4657f6d3..f566e592 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c new file mode 100644 index 00000000..a99d3410 --- /dev/null +++ b/bootstrap/unix-88/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(1, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(1, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/unix-88/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d9d1fb1..b648dbcc 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c308ce3a..c74c7031 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9a4efb22..369dceed 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 7f02a3aa..8c6bf3f2 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c deleted file mode 100644 index d6ad8ef3..00000000 --- a/bootstrap/windows-48/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/windows-48/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6163931f..4e669b75 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 56c229a3..3d4b568e 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index b3eea6a3..9c9c2846 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a7135c5b..d4afd6fe 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2984f32f..9cfee5c9 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index b77fcb9c..1ab50cf6 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index d4bdcf39..3a1bf6f6 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 930f9138..a23ac389 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index a07e28a6..ba7bab5f 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c new file mode 100644 index 00000000..60051d13 --- /dev/null +++ b/bootstrap/windows-48/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(Platform_StdOut, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(Platform_StdOut, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/windows-48/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 38a8dd6e..f3eea094 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -43,7 +43,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -851,8 +851,8 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); - Platform_nl[0] = 0x0d; - Platform_nl[1] = 0x0a; - Platform_nl[2] = 0x00; + Platform_NL[0] = 0x0d; + Platform_NL[1] = 0x0a; + Platform_NL[2] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0d3476b4..a07ae09d 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import int16 Platform_ArgCount; import int32 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 09661382..8fd544dc 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 86f8f5b7..3d119274 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 637fd329..a3cc57ea 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index a3240e8e..32d0b51f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4d4279da..db2b8c32 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c deleted file mode 100644 index d6ad8ef3..00000000 --- a/bootstrap/windows-88/Console.c +++ /dev/null @@ -1,157 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 - -#include "SYSTEM.h" -#include "Platform.h" - - -static CHAR Console_line[128]; -static int16 Console_pos; - - -export void Console_Bool (BOOLEAN b); -export void Console_Char (CHAR ch); -export void Console_Flush (void); -export void Console_Hex (int32 i); -export void Console_Int (int64 i, int64 n); -export void Console_Ln (void); -export void Console_Read (CHAR *ch); -export void Console_ReadLine (CHAR *line, LONGINT line__len); -export void Console_String (CHAR *s, LONGINT s__len); - - -void Console_Flush (void) -{ - int16 error; - error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); - Console_pos = 0; -} - -void Console_Char (CHAR ch) -{ - if (Console_pos == 128) { - Console_Flush(); - } - Console_line[__X(Console_pos, 128)] = ch; - Console_pos += 1; - if (ch == 0x0a) { - Console_Flush(); - } -} - -void Console_String (CHAR *s, LONGINT s__len) -{ - int16 i; - __DUP(s, s__len, CHAR); - i = 0; - while (s[__X(i, s__len)] != 0x00) { - Console_Char(s[__X(i, s__len)]); - i += 1; - } - __DEL(s); -} - -void Console_Int (int64 i, int64 n) -{ - CHAR s[32]; - int32 i1, k; - if (i == (int64)__LSHL(1, 31, 32)) { - __MOVE("8463847412", s, 11); - k = 10; - } else { - i1 = __ABS(__VAL(int32, i)); - s[0] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k = 1; - while (i1 > 0) { - s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48); - i1 = __DIV(i1, 10); - k += 1; - } - } - if (i < 0) { - s[__X(k, 32)] = '-'; - k += 1; - } - while (n > (int64)k) { - Console_Char(' '); - n -= 1; - } - while (k > 0) { - k -= 1; - Console_Char(s[__X(k, 32)]); - } -} - -void Console_Ln (void) -{ - Console_Char(0x0a); -} - -void Console_Bool (BOOLEAN b) -{ - if (b) { - Console_String((CHAR*)"TRUE", 5); - } else { - Console_String((CHAR*)"FALSE", 6); - } -} - -void Console_Hex (int32 i) -{ - int16 k; - int64 n; - k = -28; - while (k <= 0) { - n = __MASK(__ASH(i, k), -16); - if (n <= 9) { - Console_Char((CHAR)(48 + n)); - } else { - Console_Char((CHAR)(55 + n)); - } - k += 4; - } -} - -void Console_Read (CHAR *ch) -{ - int32 n; - int16 error; - Console_Flush(); - error = Platform_ReadBuf(Platform_StdIn, (void*)&*ch, 1, &n); - if (n != 1) { - *ch = 0x00; - } -} - -void Console_ReadLine (CHAR *line, LONGINT line__len) -{ - int32 i; - CHAR ch; - Console_Flush(); - i = 0; - Console_Read(&ch); - while ((((i < line__len - 1 && ch != 0x0a)) && ch != 0x00)) { - line[__X(i, line__len)] = ch; - i += 1; - Console_Read(&ch); - } - line[__X(i, line__len)] = 0x00; -} - - -export void *Console__init(void) -{ - __DEFMOD; - __MODULE_IMPORT(Platform); - __REGMOD("Console", 0); - __REGCMD("Flush", Console_Flush); - __REGCMD("Ln", Console_Ln); -/* BEGIN */ - Console_pos = 0; - __ENDMOD; -} diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h deleted file mode 100644 index 6549e2cc..00000000 --- a/bootstrap/windows-88/Console.h +++ /dev/null @@ -1,23 +0,0 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef Console__h -#define Console__h - -#include "SYSTEM.h" - - - - -import void Console_Bool (BOOLEAN b); -import void Console_Char (CHAR ch); -import void Console_Flush (void); -import void Console_Hex (int32 i); -import void Console_Int (int64 i, int64 n); -import void Console_Ln (void); -import void Console_Read (CHAR *ch); -import void Console_ReadLine (CHAR *line, LONGINT line__len); -import void Console_String (CHAR *s, LONGINT s__len); -import void *Console__init(void); - - -#endif // Console diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index ff0e4a78..7dda2f04 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,7 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" -#include "Console.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -114,26 +114,26 @@ export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) { __DUP(s, s__len, CHAR); - Console_Ln(); - Console_String((CHAR*)"-- ", 4); - Console_String(s, s__len); - Console_String((CHAR*)": ", 3); + Out_Ln(); + Out_String((CHAR*)"-- ", 4); + Out_String(s, s__len); + Out_String((CHAR*)": ", 3); if (f != NIL) { if (f->registerName[0] != 0x00) { - Console_String(f->registerName, 101); + Out_String(f->registerName, 101); } else { - Console_String(f->workName, 101); + Out_String(f->workName, 101); } if (f->fd != 0) { - Console_String((CHAR*)"f.fd = ", 8); - Console_Int(f->fd, 1); + Out_String((CHAR*)"f.fd = ", 8); + Out_Int(f->fd, 1); } } if (errcode != 0) { - Console_String((CHAR*)" errcode = ", 12); - Console_Int(errcode, 1); + Out_String((CHAR*)" errcode = ", 12); + Out_Int(errcode, 1); } - Console_Ln(); + Out_Ln(); __HALT(99); __DEL(s); } @@ -460,11 +460,11 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) done = error == 0; } if ((!done && !Platform_Absent(error))) { - Console_String((CHAR*)"Warning: Files.Old ", 20); - Console_String(name, name__len); - Console_String((CHAR*)" error = ", 10); - Console_Int(error, 0); - Console_Ln(); + Out_String((CHAR*)"Warning: Files.Old ", 20); + Out_String(name, name__len); + Out_String((CHAR*)" error = ", 10); + Out_Int(error, 0); + Out_Ln(); } if (done) { error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); @@ -1043,7 +1043,7 @@ export void *Files__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("Files", EnumPtrs); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index e00e603f..82031060 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 571a7dd2..6ab9f1ca 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2187094a..b183ffa4 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e18d29cf..dab15898 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,6 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" #include "Heap.h" typedef @@ -167,7 +166,6 @@ __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; export void *Modules__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); __MODULE_IMPORT(Heap); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 9b84521f..4e105135 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 61ddc369..ef3ea081 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1522,13 +1522,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (0 > k || k > 31) { + if (0 > k || k > 63) { OPB_err(202); } } if (y->class == 7) { l = y->conval->intval; - if (0 > l || l > 31) { + if (0 > l || l > 63) { OPB_err(202); } } @@ -1559,17 +1559,18 @@ void OPB_SetElem (OPT_Node *x) OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; - if ((0 <= k && k <= 31)) { - (*x)->conval->setval = __SETOF(k,32); - OPB_SetSetType(*x); + if ((0 <= k && k <= 63)) { + (*x)->conval->setval = 0x0; + (*x)->conval->setval |= __SETOF(k,64); } else { OPB_err(202); } + OPB_SetSetType(*x); (*x)->obj = NIL; } else { OPB_Convert(&*x, OPT_settyp); + (*x)->typ = OPT_settyp; } - (*x)->typ = OPT_settyp; } static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) @@ -1816,7 +1817,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno) x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 7: - x = OPB_NewIntConst(OPM_MaxSet); + x = OPB_NewIntConst(__ASHL(x->typ->size, 3) - 1); x->typ = OPT_inttyp; break; case 5: diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 07dda5db..54e81677 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5a228db9..6739a87e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1860,7 +1860,7 @@ void OPC_Constant (OPT_Const con, int16 form) { int16 i; uint64 s; - int32 hex; + int64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1885,7 +1885,7 @@ void OPC_Constant (OPT_Const con, int16 form) OPM_WriteString((CHAR*)"0x", 3); skipLeading = 1; s = con->setval; - i = 32; + i = 64; do { hex = 0; do { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c9cf0ace..32ec3b7f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e894697a..732baf46 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "Files.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" #include "Texts.h" @@ -27,7 +27,7 @@ export int16 OPM_AddressSize; static int16 OPM_GlobalAlignment; export int16 OPM_Alignment; export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; export int64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -102,24 +102,24 @@ export void OPM_err (int16 n); void OPM_LogW (CHAR ch) { - Console_Char(ch); + Out_Char(ch); } void OPM_LogWStr (CHAR *s, LONGINT s__len) { __DUP(s, s__len, CHAR); - Console_String(s, s__len); + Out_String(s, s__len); __DEL(s); } void OPM_LogWNum (int64 i, int64 len) { - Console_Int(i, len); + Out_Int(i, len); } void OPM_LogWLn (void) { - Console_Ln(); + Out_Ln(); } int64 OPM_SignedMaximum (int32 bytecount) @@ -455,7 +455,6 @@ void OPM_InitOptions (void) OPM_SetSize = 4; break; } - OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; if (__IN(18, OPM_Options, 32)) { OPM_VerboseListSizes(); } @@ -1075,8 +1074,8 @@ export void *OPM__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(Files); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index aec6ed54..960bd0ba 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import int16 OPM_AddressSize, OPM_Alignment; import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize, OPM_MaxSet; +import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; import int64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 4aa1322a..bf1c6c9b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c759545a..8b28d78e 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 18c3c066..882c9331 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 260fcd01..62dc025a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index c3766e15..186ab7e3 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 624d4fe0..6f17b409 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4657f6d3..f566e592 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index f5e41d45..30c2c7e7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c new file mode 100644 index 00000000..60051d13 --- /dev/null +++ b/bootstrap/windows-88/Out.c @@ -0,0 +1,105 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#define SHORTINT int8 +#define INTEGER int16 +#define LONGINT int32 +#define SET uint32 + +#include "SYSTEM.h" +#include "Platform.h" + + + + +export void Out_Char (CHAR ch); +export void Out_Int (int64 x, int64 n); +export void Out_Ln (void); +export void Out_LongReal (LONGREAL x, int16 n); +export void Out_Open (void); +export void Out_Real (REAL x, int16 n); +export void Out_String (CHAR *str, LONGINT str__len); + + +void Out_Open (void) +{ +} + +void Out_Char (CHAR ch) +{ + int16 error; + error = Platform_Write(Platform_StdOut, (address)&ch, 1); +} + +void Out_String (CHAR *str, LONGINT str__len) +{ + int32 l; + int16 error; + __DUP(str, str__len, CHAR); + l = 0; + while ((l < str__len && str[l] != 0x00)) { + l += 1; + } + error = Platform_Write(Platform_StdOut, (address)str, l); + __DEL(str); +} + +void Out_Int (int64 x, int64 n) +{ + CHAR s[22]; + int16 i; + BOOLEAN negative; + negative = x < 0; + if (x == (-9223372036854775807-1)) { + __MOVE("8085774586302733229", s, 20); + i = 19; + } else { + if (x < 0) { + x = -x; + } + s[0] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i = 1; + while (x != 0) { + s[i] = (CHAR)(48 + __MOD(x, 10)); + x = __DIV(x, 10); + i += 1; + } + } + if (negative) { + s[i] = '-'; + i += 1; + } + while (n > (int64)i) { + Out_Char(' '); + n -= 1; + } + while (i > 0) { + i -= 1; + Out_Char(s[i]); + } +} + +void Out_Real (REAL x, int16 n) +{ +} + +void Out_LongReal (LONGREAL x, int16 n) +{ +} + +void Out_Ln (void) +{ + Out_String(Platform_NL, 3); +} + + +export void *Out__init(void) +{ + __DEFMOD; + __MODULE_IMPORT(Platform); + __REGMOD("Out", 0); + __REGCMD("Ln", Out_Ln); + __REGCMD("Open", Out_Open); +/* BEGIN */ + __ENDMOD; +} diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h new file mode 100644 index 00000000..6717f71b --- /dev/null +++ b/bootstrap/windows-88/Out.h @@ -0,0 +1,21 @@ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ + +#ifndef Out__h +#define Out__h + +#include "SYSTEM.h" + + + + +import void Out_Char (CHAR ch); +import void Out_Int (int64 x, int64 n); +import void Out_Ln (void); +import void Out_LongReal (LONGREAL x, int16 n); +import void Out_Open (void); +import void Out_Real (REAL x, int16 n); +import void Out_String (CHAR *str, LONGINT str__len); +import void *Out__init(void); + + +#endif // Out diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 5a5ee14a..efcb7845 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -43,7 +43,7 @@ static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; -export CHAR Platform_nl[3]; +export CHAR Platform_NL[3]; export address *Platform_FileIdentity__typ; @@ -851,8 +851,8 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); - Platform_nl[0] = 0x0d; - Platform_nl[1] = 0x0a; - Platform_nl[2] = 0x00; + Platform_NL[0] = 0x0d; + Platform_NL[1] = 0x0a; + Platform_NL[2] = 0x00; __ENDMOD; } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index b8d8c5e7..2e13990f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -27,7 +27,7 @@ import int16 Platform_ArgCount; import int64 Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; -import CHAR Platform_nl[3]; +import CHAR Platform_NL[3]; import address *Platform_FileIdentity__typ; diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d7d2994c..f173fc32 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 8c1ff819..98443ee2 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index ac03bada..accc2e6a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index cc9d99a1..9ebac10a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9a4efb22..369dceed 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1473,7 +1473,7 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Piece p = NIL; Texts_Elem e = NIL; int32 org, pos, hlen, plen; - int8 ecnt, fno, fcnt, col, voff; + int8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1653,8 +1653,9 @@ void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; int32 org, pos, delta, hlen, rlen; - int8 ecnt, fno, fcnt; + int8 ecnt, fcnt; CHAR ch; + int8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 7f02a3aa..8c6bf3f2 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index f284397b..b071c3a8 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 5aa2a5f6..1560dc0d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b082e82c..f6b467bb 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,8 +7,8 @@ #include "SYSTEM.h" #include "Configuration.h" -#include "Console.h" #include "OPM.h" +#include "Out.h" #include "Platform.h" #include "Strings.h" @@ -28,9 +28,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); } r = Platform_System(cmd, cmd__len); status = __MASK(r, -128); @@ -39,18 +39,18 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN exitcode = exitcode - 256; } if (r != 0) { - Console_String(title, title__len); - Console_String(cmd, cmd__len); - Console_Ln(); - Console_String((CHAR*)"-- failed: status ", 19); - Console_Int(status, 1); - Console_String((CHAR*)", exitcode ", 12); - Console_Int(exitcode, 1); - Console_String((CHAR*)".", 2); - Console_Ln(); + Out_String(title, title__len); + Out_String(cmd, cmd__len); + Out_Ln(); + Out_String((CHAR*)"-- failed: status ", 19); + Out_Int(status, 1); + Out_String((CHAR*)", exitcode ", 12); + Out_Int(exitcode, 1); + Out_String((CHAR*)".", 2); + Out_Ln(); if ((status == 0 && exitcode == 127)) { - Console_String((CHAR*)"Is the C compiler in the current command path\?", 47); - Console_Ln(); + Out_String((CHAR*)"Is the C compiler in the current command path\?", 47); + Out_Ln(); } if (status != 0) { Platform_Halt(status); @@ -112,8 +112,8 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); - __MODULE_IMPORT(Console); __MODULE_IMPORT(OPM); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __REGMOD("extTools", 0); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 8cdd8e01..ab7785db 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a4bc9ec1..23b25f53 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -6,7 +6,7 @@ #define SET uint32 #include "SYSTEM.h" -#include "Console.h" +#include "Out.h" #include "Strings.h" @@ -90,7 +90,7 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DUP(letter, letter__len, CHAR); __COPY(vt100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); - Console_String(cmd, 9); + Out_String(cmd, 9); __DEL(letter); } @@ -103,7 +103,7 @@ static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -116,7 +116,7 @@ static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __COPY(vt100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); - Console_String(cmd, 7); + Out_String(cmd, 7); __DEL(letter); } @@ -132,7 +132,7 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); Strings_Append(letter, letter__len, (void*)cmd, 12); - Console_String(cmd, 12); + Out_String(cmd, 12); __DEL(letter); } @@ -242,7 +242,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) __DUP(attr, attr__len, CHAR); __COPY(vt100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); - Console_String(tmpstr, 16); + Out_String(tmpstr, 16); __DEL(attr); } @@ -250,7 +250,7 @@ void vt100_SetAttr (CHAR *attr, LONGINT attr__len) export void *vt100__init(void) { __DEFMOD; - __MODULE_IMPORT(Console); + __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); __REGMOD("vt100", 0); __REGCMD("DECTCEMh", vt100_DECTCEMh); diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 44d81f73..95c8d77e 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/30]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/makefile b/makefile index fc481183..82c50d44 100644 --- a/makefile +++ b/makefile @@ -102,7 +102,7 @@ usage: FORCE: configuration: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o @rm a.o @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make @@ -110,7 +110,7 @@ configuration: FORCE bootstrapconfiguration: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o bootstrap @rm a.o @echo BRANCH=$$(git rev-parse --abbrev-ref HEAD)>>Configuration.Make @@ -120,7 +120,7 @@ bootstrapconfiguration: FORCE reportsizes: FORCE - @$(CC) -I src/system -o a.o src/tools/make/configure.c + @$(CC) -I src/runtime -o a.o src/tools/make/configure.c @./a.o report @rm a.o @@ -263,7 +263,7 @@ bootstrap: bootstrapconfiguration make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym - cp src/system/*.[ch] bootstrap + cp src/runtime/*.[ch] bootstrap bootstrapunclean: bootstrapconfiguration @@ -273,7 +273,7 @@ bootstrapunclean: bootstrapconfiguration make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=unix BUILDDIR=bootstrap/unix-88 && rm bootstrap/unix-88/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=2 ADRSIZE=4 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-48 && rm bootstrap/windows-48/*.sym make -f src/tools/make/oberon.mk -s translate MODEL=2 INTSIZE=4 ADRSIZE=8 ALIGNMENT=8 PLATFORM=windows BUILDDIR=bootstrap/windows-88 && rm bootstrap/windows-88/*.sym - cp src/system/*.[ch] bootstrap + cp src/runtime/*.[ch] bootstrap diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index be89719c..703ff236 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Console, errors, Configuration, vt100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, vt100, Strings; CONST OptionChar* = "-"; @@ -124,10 +124,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) (* ------------------------- Log Output ------------------------- *) - PROCEDURE LogW*(ch: CHAR); BEGIN Console.Char(ch) END LogW; - PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Console.String(s) END LogWStr; - PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Console.Int(i, len) END LogWNum; - PROCEDURE LogWLn*; BEGIN Console.Ln END LogWLn; + PROCEDURE LogW*(ch: CHAR); BEGIN Out.Char(ch) END LogW; + PROCEDURE LogWStr*(s: ARRAY OF CHAR); BEGIN Out.String(s) END LogWStr; + PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; + PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 077fb5a5..c241eaac 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,6 +1,6 @@ MODULE extTools; -IMPORT Strings, Console, Configuration, Platform, OPM; +IMPORT Strings, Out, Configuration, Platform, OPM; VAR CFLAGS: ARRAY 1023 OF CHAR; @@ -9,7 +9,7 @@ PROCEDURE execute(title: ARRAY OF CHAR; cmd: ARRAY OF CHAR); VAR r, status, exitcode: INTEGER; BEGIN IF OPM.verbose IN OPM.Options THEN - Console.String(title); Console.String(cmd); Console.Ln + Out.String(title); Out.String(cmd); Out.Ln END; r := Platform.System(cmd); status := r MOD 128; @@ -17,12 +17,12 @@ BEGIN IF exitcode > 127 THEN exitcode := exitcode - 256 END; (* Handle signed exit code *) IF r # 0 THEN - Console.String(title); Console.String(cmd); Console.Ln; - Console.String("-- failed: status "); Console.Int(status,1); - Console.String(", exitcode "); Console.Int(exitcode,1); - Console.String("."); Console.Ln; + Out.String(title); Out.String(cmd); Out.Ln; + Out.String("-- failed: status "); Out.Int(status,1); + Out.String(", exitcode "); Out.Int(exitcode,1); + Out.String("."); Out.Ln; IF (status = 0) & (exitcode = 127) THEN - Console.String("Is the C compiler in the current command path?"); Console.Ln + Out.String("Is the C compiler in the current command path?"); Out.Ln END; IF status # 0 THEN Platform.Halt(status) ELSE Platform.Halt(exitcode) END END; diff --git a/src/system/Console.Mod b/src/library/v4/Console.Mod similarity index 100% rename from src/system/Console.Mod rename to src/library/v4/Console.Mod diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 245c67a8..66db1944 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -19,7 +19,7 @@ BEGIN error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) END String; -PROCEDURE Int*(x: HUGEINT; n: LONGINT); +PROCEDURE Int*(x, n: HUGEINT); CONST zero = ORD('0'); VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; BEGIN diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3db3f2d7..034906bd 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; diff --git a/src/system/SYSTEM.c b/src/runtime/SYSTEM.c similarity index 100% rename from src/system/SYSTEM.c rename to src/runtime/SYSTEM.c diff --git a/src/system/SYSTEM.h b/src/runtime/SYSTEM.h similarity index 100% rename from src/system/SYSTEM.h rename to src/runtime/SYSTEM.h diff --git a/src/system/WindowsWrapper.h b/src/runtime/WindowsWrapper.h similarity index 100% rename from src/system/WindowsWrapper.h rename to src/runtime/WindowsWrapper.h diff --git a/src/runtime/vt100.Mod b/src/runtime/vt100.Mod new file mode 100644 index 00000000..f21df4a6 --- /dev/null +++ b/src/runtime/vt100.Mod @@ -0,0 +1,342 @@ +MODULE vt100; + +IMPORT Out, Strings; + (* reference http://en.wikipedia.org/wiki/ANSI_escape_code + & http://misc.flogisoft.com/bash/tip_colors_and_formatting + *) +CONST + + Escape* = 1BX; + SynchronousIdle* = 16X; + LeftCrotchet* = '['; + + (* formatting *) + Bold* = "1m"; + Dim* = "2m"; + Underlined* = "4m"; + Blink* = "5m"; (* does not work with most emulators, works in tty and xterm *) + Reverse* = "7m"; (* invert the foreground and background colors *) + Hidden* = "8m"; (* useful for passwords *) + + (* reset *) + ResetAll* = "0m"; + ResetBold* = "21m"; + ResetDim* = "22m"; + ResetUnderlined* = "24m"; + ResetBlink* = "25m"; + ResetReverse* = "27m"; + ResetHidden* = "28m"; + + (* foreground colors *) + Black* = "30m"; + Red* = "31m"; + Green* = "32m"; + Yellow* = "33m"; + Blue* = "34m"; + Magenta* = "35m"; + Cyan* = "36m"; + LightGray* = "37m"; + Default* = "39m"; + DarkGray* = "90m"; + LightRed* = "91m"; + LightGreen* = "92m"; + LightYellow* = "93m"; + LightBlue* = "94m"; + LightMagenta* = "95m"; + LightCyan* = "96m"; + White* = "97m"; + + (* background colors *) + BBlack* = "40m"; + BRed* = "41m"; + BGreen* = "42m"; + BYellow* = "43m"; + BBlue* = "44m"; + BMagenta* = "45m"; + BCyan* = "46m"; + BLightGray* = "47m"; + BDefault* = "49m"; + BDarkGray* = "100m"; + BLightRed* = "101m"; + BLightGreen* = "102m"; + BLightYellow* = "103m"; + BLightBlue* = "104m"; + BLightMagenta*= "105m"; + BLightCyan* = "106m"; + BWhite* = "107m"; + + VAR + CSI* : ARRAY 5 OF CHAR; + tmpstr : ARRAY 32 OF CHAR; + + (* IntToStr routine taken from + https://github.com/romiras/Oberon-F-components/blob/master/Ott/Mod/IntStr.cp + and modified to work on 64bit system, + in order to avoid using oocIntStr, which has many dependencies *) + PROCEDURE Reverse0 (VAR str : ARRAY OF CHAR; start, end : INTEGER); + (* Reverses order of characters in the interval [start..end]. *) + VAR + h : CHAR; + BEGIN + WHILE start < end DO + h := str[start]; str[start] := str[end]; str[end] := h; + INC(start); DEC(end) + END + END Reverse0; + + PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); + (* Converts the value of `int' to string form and copies the possibly truncated + result to `str'. *) + VAR + b : ARRAY 21 OF CHAR; + s, e: INTEGER; + maxLength : SHORTINT; (* maximum number of digits representing a LONGINT value *) + BEGIN + IF SIZE(LONGINT) = 4 THEN maxLength := 11 END; + IF SIZE(LONGINT) = 8 THEN maxLength := 20 END; + (* build representation in string 'b' *) + IF int = MIN(LONGINT) THEN (* smallest LONGINT, -int is an overflow *) + IF SIZE(LONGINT) = 4 THEN + b := "-2147483648"; + e := 11 + ELSE (* SIZE(LONGINT) = 8 *) + b := "-9223372036854775808"; + e := 20 + END + ELSE + IF int < 0 THEN (* negative sign *) + b[0] := "-"; int := -int; s := 1 + ELSE (* no sign *) + s := 0 + END; + e := s; (* 's' holds starting position of string *) + REPEAT + b[e] := CHR(int MOD 10+ORD("0")); + int := int DIV 10; + INC(e) + UNTIL int = 0; + b[e] := 0X; + Reverse0(b, s, e-1); + END; + COPY(b, str) (* truncate output if necessary *) + END IntToStr; + + PROCEDURE EscSeq0 (letter : ARRAY OF CHAR); + VAR + cmd : ARRAY 9 OF CHAR; + BEGIN + COPY(CSI, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + END EscSeq0; + + PROCEDURE EscSeq (n : INTEGER; letter : ARRAY OF CHAR); + VAR nstr : ARRAY 2 OF CHAR; + cmd : ARRAY 7 OF CHAR; + BEGIN + IntToStr (n, nstr); + COPY(CSI, cmd); + Strings.Append (nstr, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + END EscSeq; + + PROCEDURE EscSeqSwapped (n : INTEGER; letter : ARRAY OF CHAR); + VAR nstr : ARRAY 2 OF CHAR; + cmd : ARRAY 7 OF CHAR; + BEGIN + IntToStr (n, nstr); + COPY(CSI, cmd); + Strings.Append (letter, cmd); + Strings.Append (nstr, cmd); + Out.String (cmd); + END EscSeqSwapped; + + PROCEDURE EscSeq2(n, m : INTEGER; letter : ARRAY OF CHAR); + VAR nstr, mstr : ARRAY 5 OF CHAR; + cmd : ARRAY 12 OF CHAR; + BEGIN + IntToStr(n, nstr); + IntToStr(m, mstr); + + COPY (CSI, cmd); + Strings.Append (nstr, cmd); + Strings.Append (';', cmd); + Strings.Append (mstr, cmd); + Strings.Append (letter, cmd); + Out.String (cmd); + + END EscSeq2; + + + +(* Cursor up + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUU*(n : INTEGER); + BEGIN + EscSeq (n, 'A'); + END CUU; + +(* Cursor down + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUD*(n : INTEGER); + BEGIN + EscSeq (n, 'B'); + END CUD; + + +(* Cursor forward + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUF*(n : INTEGER); + BEGIN + EscSeq (n, 'C'); + END CUF; + +(* Cursor back + moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) + + PROCEDURE CUB*(n : INTEGER); + BEGIN + EscSeq (n, 'D'); + END CUB; + +(* Curnser Next Line + moves cursor to beginning of the line n lines down *) + + PROCEDURE CNL*( n: INTEGER); + BEGIN + EscSeq (n, 'E'); + END CNL; + + +(* Cursor Previous Line + Moves cursor to beginning of the line n lines down *) + + PROCEDURE CPL*( n : INTEGER); + BEGIN + EscSeq (n, 'F'); + END CPL; + +(* Cursor Horizontal Absolute + Moves the cursor to column n *) + + PROCEDURE CHA*( n : INTEGER); + BEGIN + EscSeq (n, 'G'); + END CHA; + + (* Cursor position, moves cursor to row n, column m *) + PROCEDURE CUP*(n, m : INTEGER); + BEGIN + EscSeq2 (n, m, 'H'); + END CUP; + + (* Erase Display + if n = 0 then clears from cursor to end of the screen + if n = 1 then clears from cursor to beginning of the screen + if n = 2 then clears entire screen *) + + PROCEDURE ED* (n : INTEGER); + BEGIN + EscSeq(n, 'J'); + END ED; + + (* Erase in Line + Erases part of the line. If n is zero, clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change *) + PROCEDURE EL*( n : INTEGER); + BEGIN + EscSeq(n, 'K'); + END EL; + +(* Scroll Up + Scroll whole page up by n lines. New lines are added at the bottom *) + PROCEDURE SU*( n : INTEGER); + BEGIN + EscSeq(n, 'S') + END SU; + +(* Scroll Down + Scroll whole page down by n (default 1) lines. New lines are added at the top *) + PROCEDURE SD*( n : INTEGER); + BEGIN + EscSeq(n, 'T'); + END SD; + +(* Horizontal and Vertical Position, + Moves the cursor to row n, column m. Both default to 1 if omitted. Same as CUP *) + PROCEDURE HVP*(n, m : INTEGER); + BEGIN + EscSeq2 (n, m, 'f'); + END HVP; + +(* Select Graphic Rendition + Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences *) + + PROCEDURE SGR*( n : INTEGER); + BEGIN + EscSeq(n, 'm'); + END SGR; + + PROCEDURE SGR2*( n, m : INTEGER); + BEGIN + EscSeq2(n, m, 'm'); + END SGR2; + +(* Device Status Report + Reports the cursor position (CPR) to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column.) *) + + PROCEDURE DSR*(n : INTEGER); + BEGIN + EscSeq(6, 'n'); + END DSR; + +(* Save Cursor Position *) + + PROCEDURE SCP*; + BEGIN + EscSeq0('s'); + END SCP; + +(* Restore Cursor Position *) + + PROCEDURE RCP*; + BEGIN + EscSeq0('u'); + END RCP; + +(* Hide the cursor *) + PROCEDURE DECTCEMl*; + BEGIN + EscSeq0("?25l") + END DECTCEMl; + +(* shows the cursor *) + PROCEDURE DECTCEMh*; + BEGIN + EscSeq0("?25h") + END DECTCEMh; + + PROCEDURE SetAttr*(attr : ARRAY OF CHAR); + VAR tmpstr : ARRAY 16 OF CHAR; + BEGIN + COPY(CSI, tmpstr); + Strings.Append(attr, tmpstr); + Out.String(tmpstr); + END SetAttr; + + BEGIN + (* init CSI sequence *) + COPY(Escape, CSI); + Strings.Append(LeftCrotchet, CSI); +(* + EraseDisplay; + GotoXY (0, 0); + COPY(CSI, tmpstr); + Strings.Append(Green, tmpstr); + Strings.Append("hello", tmpstr); + Out.String(tmpstr); Out.Ln; +*) + END vt100. diff --git a/src/system/Files.Mod b/src/system/Files.Mod deleted file mode 100644 index e4add256..00000000 --- a/src/system/Files.Mod +++ /dev/null @@ -1,749 +0,0 @@ -MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files *) - - IMPORT SYSTEM, Platform, Heap, Strings, Out := Console; - - (* standard data type I/O - - little endian, - Sint:1, Int:2, Lint:4 - ORD({0}) = 1, - false = 0, true =1 - IEEE real format, - null terminated strings, - compact numbers according to M.Odersky *) - - - CONST - nofbufs = 4; - bufsize = 4096; - noDesc = -1; - notDone = -1; - - (* file states *) - open = 0; (* OS File has been opened *) - create = 1; (* OS file needs to be created *) - close = 2; (* Register telling Create to use registerName directly: - i.e. since we're closing and all data is still in - buffers bypass writing to temp file and then renaming - and just write directly to fianl register name *) - - - TYPE - FileName = ARRAY 101 OF CHAR; - File* = POINTER TO FileDesc; - Buffer = POINTER TO BufDesc; - - FileDesc = RECORD - workName: FileName; - registerName: FileName; - tempFile: BOOLEAN; - identity: Platform.FileIdentity; - fd-: Platform.FileHandle; - len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; - swapper: INTEGER; - state: INTEGER; - next: File; - END; - - BufDesc = RECORD - f: File; - chg: BOOLEAN; - org: LONGINT; - size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE - END; - - Rider* = RECORD - res*: LONGINT; - eof*: BOOLEAN; - buf: Buffer; - org: LONGINT; (* File offset of block containing current position *) - offset: LONGINT (* Current position offset within block at org. *) - END; - - - VAR - files: File; (* List of files that have an OS file handle/descriptor assigned *) - tempno: INTEGER; - HOME: ARRAY 1024 OF CHAR; - SearchPath: POINTER TO ARRAY OF CHAR; - - - - - PROCEDURE -IdxTrap "__HALT(-1)"; - PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; - - PROCEDURE^ Finalize(o: SYSTEM.PTR); - - PROCEDURE Err(s: ARRAY OF CHAR; f: File; errcode: Platform.ErrorCode); - BEGIN - Out.Ln; Out.String("-- "); Out.String(s); Out.String(": "); - IF f # NIL THEN - IF f.registerName # "" THEN Out.String(f.registerName) ELSE Out.String(f.workName) END; - IF f.fd # 0 THEN Out.String("f.fd = "); Out.Int(f.fd,1) END - END; - IF errcode # 0 THEN Out.String(" errcode = "); Out.Int(errcode, 1) END; - Out.Ln; - HALT(99) - END Err; - - PROCEDURE MakeFileName(dir, name: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN i := 0; j := 0; - WHILE dir[i] # 0X DO dest[i] := dir[i]; INC(i) END; - IF dest[i-1] # "/" THEN dest[i] := "/"; INC(i) END; - WHILE name[j] # 0X DO dest[i] := name[j]; INC(i); INC(j) END; - dest[i] := 0X - END MakeFileName; - - PROCEDURE GetTempName(finalName: ARRAY OF CHAR; VAR name: ARRAY OF CHAR); - VAR n, i, j: LONGINT; - BEGIN - INC(tempno); n := tempno; i := 0; - IF finalName[0] # "/" THEN (* relative pathname *) - WHILE Platform.CWD[i] # 0X DO name[i] := Platform.CWD[i]; INC(i) END; - IF Platform.CWD[i-1] # "/" THEN name[i] := "/"; INC(i) END - END; - j := 0; - WHILE finalName[j] # 0X DO name[i] := finalName[j]; INC(i); INC(j) END; - DEC(i); - WHILE name[i] # "/" DO DEC(i) END; - name[i+1] := "."; name[i+2] := "t"; name[i+3] := "m"; name[i+4] := "p"; name[i+5] := "."; INC(i, 6); - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := "."; INC(i); n := Platform.PID; - WHILE n > 0 DO name[i] := CHR(n MOD 10 + ORD("0")); n := n DIV 10; INC(i) END; - name[i] := 0X - END GetTempName; - - PROCEDURE Create(f: File); - VAR - identity: Platform.FileIdentity; - done: BOOLEAN; - error: Platform.ErrorCode; - err: ARRAY 32 OF CHAR; - BEGIN - (* - Out.String("Files.Create fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) - IF f.fd = noDesc THEN - IF f.state = create THEN - GetTempName(f.registerName, f.workName); f.tempFile := TRUE - ELSIF f.state = close THEN - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END; - error := Platform.Unlink(f.workName); (*unlink first to avoid stale NFS handles and to avoid reuse of inodes*) - - error := Platform.New(f.workName, f.fd); - done := error = 0; - IF done THEN - f.next := files; files := f; - INC(Heap.FileCount); - Heap.RegisterFinalizer(f, Finalize); - f.state := open; - f.pos := 0; - error := Platform.Identify(f.fd, f.identity); - ELSE - IF Platform.NoSuchDirectory(error) THEN err := "no such directory" - ELSIF Platform.TooManyFiles(error) THEN err := "too many files open" - ELSE err := "file not created" - END; - Err(err, f, error) - END - END - END Create; - - PROCEDURE Flush(buf: Buffer); - VAR - error: Platform.ErrorCode; - f: File; - (* identity: Platform.FileIdentity; *) - BEGIN - (* - Out.String("Files.Flush buf.f.registername = "); Out.String(buf.f.registerName); - Out.String(", buf.f.fd = "); Out.Int(buf.f.fd,1); - Out.String(", buffer at $"); Out.Hex(SYSTEM.ADR(buf.data)); - Out.String(", size "); Out.Int(buf.size,1); Out.Ln; - *) - IF buf.chg THEN f := buf.f; Create(f); - IF buf.org # f.pos THEN - error := Platform.Seek(f.fd, buf.org, Platform.SeekSet); - (* - Out.String("Seeking to "); Out.Int(buf.org,1); - Out.String(", error code "); Out.Int(error,1); Out.Ln; - *) - END; - error := Platform.Write(f.fd, SYSTEM.ADR(buf.data), buf.size); - IF error # 0 THEN Err("error writing file", f, error) END; - f.pos := buf.org + buf.size; - buf.chg := FALSE; - error := Platform.Identify(f.fd, f.identity); - IF error # 0 THEN Err("error identifying file", f, error) END; - (* - error := Platform.Identify(f.fd, identity); - f.identity.mtime := identity.mtime; - *) - END - END Flush; - - - PROCEDURE CloseOSFile(f: File); - (* Close the OS file handle and remove f from 'files' *) - VAR prev: File; error: Platform.ErrorCode; - BEGIN - IF files = f THEN files := f.next - ELSE - prev := files; - WHILE (prev # NIL) & (prev.next # f) DO prev := prev.next END; - IF prev.next # NIL THEN prev.next := f.next END - END; - error := Platform.Close(f.fd); - f.fd := noDesc; f.state := create; DEC(Heap.FileCount); - END CloseOSFile; - - - PROCEDURE Close* (f: File); - VAR - i: LONGINT; - error: Platform.ErrorCode; - BEGIN - IF (f.state # create) OR (f.registerName # "") THEN - Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; - error := Platform.Sync(f.fd); - IF error # 0 THEN Err("error writing file", f, error) END; - CloseOSFile(f); - END - END Close; - - PROCEDURE Length* (f: File): LONGINT; - BEGIN RETURN f.len END Length; - - PROCEDURE New* (name: ARRAY OF CHAR): File; - VAR f: File; - BEGIN - NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - RETURN f - END New; - - PROCEDURE ScanPath(VAR pos: INTEGER; VAR dir: ARRAY OF CHAR); - (* Extract next individual directory from searchpath starting at pos, - updating pos and returning dir. - Supports ~, ~user and blanks inside path *) - VAR i: INTEGER; ch: CHAR; - BEGIN - i := 0; - IF SearchPath = NIL THEN - IF pos = 0 THEN - dir[0] := "."; i := 1; INC(pos) (* Default search path is just the current directory *) - END - ELSE - ch := SearchPath[pos]; - WHILE (ch = " ") OR (ch = ";") DO INC(pos); ch := SearchPath[pos] END; - IF ch = "~" THEN - INC(pos); ch := SearchPath[pos]; - WHILE HOME[i] # 0X DO dir[i] := HOME[i]; INC(i) END; - IF (ch # "/") & (ch # 0X) & (ch # ";") & (ch # " ") THEN - WHILE (i > 0) & (dir[i-1] # "/") DO DEC(i) END - END - END; - WHILE (ch # 0X) & (ch # ";") DO dir[i] := ch; INC(i); INC(pos); ch := SearchPath[pos] END; - WHILE (i > 0) & (dir[i-1] = " ") DO DEC(i) END - END; - dir[i] := 0X - END ScanPath; - - PROCEDURE HasDir(VAR name: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; ch := name[0]; - WHILE (ch # 0X) & (ch # "/") DO INC(i); ch := name[i] END; - RETURN ch = "/" - END HasDir; - - PROCEDURE CacheEntry(identity: Platform.FileIdentity): File; - VAR f: File; i: INTEGER; error: Platform.ErrorCode; - BEGIN f := files; - WHILE f # NIL DO - IF Platform.SameFile(identity, f.identity) THEN - IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; - INC(i) - END; - f.swapper := -1; f.identity := identity; - error := Platform.Size(f.fd, f.len); - END; - RETURN f - END; - f := f.next - END; - RETURN NIL - END CacheEntry; - - PROCEDURE Old*(name: ARRAY OF CHAR): File; - VAR - f: File; - fd: Platform.FileHandle; - pos: INTEGER; - done: BOOLEAN; - dir, path: ARRAY 256 OF CHAR; - error: Platform.ErrorCode; - identity: Platform.FileIdentity; - BEGIN - (* Out.String("Files.Old "); Out.String(name); Out.Ln; *) - IF name # "" THEN - IF HasDir(name) THEN dir := ""; COPY(name, path) - ELSE pos := 0; ScanPath(pos, dir); MakeFileName(dir, name, path); ScanPath(pos, dir) - END; - LOOP - error := Platform.OldRW(path, fd); done := error = 0; - IF ~done & Platform.TooManyFiles(error) THEN Err("too many files open", f, error) END; - IF ~done & Platform.Inaccessible(error) THEN - error := Platform.OldRO(path, fd); done := error = 0; - END; - IF ~done & ~Platform.Absent(error) THEN - Out.String("Warning: Files.Old "); Out.String(name); - Out.String(" error = "); Out.Int(error, 0); Out.Ln; - END; - IF done THEN - (* Out.String(" fd = "); Out.Int(fd,1); Out.Ln; *) - error := Platform.Identify(fd, identity); - f := CacheEntry(identity); - IF f # NIL THEN - (* error := Platform.Close(fd); DCWB: Either this should be removed or should call CloseOSFile. *) - RETURN f - ELSE NEW(f); Heap.RegisterFinalizer(f, Finalize); - f.fd := fd; f.state := open; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) - error := Platform.Size(fd, f.len); - COPY(name, f.workName); f.registerName := ""; f.tempFile := FALSE; - f.identity := identity; - f.next := files; files := f; INC(Heap.FileCount); - RETURN f - END - ELSIF dir = "" THEN RETURN NIL - ELSE MakeFileName(dir, name, path); ScanPath(pos, dir) - END - END - ELSE RETURN NIL - END - END Old; - - PROCEDURE Purge* (f: File); - VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; - BEGIN i := 0; - WHILE i < nofbufs DO - IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; - INC(i) - END; - IF f.fd # noDesc THEN - error := Platform.Truncate(f.fd, 0); - error := Platform.Seek(f.fd, 0, Platform.SeekSet) - END; - f.pos := 0; f.len := 0; f.swapper := -1; - error := Platform.Identify(f.fd, identity); Platform.SetMTime(f.identity, identity) - END Purge; - - PROCEDURE GetDate* (f: File; VAR t, d: LONGINT); - VAR - identity: Platform.FileIdentity; error: Platform.ErrorCode; - BEGIN - Create(f); error := Platform.Identify(f.fd, identity); - Platform.MTimeAsClock(identity, t, d) - END GetDate; - - PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset - END Pos; - - PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); - VAR org, offset, i, n: LONGINT; buf: Buffer; error: Platform.ErrorCode; - BEGIN - IF f # NIL THEN - (* - Out.String("Files.Set rider on fd = "); Out.Int(f.fd,1); - Out.String(", registerName = "); Out.String(f.registerName); - Out.String(", workName = "); Out.String(f.workName); - Out.String(", state = "); Out.Int(f.state,1); - Out.Ln; - *) - IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; - IF i < nofbufs THEN - IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf - ELSE buf := f.bufs[i] - END - ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; - buf := f.bufs[f.swapper]; - Flush(buf) - END; - IF buf.org # org THEN - IF org = f.len THEN buf.size := 0 - ELSE Create(f); - IF f.pos # org THEN error := Platform.Seek(f.fd, org, Platform.SeekSet) END; - error := Platform.ReadBuf(f.fd, buf.data, n); - IF error # 0 THEN Err("read from file not done", f, error) END; - f.pos := org + n; - buf.size := n - END; - buf.org := org; buf.chg := FALSE - END - ELSE buf := NIL; org := 0; offset := 0 - END; - r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 - END Set; - - PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; - BEGIN - buf := r.buf; offset := r.offset; - IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - IF (offset < buf.size) THEN - x := buf.data[offset]; r.offset := offset + 1 - ELSIF r.org + offset < buf.f.len THEN - Set(r, r.buf.f, r.org + offset); - x := r.buf.data[0]; r.offset := 1 - ELSE - x := 0X; r.eof := TRUE - END - END Read; - - PROCEDURE ReadBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - restInBuf := buf.size - offset; - IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN - ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) - END; - r.res := 0; r.eof := FALSE - END ReadBytes; - - PROCEDURE Base* (VAR r: Rider): File; - BEGIN RETURN r.buf.f - END Base; - - PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; - BEGIN - buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - buf.data[offset] := x; - buf.chg := TRUE; - IF offset = buf.size THEN - INC(buf.size); INC(buf.f.len) - END; - r.offset := offset + 1; r.res := 0 - END Write; - - PROCEDURE WriteBytes* (VAR r: Rider; VAR x: ARRAY OF SYSTEM.BYTE; n: LONGINT); - VAR xpos, min, restInBuf, offset: LONGINT; buf: Buffer; - BEGIN - IF n > LEN(x) THEN IdxTrap END; - xpos := 0; buf := r.buf; offset := r.offset; - WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN - Set(r, buf.f, r.org + offset); - buf := r.buf; offset := r.offset - END; - restInBuf := bufsize - offset; - IF n > restInBuf THEN min := restInBuf ELSE min := n END; - SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); - INC(offset, min); r.offset := offset; - IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; - INC(xpos, min); DEC(n, min); buf.chg := TRUE - END; - r.res := 0 - END WriteBytes; - -(* another solution would be one that is similar to ReadBytes, WriteBytes. -No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len -must be made consistent with offset (if offset > buf.size) in a lazy way. - -PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); - VAR buf: Buffer; offset: LONGINT; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN - Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; - END; - buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE -END Write; - -PROCEDURE WriteBytes ... - -PROCEDURE Read* (VAR r: Rider; VAR x: SYSTEM.BYTE); - VAR offset: LONGINT; buf: Buffer; -BEGIN - buf := r.buf; offset := r.offset; - IF (offset >= buf.size) OR (r.org # buf.org) THEN - IF r.org + offset >= buf.f.len THEN x := 0X; r.eof := TRUE; RETURN - ELSE Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset - END - END; - x := buf.data[offset]; r.offset := offset + 1 -END Read; - -but this would also affect Set, Length, and Flush. -Especially Length would become fairly complex. -*) - - PROCEDURE Delete*(name: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN res := Platform.Unlink(name) END Delete; - - PROCEDURE Rename* (old, new: ARRAY OF CHAR; VAR res: INTEGER); - VAR - fdold, fdnew: Platform.FileHandle; - n: LONGINT; - error, ignore: Platform.ErrorCode; - oldidentity, newidentity: Platform.FileIdentity; - buf: ARRAY 4096 OF CHAR; - BEGIN - (* - Out.String("Files.Rename old = "); Out.String(old); - Out.String(", new = "); Out.String(new); Out.Ln; - *) - error := Platform.IdentifyByName(old, oldidentity); - IF error = 0 THEN - error := Platform.IdentifyByName(new, newidentity); - IF (error # 0) & ~Platform.SameFile(oldidentity, newidentity) THEN - Delete(new, error); (* work around stale nfs handles *) - END; - error := Platform.Rename(old, new); - (* Out.String("Platform.Rename error code "); Out.Int(error,1); Out.Ln; *) - IF ~Platform.DifferentFilesystems(error) THEN - res := error; RETURN - ELSE - (* cross device link, move the file *) - error := Platform.OldRO(old, fdold); - IF error # 0 THEN res := 2; RETURN END; - error := Platform.New(new, fdnew); - IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); - WHILE n > 0 DO - error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); - IF error # 0 THEN - ignore := Platform.Close(fdold); - ignore := Platform.Close(fdnew); - Err("cannot move file", NIL, error) - END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); - END; - ignore := Platform.Close(fdold); - ignore := Platform.Close(fdnew); - IF n = 0 THEN - error := Platform.Unlink(old); res := 0 - ELSE - Err("cannot move file", NIL, error) - END; - END - ELSE - res := 2 (* old file not found *) - END - END Rename; - - PROCEDURE Register* (f: File); - VAR idx, errcode: INTEGER; f1: File; file: ARRAY 104 OF CHAR; - BEGIN - (* - Out.String("Files.Register f.registerName = "); Out.String(f.registerName); - Out.String(", fd = "); Out.Int(f.fd,1); Out.Ln; - *) - IF (f.state = create) & (f.registerName # "") THEN f.state := close (* shortcut renaming *) END; - Close(f); - IF f.registerName # "" THEN - Rename(f.workName, f.registerName, errcode); - (* - Out.String("Renamed (for register) f.fd = "); Out.Int(f.fd,1); - Out.String(" from workname "); Out.String(f.workName); - Out.String(" to registerName "); Out.String(f.registerName); - Out.String(" errorcode = "); Out.Int(errcode,1); Out.Ln; - *) - IF errcode # 0 THEN COPY(f.registerName, file); HALT(99) END; - f.workName := f.registerName; f.registerName := ""; f.tempFile := FALSE - END - END Register; - - PROCEDURE ChangeDirectory*(path: ARRAY OF CHAR; VAR res: INTEGER); - BEGIN - res := Platform.Chdir(path); - END ChangeDirectory; - - PROCEDURE FlipBytes(VAR src, dest: ARRAY OF SYSTEM.BYTE); - VAR i, j: LONGINT; - BEGIN - IF ~Platform.LittleEndian THEN i := LEN(src); j := 0; - WHILE i > 0 DO DEC(i); dest[j] := src[i]; INC(j) END - ELSE SYSTEM.MOVE(SYSTEM.ADR(src), SYSTEM.ADR(dest), LEN(src)) - END - END FlipBytes; - - PROCEDURE ReadBool* (VAR R: Rider; VAR x: BOOLEAN); - BEGIN Read(R, SYSTEM.VAL(CHAR, x)) - END ReadBool; - - PROCEDURE ReadInt* (VAR R: Rider; VAR x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN ReadBytes(R, b, 2); - x := ORD(b[0]) + ORD(b[1])*256 - END ReadInt; - - PROCEDURE ReadLInt* (VAR R: Rider; VAR x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); - x := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H - END ReadLInt; - - PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET); - (* Reads 32 bits as a SET value (even on 64 bit systems. See Oakwood appendix 1.2.5.4 *) - VAR b: ARRAY 4 OF CHAR; l: LONGINT; - BEGIN ReadBytes(R, b, 4); - (* Need to read via a LONGINT to provide correct behaviour for 64 bit sets. *) - l := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H; - x := SYSTEM.VAL(SET, l) - END ReadSet; - - PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN ReadBytes(R, b, 4); FlipBytes(b, x) - END ReadReal; - - PROCEDURE ReadLReal* (VAR R: Rider; VAR x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN ReadBytes(R, b, 8); FlipBytes(b, x) - END ReadLReal; - - PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; - BEGIN i := 0; - REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X - END ReadString; - - PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; - BEGIN - i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b - END ReadLine; - - PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); - VAR s, b: SYSTEM.INT8; q: SYSTEM.INT64; - BEGIN - s := 0; q := 0; Read(R, b); - WHILE b < 0 DO INC(q, ASH(b+128, s)); INC(s, 7); Read(R, b) END; - INC(q, ASH(b MOD 64 - b DIV 64 * 64, s)); - ASSERT(LEN(x) <= 8); - SYSTEM.MOVE(SYSTEM.ADR(q), SYSTEM.ADR(x), LEN(x)) (* Assumes little endian representation of q and x. *) - END ReadNum; - - PROCEDURE WriteBool* (VAR R: Rider; x: BOOLEAN); - BEGIN Write(R, SYSTEM.VAL(CHAR, x)) - END WriteBool; - - PROCEDURE WriteInt* (VAR R: Rider; x: INTEGER); - VAR b: ARRAY 2 OF CHAR; - BEGIN b[0] := CHR(x); b[1] := CHR(x DIV 256); - WriteBytes(R, b, 2); - END WriteInt; - - PROCEDURE WriteLInt* (VAR R: Rider; x: LONGINT); - VAR b: ARRAY 4 OF CHAR; - BEGIN - b[0] := CHR(x); b[1] := CHR(x DIV 100H); b[2] := CHR(x DIV 10000H); b[3] := CHR(x DIV 1000000H); - WriteBytes(R, b, 4); - END WriteLInt; - - PROCEDURE WriteSet* (VAR R: Rider; x: SET); - VAR b: ARRAY 4 OF CHAR; i: LONGINT; - BEGIN i := SYSTEM.VAL(LONGINT, x); - b[0] := CHR(i); b[1] := CHR(i DIV 100H); b[2] := CHR(i DIV 10000H); b[3] := CHR(i DIV 1000000H); - WriteBytes(R, b, 4); - END WriteSet; - - PROCEDURE WriteReal* (VAR R: Rider; x: REAL); - VAR b: ARRAY 4 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 4) - END WriteReal; - - PROCEDURE WriteLReal* (VAR R: Rider; x: LONGREAL); - VAR b: ARRAY 8 OF CHAR; - BEGIN FlipBytes(x, b); WriteBytes(R, b, 8) - END WriteLReal; - - PROCEDURE WriteString* (VAR R: Rider; x: ARRAY [1] OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE x[i] # 0X DO INC(i) END; - WriteBytes(R, x, i+1) - END WriteString; - - PROCEDURE WriteNum* (VAR R: Rider; x: SYSTEM.INT64); - BEGIN - WHILE (x < - 64) OR (x > 63) DO Write(R, CHR(x MOD 128 + 128)); x := x DIV 128 END; - Write(R, CHR(x MOD 128)) - END WriteNum; - - PROCEDURE GetName*(f: File; VAR name: ARRAY OF CHAR); - BEGIN - COPY (f.workName, name); - END GetName; - - PROCEDURE Finalize(o: SYSTEM.PTR); - VAR f: File; res: LONGINT; - BEGIN - f := SYSTEM.VAL(File, o); - (* - Out.String("Files.Finalize f.fd = "); Out.Int(f.fd,1); - Out.String(", f.registername = "); Out.String(f.registerName); - Out.String(", f.workName = "); Out.String(f.workName); Out.Ln; - *) - IF f.fd >= 0 THEN - CloseOSFile(f); - IF f.tempFile THEN res := Platform.Unlink(f.workName) END - END - END Finalize; - - PROCEDURE SetSearchPath*(path: ARRAY OF CHAR); - BEGIN - IF Strings.Length(path) # 0 THEN - NEW(SearchPath, Strings.Length(path)+1); - COPY(path, SearchPath^) - ELSE - SearchPath := NIL - END - END SetSearchPath; - - -BEGIN - tempno := -1; - Heap.FileCount := 0; - HOME := ""; Platform.GetEnv("HOME", HOME); -END Files. diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod deleted file mode 100644 index b05b218b..00000000 --- a/src/system/Heap.Mod +++ /dev/null @@ -1,578 +0,0 @@ -MODULE Heap; - - IMPORT S := SYSTEM; (* Cannot import anything else as heap initialization must complete - before any other modules are initialized. *) - - CONST - ModNameLen = 20; - CmdNameLen = 24; - SZA = SIZE(S.ADDRESS); (* Size of address *) - Unit = 4*SZA; (* smallest possible heap block *) - nofLists = 9; (* number of free_lists *) - heapSize0 = 8000*Unit; (* startup heap size *) - - (* all blocks look the same: - free blocks describe themselves: size = Unit - tag = &tag++ - ->block size - sentinel = -SZA - next - *) - - (* heap chunks *) - nextChnkOff = S.VAL(S.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) - endOff = S.VAL(S.ADDRESS, SZA); (* end of heap chunk *) - blkOff = S.VAL(S.ADDRESS, 3*SZA); (* first block in a chunk *) - - (* heap blocks *) - tagOff = S.VAL(S.ADDRESS, 0); (* block starts with tag *) - sizeOff = S.VAL(S.ADDRESS, SZA); (* block size in free block relative to block start *) - sntlOff = S.VAL(S.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = S.VAL(S.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = S.VAL(S.ADDRESS, -SZA); - AddressZero = S.VAL(S.ADDRESS, 0); - - TYPE - ModuleName = ARRAY ModNameLen OF CHAR; - CmdName = ARRAY CmdNameLen OF CHAR; - - Module = POINTER TO ModuleDesc; - Cmd = POINTER TO CmdDesc; - - EnumProc = PROCEDURE(P: PROCEDURE(p: S.PTR)); - - ModuleDesc = RECORD - next: Module; - name: ModuleName; - refcnt: LONGINT; - cmds: Cmd; - types: S.ADDRESS; - enumPtrs: EnumProc; - reserved1, reserved2: LONGINT - END ; - - Command = PROCEDURE; - - CmdDesc = RECORD - next: Cmd; - name: CmdName; - cmd: Command - END ; - - Finalizer = PROCEDURE(obj: S.PTR); - - FinNode = POINTER TO FinDesc; - FinDesc = RECORD - next: FinNode; - obj: S.ADDRESS; (* weak pointer *) - marked: BOOLEAN; - finalize: Finalizer; - END ; - - VAR - (* the list of loaded (=initialization started) modules *) - modules*: S.PTR; - - freeList: ARRAY nofLists + 1 OF S.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: S.ADDRESS; - allocated*: S.ADDRESS; - firstTry: BOOLEAN; - - (* extensible heap *) - heap: S.ADDRESS; (* the sorted list of heap chunks *) - heapend: S.ADDRESS; (* max possible pointer value (used for stack collection) *) - heapsize*: S.ADDRESS; (* the sum of all heap chunk sizes *) - - (* finalization candidates *) - fin: FinNode; - - (* garbage collector locking *) - lockdepth: INTEGER; - interrupted: BOOLEAN; - - (* File system file count monitor *) - FileCount*: INTEGER; - - - PROCEDURE Lock*; - BEGIN - INC(lockdepth); - END Lock; - - PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; - - PROCEDURE Unlock*; - BEGIN - DEC(lockdepth); - IF interrupted & (lockdepth = 0) THEN - PlatformHalt(-9); - END - END Unlock; - - - (* - PROCEDURE TAS*(VAR flag:BOOLEAN): BOOLEAN; (* added for compatibility with ulmSYSTEM module; noch *) - VAR oldflag : BOOLEAN; - BEGIN - oldflag := flag; - flag := TRUE; - RETURN oldflag; - END TAS; - *) - - PROCEDURE REGMOD*(VAR name: ModuleName; enumPtrs: EnumProc): S.PTR; - VAR m: Module; - BEGIN - (* REGMOD is called at the start of module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type - descriptors being ready for use, therefore, just for the Heap module itself, we - must use S.NEW. *) - IF name = "Heap" THEN - S.NEW(m, SIZE(ModuleDesc)) - ELSE - NEW(m) - END; - m.types := 0; m.cmds := NIL; - COPY(name, m.name); m.refcnt := 0; m.enumPtrs := enumPtrs; m.next := S.VAL(Module, modules); - modules := m; - RETURN m - END REGMOD; - - PROCEDURE REGCMD*(m: Module; VAR name: CmdName; cmd: Command); - VAR c: Cmd; - BEGIN - (* REGCMD is called during module initialisation code before that modules - type descriptors have been set up. 'NEW' depends on the Heap modules type - descriptors being ready for use, therefore, just for the commands registered - by the Heap module itself, we must use S.NEW. *) - IF m.name = "Heap" THEN - S.NEW(c, SIZE(CmdDesc)) - ELSE - NEW(c) - END; - COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c - END REGCMD; - - PROCEDURE REGTYP*(m: Module; typ: S.ADDRESS); - BEGIN S.PUT(typ, m.types); m.types := typ - END REGTYP; - - PROCEDURE INCREF*(m: Module); - BEGIN INC(m.refcnt) - END INCREF; - - - PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; - PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; - - PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; - VAR chnk: S.ADDRESS; - BEGIN - chnk := OSAllocate(blksz + blkOff); - IF chnk # 0 THEN - S.PUT(chnk + endOff, chnk + (blkOff + blksz)); - S.PUT(chnk + blkOff, chnk + (blkOff + sizeOff)); - S.PUT(chnk + (blkOff + sizeOff), blksz); - S.PUT(chnk + (blkOff + sntlOff), NoPtrSntl); - S.PUT(chnk + (blkOff + nextOff), bigBlocks); - bigBlocks := chnk + blkOff; - INC(heapsize, blksz) - END ; - RETURN chnk - END NewChunk; - - PROCEDURE ExtendHeap(blksz: S.ADDRESS); - VAR size, chnk, j, next: S.ADDRESS; - BEGIN - IF blksz > 10000*Unit THEN size := blksz - ELSE size := 10000*Unit (* additional heuristics *) - END ; - chnk := NewChunk(size); - IF chnk # 0 THEN - (*sorted insertion*) - IF chnk < heap THEN - S.PUT(chnk, heap); heap := chnk - ELSE - j := heap; S.GET(j, next); - WHILE (next # 0) & (chnk > next) DO - j := next; - S.GET(j, next) - END; - S.PUT(chnk, next); S.PUT(j, chnk) - END ; - IF next = 0 THEN S.GET(chnk+endOff, heapend) END - END - END ExtendHeap; - - PROCEDURE ^GC*(markStack: BOOLEAN); - - PROCEDURE NEWREC*(tag: S.ADDRESS): S.PTR; - VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: S.ADDRESS; - new: S.PTR; - BEGIN - Lock(); - S.GET(tag, blksz); - - ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(S.PTR) = SIZE(S.ADDRESS)); - ASSERT(blksz MOD Unit = 0); - - i0 := blksz DIV Unit; i := i0; - IF i < nofLists THEN adr := freeList[i]; - WHILE adr = 0 DO INC(i); adr := freeList[i] END - END ; - IF i < nofLists THEN (* unlink *) - S.GET(adr + nextOff, next); - freeList[i] := next; - IF i # i0 THEN (* split *) - di := i - i0; restsize := di * Unit; end := adr + restsize; - S.PUT(end + sizeOff, blksz); - S.PUT(end + sntlOff, NoPtrSntl); - S.PUT(end, end + sizeOff); - S.PUT(adr + sizeOff, restsize); - S.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr; - INC(adr, restsize) - END - ELSE - adr := bigBlocks; prev := 0; - LOOP - IF adr = 0 THEN - IF firstTry THEN - GC(TRUE); INC(blksz, Unit); - IF (heapsize - allocated - blksz) * 4 < heapsize THEN - (* heap is still almost full; expand to avoid thrashing *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize) - END ; - firstTry := FALSE; new := NEWREC(tag); firstTry := TRUE; - IF new = NIL THEN - (* depending on the fragmentation, the heap may not have been extended by - the anti-thrashing heuristics above *) - ExtendHeap((allocated + blksz) DIV (3*Unit) * (4*Unit) - heapsize); - new := NEWREC(tag); (* will find a free block if heap has been expanded properly *) - END ; - Unlock(); RETURN new - ELSE - Unlock(); RETURN NIL - END - END ; - S.GET(adr+sizeOff, t); - IF t >= blksz THEN EXIT END ; - prev := adr; S.GET(adr + nextOff, adr) - END ; - restsize := t - blksz; end := adr + restsize; - S.PUT(end + sizeOff, blksz); - S.PUT(end + sntlOff, NoPtrSntl); - S.PUT(end, end + sizeOff); - IF restsize > nofLists * Unit THEN (*resize*) - S.PUT(adr + sizeOff, restsize) - ELSE (*unlink*) - S.GET(adr + nextOff, next); - IF prev = 0 THEN bigBlocks := next - ELSE S.PUT(prev + nextOff, next); - END ; - IF restsize > 0 THEN (*move*) - di := restsize DIV Unit; - S.PUT(adr + sizeOff, restsize); - S.PUT(adr + nextOff, freeList[di]); - freeList[di] := adr - END - END ; - INC(adr, restsize) - END ; - i := adr + 4*SZA; end := adr + blksz; - WHILE i < end DO (*deliberately unrolled*) - S.PUT(i, AddressZero); - S.PUT(i + SZA, AddressZero); - S.PUT(i + 2*SZA, AddressZero); - S.PUT(i + 3*SZA, AddressZero); - INC(i, 4*SZA) - END ; - S.PUT(adr + nextOff, AddressZero); - S.PUT(adr, tag); - S.PUT(adr + sizeOff, AddressZero); - S.PUT(adr + sntlOff, AddressZero); - INC(allocated, blksz); - Unlock(); - RETURN S.VAL(S.PTR, adr + SZA) - END NEWREC; - - PROCEDURE NEWBLK*(size: S.ADDRESS): S.PTR; - VAR blksz, tag: S.ADDRESS; new: S.PTR; - BEGIN - Lock(); - blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) - new := NEWREC(S.ADR(blksz)); - tag := S.VAL(S.ADDRESS, new) + blksz - 3*SZA; - S.PUT(tag - SZA, AddressZero); (*reserved for meta info*) - S.PUT(tag, blksz); - S.PUT(tag + SZA, NoPtrSntl); - S.PUT(S.VAL(S.ADDRESS, new) - SZA, tag); - Unlock(); - RETURN new - END NEWBLK; - - PROCEDURE Mark(q: S.ADDRESS); - VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; - BEGIN - IF q # 0 THEN - S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) - IF ~ODD(tagbits) THEN (* If it has not already been marked *) - S.PUT(q - SZA, tagbits + 1); (* Mark it *) - p := 0; - tag := tagbits + SZA; (* Tag addresses first offset *) - LOOP - S.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) - S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) - IF p = 0 THEN EXIT END ; - n := q; q := p; - S.GET(q - SZA, tag); DEC(tag, 1); - S.GET(tag, offset); fld := q + offset; - S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) - ELSE (* offset references a ptr field *) - fld := q + offset; (* S.ADDRESS the pointer *) - S.GET(fld, n); (* Load the pointer *) - IF n # 0 THEN (* If pointer is not NIL *) - S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) - IF ~ODD(tagbits) THEN - S.PUT(n - SZA, tagbits + 1); - S.PUT(q - SZA, tag + 1); - S.PUT(fld, S.VAL(S.PTR, p)); - p := q; q := n; - tag := tagbits - END - END - END ; - INC(tag, SZA) - END - END - END - END Mark; - - PROCEDURE MarkP(p: S.PTR); (* for compatibility with EnumPtrs in ANSI mode *) - BEGIN - Mark(S.VAL(S.ADDRESS, p)) - END MarkP; - - PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: S.ADDRESS; - BEGIN bigBlocks := 0; i := 1; - WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; - freesize := 0; allocated := 0; chnk := heap; - WHILE chnk # 0 DO - adr := chnk + blkOff; - S.GET(chnk + endOff, end); - WHILE adr < end DO - S.GET(adr, tag); - IF ODD(tag) THEN (*marked*) - IF freesize > 0 THEN - start := adr - freesize; - S.PUT(start, start+SZA); - S.PUT(start+sizeOff, freesize); - S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - DEC(tag, 1); - S.PUT(adr, tag); - S.GET(tag, size); - INC(allocated, size); - INC(adr, size) - ELSE (*unmarked*) - S.GET(tag, size); - INC(freesize, size); - INC(adr, size) - END - END ; - IF freesize > 0 THEN (*collect last block*) - start := adr - freesize; - S.PUT(start, start+SZA); - S.PUT(start+sizeOff, freesize); - S.PUT(start+sntlOff, NoPtrSntl); - i := freesize DIV Unit; freesize := 0; - IF i < nofLists THEN S.PUT(start + nextOff, freeList[i]); freeList[i] := start - ELSE S.PUT(start + nextOff, bigBlocks); bigBlocks := start - END - END ; - S.GET(chnk, chnk) - END - END Scan; - - PROCEDURE Sift (l, r: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR i, j, x: S.ADDRESS; - BEGIN j := l; x := a[j]; - LOOP i := j; j := 2*j + 1; - IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; - IF (j > r) OR (a[j] <= x) THEN EXIT END; - a[i] := a[j] - END; - a[i] := x - END Sift; - - PROCEDURE HeapSort (n: S.ADDRESS; VAR a: ARRAY OF S.ADDRESS); - VAR l, r, x: S.ADDRESS; - BEGIN l := n DIV 2; r := n - 1; - WHILE l > 0 DO DEC(l); Sift(l, r, a) END; - WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END - END HeapSort; - - PROCEDURE MarkCandidates(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: S.ADDRESS; - BEGIN - chnk := heap; i := 0; lim := cand[n-1]; - WHILE (chnk # 0 ) & (chnk < lim) DO - adr := chnk + blkOff; - S.GET(chnk + endOff, lim1); - IF lim < lim1 THEN lim1 := lim END ; - WHILE adr < lim1 DO - S.GET(adr, tag); - IF ODD(tag) THEN (*already marked*) - S.GET(tag-1, size); INC(adr, size) - ELSE - S.GET(tag, size); - ptr := adr + SZA; - WHILE cand[i] < ptr DO INC(i) END ; - IF i = n THEN RETURN END ; - next := adr + size; - IF cand[i] < next THEN Mark(ptr) END ; - adr := next - END - END ; - S.GET(chnk, chnk) - END - END MarkCandidates; - - PROCEDURE CheckFin; - VAR n: FinNode; tag: S.ADDRESS; - BEGIN - n := fin; - WHILE n # NIL DO - S.GET(n.obj - SZA, tag); - IF ~ODD(tag) THEN n.marked := FALSE; Mark(n.obj) - ELSE n.marked := TRUE - END ; - n := n.next - END - END CheckFin; - - PROCEDURE Finalize; - VAR n, prev: FinNode; - BEGIN n := fin; prev := NIL; - WHILE n # NIL DO - IF ~n.marked THEN - IF n = fin THEN fin := fin.next ELSE prev.next := n.next END ; - n.finalize(S.VAL(S.PTR, n.obj)); - (* new nodes may have been pushed in n.finalize, therefore: *) - IF prev = NIL THEN n := fin ELSE n := n.next END - ELSE - prev := n; n := n.next - END - END - END Finalize; - - PROCEDURE FINALL*; - VAR n: FinNode; - BEGIN - WHILE fin # NIL DO - n := fin; fin := fin.next; - n.finalize(S.VAL(S.PTR, n.obj)) - END - END FINALL; - - PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; - - PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); - VAR - frame: S.PTR; - inc, nofcand: S.ADDRESS; - sp, p, stack0: S.ADDRESS; - align: RECORD ch: CHAR; p: S.PTR END ; - BEGIN - IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) - IF n > 100 THEN RETURN END (* prevent tail recursion optimization *) - END ; - IF n = 0 THEN - nofcand := 0; sp := S.ADR(frame); - stack0 := PlatformMainStackFrame(); - (* check for minimum alignment of pointers *) - inc := S.ADR(align.p) - S.ADR(align); - IF sp > stack0 THEN inc := -inc END ; - WHILE sp # stack0 DO - S.GET(sp, p); - IF (p > heap) & (p < heapend) THEN - IF nofcand = LEN(cand) THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand); nofcand := 0 END ; - cand[nofcand] := p; INC(nofcand) - END ; - INC(sp, inc) - END ; - IF nofcand > 0 THEN HeapSort(nofcand, cand); MarkCandidates(nofcand, cand) END - END - END MarkStack; - - PROCEDURE GC*(markStack: BOOLEAN); - VAR - m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: S.ADDRESS; - cand: ARRAY 10000 OF S.ADDRESS; - BEGIN - IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN - Lock(); - m := S.VAL(Module, modules); - WHILE m # NIL DO - IF m.enumPtrs # NIL THEN m.enumPtrs(MarkP) END ; - m := m^.next - END ; - IF markStack THEN - (* generate register pressure to force callee saved registers to memory; - may be simplified by inlining OS calls or processor specific instructions - *) - i0 := -100; i1 := -101; i2 := -102; i3 := -103; i4 := -104; i5 := -105; i6 := -106; i7 := -107; - i8 := 1; i9 := 2; i10 := 3; i11 := 4; i12 := 5; i13 := 6; i14 := 7; i15 := 8; - i16 := 9; i17 := 10; i18 := 11; i19 := 12; i20 := 13; i21 := 14; i22 := 15; i23 := 16; - LOOP INC(i0, 1); INC(i1, 2); INC(i2, 3); INC(i3, 4); INC(i4, 5); INC(i5, 6); INC(i6, 7); INC(i7, 8); - INC(i8, 9); INC(i9, 10); INC(i10, 11); INC(i11, 12); INC(i12, 13); INC(i13, 14); INC(i14, 15); INC(i15, 16); - INC(i16, 17); INC(i17, 18); INC(i18, 19); INC(i19, 20); INC(i20, 21); INC(i21, 22); INC(i22, 23); INC(i23, 24); - IF (i0 = -99) & (i15 = 24) THEN MarkStack(32, cand); EXIT END - END ; - IF i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 - + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 > 10000 THEN RETURN (* use all variables *) - END ; - END; - CheckFin; - Scan; - Finalize; - Unlock() - END - END GC; - - PROCEDURE RegisterFinalizer*(obj: S.PTR; finalize: Finalizer); - VAR f: FinNode; - BEGIN NEW(f); - f.obj := S.VAL(S.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; - f.next := fin; fin := f; - END RegisterFinalizer; - - -PROCEDURE -ExternHeapInit "extern void *Heap__init();"; -PROCEDURE -HeapModuleInit 'Heap__init()'; - - PROCEDURE InitHeap*; - (* InitHeap is called by Platform.init before any module bodies have been - initialised, to enable NEW, S.NEW *) - BEGIN - heap := NewChunk(heapSize0); - S.GET(heap + endOff, heapend); - S.PUT(heap, AddressZero); - allocated := 0; firstTry := TRUE; freeList[nofLists] := 1; lockdepth := 0; - FileCount := 0; modules := NIL; heapsize := 0; bigBlocks := 0; fin := NIL; - interrupted := FALSE; - - HeapModuleInit; - END InitHeap; - -END Heap. diff --git a/src/system/Oberon.Mod b/src/system/Oberon.Mod deleted file mode 100644 index d0125cdc..00000000 --- a/src/system/Oberon.Mod +++ /dev/null @@ -1,86 +0,0 @@ -MODULE Oberon; - -(* this version should not have dependency on graphics -- noch *) - - IMPORT Platform, Texts, Args, Console; - - TYPE - ParList* = POINTER TO ParRec; - - ParRec* = RECORD - (* vwr*: Viewers.Viewer; - frame*: Display.Frame;*) - text*: Texts.Text; - pos*: LONGINT - END; - - VAR - - Log*: Texts.Text; - Par*: ParList; (*actual parameters*) - R: Texts.Reader; - W: Texts.Writer; - OptionChar*: CHAR; - - (*clocks*) - - PROCEDURE GetClock* (VAR t, d: LONGINT); - BEGIN Platform.GetClock(t, d) - END GetClock; - - PROCEDURE Time* (): LONGINT; - BEGIN - RETURN Platform.Time() - END Time; - - PROCEDURE PopulateParams; - VAR - W: Texts.Writer; - i: INTEGER; - str: ARRAY 32 OF CHAR; - BEGIN - - i := 1; (* skip program name *) - Texts.OpenWriter(W); - - REPEAT - IF i < Args.argc THEN - Args.Get(i, str); - Texts.WriteString(W, str); - Texts.WriteString(W, " "); - END; - INC(i) - UNTIL i >= Args.argc; - - Texts.Append (Par^.text, W.buf); - - END PopulateParams; - - PROCEDURE GetSelection*(VAR text: Texts.Text; VAR beg, end, time: LONGINT); - BEGIN text := NIL; beg := 0; end := 0; time := 0; - END GetSelection; - -(* --- Notifier for echoing all text appended to the log onto the console. --- *) - -PROCEDURE LogNotifier(Log: Texts.Text; op: INTEGER; beg, end: LONGINT); - VAR ch: CHAR; -BEGIN - Texts.OpenReader(R, Log, beg); - WHILE ~R.eot & (beg < end) DO - Texts.Read(R, ch); - IF ch = 0DX THEN Console.Ln ELSE Console.Char(ch) END; - INC(beg) - END -END LogNotifier; - -BEGIN - NEW(Par); - NEW(Par.text); - Par.pos := 0; - OptionChar := '-'; - Texts.Open(Par.text, ""); - PopulateParams; - NEW(Log); - Texts.Open(Log, ""); - Log.notify := LogNotifier; -END Oberon. diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod deleted file mode 100644 index 034906bd..00000000 --- a/src/system/Platformunix.Mod +++ /dev/null @@ -1,552 +0,0 @@ -MODULE Platform; -IMPORT SYSTEM; - -CONST - StdIn- = 0; - StdOut- = 1; - StdErr- = 2; - -TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); - - ErrorCode* = INTEGER; - FileHandle* = LONGINT; - - FileIdentity* = RECORD - volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - index: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - mtime: LONGINT; (* File modification time, value is system dependent *) - END; - - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - -VAR - LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; - PID-: INTEGER; (* Note: Must be updated by Fork implementation *) - CWD-: ARRAY 256 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; - TimeStart: LONGINT; - - SeekSet-: INTEGER; - SeekCur-: INTEGER; - SeekEnd-: INTEGER; - - NL-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) - - - -(* Unix headers to be included *) - -PROCEDURE -Aincludesystime '#include '; (* for gettimeofday *) -PROCEDURE -Aincludetime '#include '; (* for localtime *) -PROCEDURE -Aincludesystypes '#include '; -PROCEDURE -Aincludeunistd '#include '; -PROCEDURE -Aincludesysstat '#include '; -PROCEDURE -Aincludefcntl '#include '; -PROCEDURE -Aincludeerrno '#include '; -PROCEDURE -Astdlib '#include '; -PROCEDURE -Astdio '#include '; -PROCEDURE -Aerrno '#include '; - - - - -(* Error code tests *) - -PROCEDURE -EMFILE(): ErrorCode 'EMFILE'; -PROCEDURE -ENFILE(): ErrorCode 'ENFILE'; -PROCEDURE -ENOENT(): ErrorCode 'ENOENT'; -PROCEDURE -EXDEV(): ErrorCode 'EXDEV'; -PROCEDURE -EACCES(): ErrorCode 'EACCES'; -PROCEDURE -EROFS(): ErrorCode 'EROFS'; -PROCEDURE -EAGAIN(): ErrorCode 'EAGAIN'; -PROCEDURE -ETIMEDOUT(): ErrorCode 'ETIMEDOUT'; -PROCEDURE -ECONNREFUSED(): ErrorCode 'ECONNREFUSED'; -PROCEDURE -ECONNABORTED(): ErrorCode 'ECONNABORTED'; -PROCEDURE -ENETUNREACH(): ErrorCode 'ENETUNREACH'; -PROCEDURE -EHOSTUNREACH(): ErrorCode 'EHOSTUNREACH'; -PROCEDURE -EINTR(): ErrorCode 'EINTR'; - - - - -PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = EMFILE()) OR (e = ENFILE()) END TooManyFiles; - -PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ENOENT() END NoSuchDirectory; - -PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EXDEV() END DifferentFilesystems; - -PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = EACCES()) OR (e = EROFS()) OR (e = EAGAIN()) END Inaccessible; - -PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ENOENT() END Absent; - -PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ETIMEDOUT() END TimedOut; - -PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) - OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; - -PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EINTR() END Interrupted; - - - - -(* OS memory allocaton *) - -PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; - -PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; - - - - -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := argc; - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - HaltCode := -128; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - -(* Program arguments and environment access *) - -PROCEDURE -getenv(var: ARRAY OF CHAR): EnvPtr "(Platform_EnvPtr)getenv((char*)var)"; - -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR p: EnvPtr; -BEGIN - p := getenv(var); - IF p # NIL THEN COPY(p^, val) END; - RETURN p # NIL; -END getEnv; - -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); -BEGIN - IF ~ getEnv(var, val) THEN val[0] := 0X END; -END GetEnv; - -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; - - - - - -(* Signals and traps *) - -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; - -PROCEDURE SetInterruptHandler*(handler: SignalHandler); -BEGIN sethandler(2, handler); END SetInterruptHandler; - -PROCEDURE SetQuitHandler*(handler: SignalHandler); -BEGIN sethandler(3, handler); END SetQuitHandler; - -PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); -BEGIN sethandler(4, handler); END SetBadInstructionHandler; - - - - -(* Time of day *) - -PROCEDURE -gettimeval "struct timeval tv; gettimeofday(&tv,0)"; -PROCEDURE -tvsec(): LONGINT "tv.tv_sec"; -PROCEDURE -tvusec(): LONGINT "tv.tv_usec"; -PROCEDURE -sectotm(s: LONGINT) "struct tm *time = localtime((time_t*)&s)"; -PROCEDURE -tmsec(): LONGINT "(LONGINT)time->tm_sec"; -PROCEDURE -tmmin(): LONGINT "(LONGINT)time->tm_min"; -PROCEDURE -tmhour(): LONGINT "(LONGINT)time->tm_hour"; -PROCEDURE -tmmday(): LONGINT "(LONGINT)time->tm_mday"; -PROCEDURE -tmmon(): LONGINT "(LONGINT)time->tm_mon"; -PROCEDURE -tmyear(): LONGINT "(LONGINT)time->tm_year"; - -PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: LONGINT; VAR t, d: LONGINT); -BEGIN - d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; - t := ASH(ho, 12) + ASH(mi, 6) + se; -END YMDHMStoClock; - -PROCEDURE GetClock*(VAR t, d: LONGINT); -BEGIN - gettimeval; sectotm(tvsec()); - YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); -END GetClock; - -PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); -BEGIN - gettimeval; sec := tvsec(); usec := tvusec(); -END GetTimeOfDay; - -PROCEDURE Time*(): LONGINT; -VAR ms: LONGINT; -BEGIN - gettimeval; - ms := (tvusec() DIV 1000) + (tvsec() * 1000); - RETURN (ms - TimeStart) MOD 7FFFFFFFH; -END Time; - - -PROCEDURE -nanosleep(s: LONGINT; ns: LONGINT) "struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem)"; - -PROCEDURE Delay*(ms: LONGINT); -VAR s, ns: LONGINT; -BEGIN - s := ms DIV 1000; - ns := (ms MOD 1000) * 1000000; - nanosleep(s, ns); -END Delay; - - - - -(* System call *) - -PROCEDURE -system(str: ARRAY OF CHAR): INTEGER "system((char*)str)"; -PROCEDURE -err(): INTEGER "errno"; - - -PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; -BEGIN RETURN system(cmd); END System; - -PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; - - - - -(* File system *) - -(* Note: Consider also using flags O_SYNC and O_DIRECT as we do buffering *) -PROCEDURE -openrw (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDWR)"; -PROCEDURE -openro (n: ARRAY OF CHAR): INTEGER "open((char*)n, O_RDONLY)"; -PROCEDURE -opennew(n: ARRAY OF CHAR): INTEGER "open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)"; - -(* File APIs *) - -PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := openro(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRO; - -PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := openrw(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRW; - -PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: INTEGER; -BEGIN - fd := opennew(n); - IF (fd < 0) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END New; - - - -PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; - -PROCEDURE Close*(h: FileHandle): ErrorCode; -BEGIN - IF closefile(h) < 0 THEN RETURN err() ELSE RETURN 0 END -END Close; - - - -PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; -PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; -PROCEDURE -structstats "struct stat s"; -PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; -PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; -PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(address)s.st_size"; - -PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; -BEGIN - structstats; - IF fstat(h) < 0 THEN RETURN err() END; - identity.volume := statdev(); - identity.index := statino(); - identity.mtime := statmtime(); - RETURN 0 -END Identify; - -PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; -BEGIN - structstats; - IF stat(n) < 0 THEN RETURN err() END; - identity.volume := statdev(); - identity.index := statino(); - identity.mtime := statmtime(); - RETURN 0 -END IdentifyByName; - - -PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.index = i2.index) & (i1.volume = i2.volume) -END SameFile; - -PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN i1.mtime = i2.mtime -END SameFileTime; - -PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); -BEGIN target.mtime := source.mtime; -END SetMTime; - -PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); -BEGIN - sectotm(i.mtime); - YMDHMStoClock(tmyear(), tmmon(), tmmday(), tmhour(), tmmin(), tmsec(), t, d); -END MTimeAsClock; - - -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; -BEGIN - structstats; - IF fstat(h) < 0 THEN RETURN err() END; - l := statsize(); - RETURN 0; -END Size; - - - -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"(LONGINT)read(fd, (void*)(address)(p), l)"; - -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; -BEGIN - n := readfile(h, p, l); - IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END -END Read; - -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; -BEGIN - n := readfile(h, SYSTEM.ADR(b), LEN(b)); - IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END -END ReadBuf; - - - -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS -"write(fd, (void*)(address)(p), l)"; - -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; - VAR written: SYSTEM.ADDRESS; -BEGIN - written := writefile(h, p, l); - IF written < 0 THEN RETURN err() ELSE RETURN 0 END -END Write; - - - -PROCEDURE -fsync(fd: LONGINT): INTEGER "fsync(fd)"; - -PROCEDURE Sync*(h: FileHandle): ErrorCode; -BEGIN - IF fsync(h) < 0 THEN RETURN err() ELSE RETURN 0 END -END Sync; - - - -PROCEDURE -lseek(fd: LONGINT; o: LONGINT; w: INTEGER): INTEGER "lseek(fd, o, w)"; -PROCEDURE -seekset(): INTEGER "SEEK_SET"; -PROCEDURE -seekcur(): INTEGER "SEEK_CUR"; -PROCEDURE -seekend(): INTEGER "SEEK_END"; - -PROCEDURE Seek*(h: FileHandle; offset: LONGINT; whence: INTEGER): ErrorCode; -BEGIN - IF lseek(h, offset, whence) < 0 THEN RETURN err() ELSE RETURN 0 END -END Seek; - - - -PROCEDURE -ftruncate(fd: LONGINT; l: LONGINT): INTEGER "ftruncate(fd, l)"; - -PROCEDURE Truncate*(h: FileHandle; l: LONGINT): ErrorCode; -BEGIN - IF (ftruncate(h, l) < 0) THEN RETURN err() ELSE RETURN 0 END; -END Truncate; - - - -PROCEDURE -unlink(n: ARRAY OF CHAR): INTEGER "unlink((char*)n)"; - -PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF unlink(n) < 0 THEN RETURN err() ELSE RETURN 0 END -END Unlink; - - - -PROCEDURE -chdir(n: ARRAY OF CHAR): INTEGER "chdir((char*)n)"; -PROCEDURE -getcwd(VAR cwd: ARRAY OF CHAR): SYSTEM.PTR "getcwd((char*)cwd, cwd__len)"; - -PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; - VAR r: INTEGER; -BEGIN - IF (chdir(n) >= 0) & (getcwd(CWD) # NIL) THEN RETURN 0 - ELSE RETURN err() END -END Chdir; - - - -PROCEDURE -rename(o,n: ARRAY OF CHAR): INTEGER "rename((char*)o, (char*)n)"; - -PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF rename(o,n) < 0 THEN RETURN err() ELSE RETURN 0 END -END Rename; - - - - -(* Process termination *) - -PROCEDURE -exit(code: INTEGER) "exit(code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; -PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Implicit type guard in record assignment failed.") - | -7: errstring("Invalid case in WITH statement.") - | -8: errstring("Value out of range.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: LONGINT); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: LONGINT); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - - - - -PROCEDURE TestLittleEndian; - VAR i: INTEGER; - BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; - - -PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; - -BEGIN - TestLittleEndian; - - HaltCode := -128; - HaltHandler := NIL; - TimeStart := 0; TimeStart := Time(); - PID := getpid(); - IF getcwd(CWD) = NIL THEN CWD := "" END; - - SeekSet := seekset(); - SeekCur := seekcur(); - SeekEnd := seekend(); - - NL[0] := 0AX; (* LF *) - NL[1] := 0X; -END Platform. diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod deleted file mode 100644 index a538fdc5..00000000 --- a/src/system/Platformwindows.Mod +++ /dev/null @@ -1,622 +0,0 @@ -MODULE Platform; -IMPORT SYSTEM; - -(* TODO: - Use Unicode APIs with manual UTF8 conversion and prepend '\\?\' to - file paths in order to get 32768 character path length limit (as - opposed to 256 bytes. *) - - -TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); - - ErrorCode* = INTEGER; - FileHandle* = LONGINT; - - FileIdentity* = RECORD - volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) - indexhigh: LONGINT; (* inode on Unix filesystems, file id on NTFS *) - indexlow: LONGINT; - mtimehigh: LONGINT; (* File modification time, value is system dependent *) - mtimelow: LONGINT; (* File modification time, value is system dependent *) - END; - - EnvPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgPtr = POINTER TO ARRAY 1024 OF CHAR; - ArgVec = POINTER TO ARRAY 1024 OF ArgPtr; - ArgVecPtr = POINTER TO ARRAY 1 OF SYSTEM.ADDRESS; - - -VAR - LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; - PID-: INTEGER; (* Note: Must be updated by Fork implementation *) - CWD-: ARRAY 4096 OF CHAR; - ArgCount-: INTEGER; - - ArgVector-: SYSTEM.ADDRESS; - HaltHandler: HaltProcedure; - TimeStart: LONGINT; - - SeekSet-: INTEGER; - SeekCur-: INTEGER; - SeekEnd-: INTEGER; - - StdIn-: FileHandle; - StdOut-: FileHandle; - StdErr-: FileHandle; - - InterruptHandler: SignalHandler; - - nl-: ARRAY 3 OF CHAR; (* Platform specific newline representation *) - - - -PROCEDURE -AincludeWindowsWrapper '#include "WindowsWrapper.h"'; - - -(* Error code tests *) - -PROCEDURE -ERRORTOOMANYOPENFILES(): ErrorCode 'ERROR_TOO_MANY_OPEN_FILES'; -PROCEDURE -ERRORPATHNOTFOUND(): ErrorCode 'ERROR_PATH_NOT_FOUND'; -PROCEDURE -ERRORFILENOTFOUND(): ErrorCode 'ERROR_FILE_NOT_FOUND'; -PROCEDURE -ERRORNOTSAMEDEVICE(): ErrorCode 'ERROR_NOT_SAME_DEVICE'; -PROCEDURE -ERRORACCESSDENIED(): ErrorCode 'ERROR_ACCESS_DENIED'; -PROCEDURE -ERRORWRITEPROTECT(): ErrorCode 'ERROR_WRITE_PROTECT'; -PROCEDURE -ERRORSHARINGVIOLATION(): ErrorCode 'ERROR_SHARING_VIOLATION'; -PROCEDURE -ERRORNOTREADY(): ErrorCode 'ERROR_NOT_READY'; -PROCEDURE -ETIMEDOUT(): ErrorCode 'WSAETIMEDOUT'; -PROCEDURE -ECONNREFUSED(): ErrorCode 'WSAECONNREFUSED'; -PROCEDURE -ECONNABORTED(): ErrorCode 'WSAECONNABORTED'; -PROCEDURE -ENETUNREACH(): ErrorCode 'WSAENETUNREACH'; -PROCEDURE -EHOSTUNREACH(): ErrorCode 'WSAEHOSTUNREACH'; -PROCEDURE -EINTR(): ErrorCode 'WSAEINTR'; - - - -PROCEDURE TooManyFiles*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORTOOMANYOPENFILES() END TooManyFiles; - -PROCEDURE NoSuchDirectory*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORPATHNOTFOUND() END NoSuchDirectory; - -PROCEDURE DifferentFilesystems*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = ERRORNOTSAMEDEVICE() END DifferentFilesystems; - -PROCEDURE Inaccessible*(e: ErrorCode): BOOLEAN; -BEGIN - RETURN (e = ERRORACCESSDENIED()) OR (e = ERRORWRITEPROTECT()) - OR (e = ERRORNOTREADY()) OR (e = ERRORSHARINGVIOLATION()); -END Inaccessible; - -PROCEDURE Absent*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ERRORFILENOTFOUND()) OR (e = ERRORPATHNOTFOUND()) END Absent; - -PROCEDURE TimedOut*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ETIMEDOUT()) END TimedOut; - -PROCEDURE ConnectionFailed*(e: ErrorCode): BOOLEAN; -BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) - OR (e = ENETUNREACH()) OR (e = EHOSTUNREACH()) END ConnectionFailed; - -PROCEDURE Interrupted*(e: ErrorCode): BOOLEAN; -BEGIN RETURN e = EINTR() END Interrupted; - - - -(* OS memory allocaton *) - -PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; - -PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; - - - - -(* Program startup *) - -PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; -PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; - -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); -VAR av: ArgVecPtr; -BEGIN - MainStackFrame := argvadr; - ArgCount := argc; - av := SYSTEM.VAL(ArgVecPtr, argvadr); - ArgVector := av[0]; - HaltCode := -128; - - (* This function (Platform.Init) is called at program startup BEFORE any - modules have been initalised. In turn we must initialise the heap - before module startup (xxx__init) code is run. *) - HeapInitHeap(); -END Init; - - - - -(* Program arguments and environmet access *) - -PROCEDURE -getenv(name: ARRAY OF CHAR; VAR buf: ARRAY OF CHAR): INTEGER -"(INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len)"; - -PROCEDURE getEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR): BOOLEAN; - VAR - buf: ARRAY 4096 OF CHAR; - res: INTEGER; -BEGIN - res := getenv(var, buf); - IF (res > 0) & (res < LEN(buf)) THEN - COPY(buf, val); - RETURN TRUE; - ELSE - RETURN FALSE; - END; -END getEnv; - -PROCEDURE GetEnv*(var: ARRAY OF CHAR; VAR val: ARRAY OF CHAR); -BEGIN - IF ~getEnv(var, val) THEN val[0] := 0X END; -END GetEnv; - -PROCEDURE GetArg*(n: INTEGER; VAR val: ARRAY OF CHAR); - VAR av: ArgVec; -BEGIN - IF n < ArgCount THEN - av := SYSTEM.VAL(ArgVec,ArgVector); - COPY(av[n]^, val) - END -END GetArg; - -PROCEDURE GetIntArg*(n: INTEGER; VAR val: LONGINT); - VAR s: ARRAY 64 OF CHAR; k, d, i: LONGINT; -BEGIN - s := ""; GetArg(n, s); i := 0; - IF s[0] = "-" THEN i := 1 END ; - k := 0; d := ORD(s[i]) - ORD("0"); - WHILE (d >= 0 ) & (d <= 9) DO k := k*10 + d; INC(i); d := ORD(s[i]) - ORD("0") END ; - IF s[0] = "-" THEN k := -k; DEC(i) END ; - IF i > 0 THEN val := k END -END GetIntArg; - -PROCEDURE ArgPos*(s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; arg: ARRAY 256 OF CHAR; -BEGIN - i := 0; GetArg(i, arg); - WHILE (i < ArgCount) & (s # arg) DO INC(i); GetArg(i, arg) END ; - RETURN i -END ArgPos; - - - - - -(* Signals and traps *) - -(* PROCEDURE -signal(sig: LONGINT; func: SignalHandler) "signal(sig, func)"; *) - -(* TODO *) - -(* Ctrl/c handling *) - -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; - -PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); -BEGIN (* TODO *) END SetBadInstructionHandler; - - - - -(* Time of day *) - -PROCEDURE -getLocalTime "SYSTEMTIME st; GetLocalTime(&st)"; -PROCEDURE -stmsec(): INTEGER "(INTEGER)st.wMilliseconds"; -PROCEDURE -stsec(): INTEGER "(INTEGER)st.wSecond"; -PROCEDURE -stmin(): INTEGER "(INTEGER)st.wMinute"; -PROCEDURE -sthour(): INTEGER "(INTEGER)st.wHour"; -PROCEDURE -stmday(): INTEGER "(INTEGER)st.wDay"; -PROCEDURE -stmon(): INTEGER "(INTEGER)st.wMonth"; -PROCEDURE -styear(): INTEGER "(INTEGER)st.wYear"; - -PROCEDURE YMDHMStoClock(ye,mo,da,ho,mi,se: INTEGER; VAR t, d: LONGINT); -BEGIN - d := ASH(ye MOD 100, 9) + ASH(mo+1, 5) + da; - t := ASH(ho, 12) + ASH(mi, 6) + se; -END YMDHMStoClock; - -PROCEDURE GetClock*(VAR t, d: LONGINT); -BEGIN - getLocalTime; - YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); -END GetClock; - -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; - -PROCEDURE Time*(): LONGINT; -VAR ms: LONGINT; -BEGIN - ms := GetTickCount(); - RETURN (ms - TimeStart) MOD 7FFFFFFFH; -END Time; - - -PROCEDURE -sleep(ms: LONGINT) "Sleep((DWORD)ms)"; - -PROCEDURE Delay*(ms: LONGINT); -BEGIN - WHILE ms > 30000 DO sleep(30000); ms := ms-30000 END; - IF ms > 0 THEN sleep(ms) END; -END Delay; - - -PROCEDURE -stToFt "FILETIME ft; SystemTimeToFileTime(&st, &ft)"; -PROCEDURE -ftToUli "ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime"; -PROCEDURE -tous1970 "ul.QuadPart = (ul.QuadPart - 116444736000000000ULL)/10LL"; -PROCEDURE -ulSec(): LONGINT "(LONGINT)(ul.QuadPart / 1000000LL)"; -PROCEDURE -uluSec(): LONGINT "(LONGINT)(ul.QuadPart % 1000000LL)"; - -PROCEDURE GetTimeOfDay*(VAR sec, usec: LONGINT); -BEGIN - getLocalTime; stToFt; ftToUli; tous1970; - sec := ulSec(); usec := uluSec(); -END GetTimeOfDay; - - - -(* System call *) - -PROCEDURE -startupInfo "STARTUPINFO si = {0}; si.cb = sizeof(si);"; -PROCEDURE -processInfo "PROCESS_INFORMATION pi = {0};"; -PROCEDURE -createProcess(str: ARRAY OF CHAR): INTEGER "(INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi)"; -PROCEDURE -waitForProcess(): INTEGER "(INTEGER)WaitForSingleObject(pi.hProcess, INFINITE)"; -PROCEDURE -getExitCodeProcess(VAR exitcode: INTEGER) "GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode);"; -PROCEDURE -cleanupProcess "CloseHandle(pi.hProcess); CloseHandle(pi.hThread);"; -PROCEDURE -err(): INTEGER "(INTEGER)GetLastError()"; - -PROCEDURE System*(cmd : ARRAY OF CHAR): INTEGER; -VAR - result: INTEGER; -BEGIN - result := 127; - startupInfo; processInfo; - IF createProcess(cmd) # 0 THEN - IF waitForProcess() = 0 THEN getExitCodeProcess(result) END; - cleanupProcess; - END; - RETURN result * 256; -END System; - -PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; - - -(* File system *) - -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; - -PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; - -PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; - -PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; - - - - -(* File APIs *) - -PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := openro(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRO; - -PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := openrw(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END OldRW; - -PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; -BEGIN - fd := opennew(n); - IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; -END New; - - - -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; - -PROCEDURE Close*(h: FileHandle): ErrorCode; -BEGIN - IF closeHandle(h) = 0 THEN RETURN err() ELSE RETURN 0 END -END Close; - - - -PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; -PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; -PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; -PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; -PROCEDURE -bhfiIndexHigh(): LONGINT "(LONGINT)bhfi.nFileIndexHigh"; -PROCEDURE -bhfiIndexLow(): LONGINT "(LONGINT)bhfi.nFileIndexLow"; - - -PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; -BEGIN - byHandleFileInformation; - IF getFileInformationByHandle(h) = 0 THEN RETURN err() END; - identity.volume := bhfiVsn(); - identity.indexhigh := bhfiIndexHigh(); - identity.indexlow := bhfiIndexLow(); - identity.mtimehigh := bhfiMtimeHigh(); - identity.mtimelow := bhfiMtimeLow(); - RETURN 0 -END Identify; - -PROCEDURE IdentifyByName*(n: ARRAY OF CHAR; VAR identity: FileIdentity): ErrorCode; -VAR - h: FileHandle; - e,i: ErrorCode; -BEGIN - e := OldRO(n, h); - IF e # 0 THEN RETURN e END; - e := Identify(h, identity); - i := Close(h); - RETURN e; -END IdentifyByName; - - -PROCEDURE SameFile*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.indexhigh = i2.indexhigh) & (i1.indexlow = i2.indexlow) & (i1.volume = i2.volume) -END SameFile; - -PROCEDURE SameFileTime*(i1, i2: FileIdentity): BOOLEAN; -BEGIN RETURN (i1.mtimehigh = i2.mtimehigh) & (i1.mtimelow = i2.mtimelow) -END SameFileTime; - -PROCEDURE SetMTime*(VAR target: FileIdentity; source: FileIdentity); -BEGIN target.mtimehigh := source.mtimehigh; target.mtimelow := source.mtimelow; -END SetMTime; - -PROCEDURE -identityToFileTime(i: FileIdentity) -"FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow"; - -PROCEDURE -fileTimeToSysTime -"SYSTEMTIME st; FileTimeToSystemTime(&ft, &st)"; - -PROCEDURE MTimeAsClock*(i: FileIdentity; VAR t, d: LONGINT); -BEGIN - identityToFileTime(i); fileTimeToSysTime; - YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); -END MTimeAsClock; - -PROCEDURE -largeInteger "LARGE_INTEGER li"; -PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; - -PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; -BEGIN - largeInteger; - IF getFileSize(h) = 0 THEN RETURN err() END; - l := liLongint(); - RETURN 0; -END Size; - - -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; - -PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; -VAR result: INTEGER; lengthread: SYSTEM.INT32; -BEGIN - result := readfile(h, p, l, lengthread); - IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END -END Read; - -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; -VAR result: INTEGER; lengthread: SYSTEM.INT32; -BEGIN - result := readfile(h, SYSTEM.ADR(b), LEN(b), lengthread); - IF result = 0 THEN n := 0; RETURN err() ELSE n := lengthread; RETURN 0 END -END ReadBuf; - - - -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; - -PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; -BEGIN - IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END -END Write; - - - -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; - -PROCEDURE Sync*(h: FileHandle): ErrorCode; -BEGIN - IF flushFileBuffers(h) = 0 THEN RETURN err() ELSE RETURN 0 END -END Sync; - - - -PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; - -PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; -PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; -PROCEDURE -seekend(): INTEGER "FILE_END"; - -PROCEDURE Seek*(h: FileHandle; o: LONGINT; r: INTEGER): ErrorCode; -VAR rc: INTEGER; -BEGIN - largeInteger; - setFilePointerEx(h, o, r, rc); - IF rc = 0 THEN RETURN err() ELSE RETURN 0 END -END Seek; - - - -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; -PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; - -PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; -VAR rc: INTEGER; oldpos: LONGINT; -BEGIN - largeInteger; - getFilePos(h, oldpos, rc); - IF rc = 0 THEN RETURN err() END; - setFilePointerEx(h, limit, seekset(), rc); - IF rc = 0 THEN RETURN err() END; - IF setEndOfFile(h) = 0 THEN RETURN err() END; - setFilePointerEx(h, oldpos, seekset(), rc); (* Restore original file position *) - IF rc = 0 THEN RETURN err() END; - RETURN 0; -END Truncate; - - - -PROCEDURE -deleteFile(n: ARRAY OF CHAR): INTEGER "(INTEGER)DeleteFile((char*)n)"; - -PROCEDURE Unlink*(VAR n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF deleteFile(n) = 0 THEN RETURN err() ELSE RETURN 0 END -END Unlink; - - -PROCEDURE -setCurrentDirectory(n: ARRAY OF CHAR): INTEGER "(INTEGER)SetCurrentDirectory((char*)n)"; -PROCEDURE -getCurrentDirectory(VAR n: ARRAY OF CHAR) "GetCurrentDirectory(n__len, (char*)n)"; - -PROCEDURE Chdir*(VAR n: ARRAY OF CHAR): ErrorCode; - VAR r: INTEGER; -BEGIN - r := setCurrentDirectory(n); - IF r = 0 THEN RETURN err() END; - getCurrentDirectory(CWD); - RETURN 0; -END Chdir; - - - -PROCEDURE -moveFile(o,n: ARRAY OF CHAR): INTEGER -"(INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING)"; - -PROCEDURE Rename*(VAR o,n: ARRAY OF CHAR): ErrorCode; -BEGIN - IF moveFile(o,n) = 0 THEN RETURN err() ELSE RETURN 0 END -END Rename; - - - - -(* Process termination *) - -PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Type equality failed.") - | -7: errstring("WITH statement type guard failed.") - | -8: errstring("SHORT: Value too large for shorter type.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: LONGINT); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: LONGINT); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - - - -PROCEDURE TestLittleEndian; - VAR i: INTEGER; - BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; - - -PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; -PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; - -BEGIN - TestLittleEndian; - - HaltCode := -128; - HaltHandler := NIL; - TimeStart := 0; TimeStart := Time(); - CWD := ""; getCurrentDirectory(CWD); - PID := getpid(); - - SeekSet := seekset(); - SeekCur := seekcur(); - SeekEnd := seekend(); - - StdIn := getstdinhandle(); - StdOut := getstdouthandle(); - StdErr := getstderrhandle(); - - nl[0] := 0DX; (* CR *) - nl[1] := 0AX; (* LF *) - nl[2] := 0X; -END Platform. diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index b017c028..3ae3dd5b 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,7 +1,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Console, Platform, SYSTEM; + OPM, OPS, OPT, OPV, Texts, Out, Platform, SYSTEM; CONST @@ -257,12 +257,12 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, T); OPT.Close; Texts.OpenReader(R, T, 0); Texts.Read(R, ch); i := 0; WHILE ~R.eot DO - IF ch = 0DX THEN s[i] := 0X; i := 0; Console.String(s); Console.Ln + IF ch = 0DX THEN s[i] := 0X; i := 0; Out.String(s); Out.Ln ELSE s[i] := ch; INC(i) END ; Texts.Read(R, ch) END ; - s[i] := 0X; Console.String(s) + s[i] := 0X; Out.String(s) END END ShowDef; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6d2a9c24..d4abd1e3 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -60,17 +60,17 @@ assemble: @printf " DATAMODEL: %s\n" "$(DATAMODEL)" cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c - cd $(BUILDDIR) && $(COMPILE) -c Console.c Strings.c Modules.c Files.c + cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Console.o Strings.o Modules.o Files.o \ + SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o - cp src/system/*.[ch] $(BUILDDIR) + cp src/runtime/*.[ch] $(BUILDDIR) @printf "$(OBECOMP) created.\n" @@ -102,15 +102,15 @@ translate: @rm -f $(BUILDDIR)/*.sym cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/system/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/v4/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/library/misc/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/vt100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod @@ -131,7 +131,7 @@ browsercmd: @printf "\nMaking symbol browser\n" @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ - Platform.o Texts.o OPT.o Heap.o Console.o SYSTEM.o OPM.o OPS.o OPV.o \ + Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ OPC.o @@ -191,7 +191,7 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" mkdir -p $(BUILDDIR)/$(MODEL) - cp src/system/*.[ch] $(BUILDDIR)/$(MODEL) + cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod @@ -215,6 +215,7 @@ runtime: v4: @printf "\nMaking v4 library\n" cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Console.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod @@ -334,7 +335,7 @@ pow32: misc: @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/system/Oberon.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/runtime/Oberon.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod From fcb51a6c23cc62d5b8b647b42d93533cffd83805 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 1 Oct 2016 17:58:16 +0100 Subject: [PATCH 072/140] Fix Platform.Write on 32 bit builds. --- src/runtime/Platformunix.Mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 034906bd..3db3f2d7 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -389,7 +389,7 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS "write(fd, (void*)(address)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; From 80c9d36a7a536bd8c8f70143e3b4c33d5612459b Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 3 Oct 2016 20:05:22 +0100 Subject: [PATCH 073/140] (Largely untested) Oakwood Math.Mod, some SETxx fixes. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 4 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 55 +-- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 4 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 55 +-- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 4 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 55 +-- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 4 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 55 +-- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 4 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 55 +-- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 1 + src/compiler/OPV.Mod | 28 +- src/runtime/LowReal.Mod | 417 ----------------- src/runtime/Math.Mod | 640 +++++++++++++++++---------- src/tools/make/oberon.mk | 6 +- 200 files changed, 780 insertions(+), 987 deletions(-) delete mode 100644 src/runtime/LowReal.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 25192376..5ccc86c7 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1a38cc40..4df07327 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 66d53030..3e713505 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index addd94c0..16672654 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 18008f62..d4fe9c38 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ac457f52..9b65a9b8 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 80ab5a77..bf82f949 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 25192376..5ccc86c7 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1a38cc40..4df07327 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a23ac389..bd0b6935 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index addd94c0..16672654 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 18008f62..d4fe9c38 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 8fd544dc..f656fcc8 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 3d119274..6feea28a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 010c9d80..980cd0fc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 87c48fa5..fefffb47 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6ab9f1ca..2dd37317 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b183ffa4..dc9db0d8 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index dab15898..57b8190a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 732baf46..bc0b1d98 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index bf1c6c9b..643f8fc5 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 186ab7e3..a8d1a2b2 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f566e592..5004eab0 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a99d3410..c278b7af 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index b648dbcc..f677d8cf 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c74c7031..14ebab63 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 369dceed..97cfe790 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 8c6bf3f2..695d46a5 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 4e669b75..afea83b3 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3d4b568e..d797cd7d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 9c9c2846..ed20badb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index d4afd6fe..15cedcc4 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 9cfee5c9..352866db 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 1ab50cf6..c2760a09 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3a1bf6f6..f691a0ee 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a23ac389..bd0b6935 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ba7bab5f..ab191652 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 60051d13..f08085ef 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f3eea094..7b5e8a8c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index a07ae09d..e0dfb26e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 8fd544dc..f656fcc8 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 3d119274..6feea28a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index a3cc57ea..5eeecbcd 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 32d0b51f..8d939331 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index db2b8c32..29896228 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7dda2f04..a2df0b07 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 82031060..85708a3f 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6ab9f1ca..2dd37317 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b183ffa4..dc9db0d8 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index dab15898..57b8190a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 4e105135..c6f0ec55 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ef3ea081..80807ca6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -1273,6 +1273,8 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) case 7: if ((g == 7 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); + } else if (g == 7) { + OPB_Convert(&z, y->typ); } else { OPB_err(100); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 54e81677..7917b570 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 6739a87e..fad4716b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 32ec3b7f..6d64b896 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 732baf46..bc0b1d98 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 960bd0ba..b798756b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index bf1c6c9b..643f8fc5 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 8b28d78e..b466e3aa 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 882c9331..bd835f8d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 62dc025a..af7eca8a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 186ab7e3..a8d1a2b2 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6f17b409..5fe4dd5c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f566e592..5004eab0 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -41,7 +41,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x); static void OPV_ParIntLiteral (int64 n, int32 size); static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (int32 from, int32 to); +static void OPV_SizeCast (OPT_Node n, int32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); @@ -380,12 +380,24 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (int32 from, int32 to) +static void OPV_SizeCast (OPT_Node n, int32 to) { - if ((from != to && (from > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); - OPM_WriteInt(__ASHL(to, 3)); - OPM_WriteString((CHAR*)")", 2); + if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { + OPM_WriteString((CHAR*)"__SHORT", 8); + if (OPV_SideEffects(n)) { + OPM_Write('F'); + } + OPM_Write('('); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)", ", 3); + OPM_WriteInt(OPM_SignedMaximum(to) + 1); + OPM_Write(')'); + } else { + if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { + OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteInt(__ASHL(to, 3)); + OPM_WriteString((CHAR*)")", 2); + } } } @@ -395,26 +407,19 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) from = n->typ->form; to = newtype->form; if (to == 7) { - OPM_WriteString((CHAR*)"__SETOF(", 9); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)",", 2); - OPM_WriteInt(__ASHL(newtype->size, 3)); - OPM_Write(')'); - } else if (to == 4) { - if ((newtype->size < n->typ->size && __IN(2, OPM_Options, 32))) { - OPM_WriteString((CHAR*)"__SHORT", 8); - if (OPV_SideEffects(n)) { - OPM_Write('F'); - } - OPM_Write('('); - OPV_Entier(n, -1); - OPM_WriteString((CHAR*)", ", 3); - OPM_WriteInt(OPM_SignedMaximum(newtype->size) + 1); - OPM_Write(')'); - } else { - OPV_SizeCast(n->typ->size, newtype->size); + if (from == 7) { + OPV_SizeCast(n, newtype->size); OPV_Entier(n, 9); + } else { + OPM_WriteString((CHAR*)"__SETOF(", 9); + OPV_Entier(n, -1); + OPM_WriteString((CHAR*)",", 2); + OPM_WriteInt(__ASHL(newtype->size, 3)); + OPM_Write(')'); } + } else if (to == 4) { + OPV_SizeCast(n, newtype->size); + OPV_Entier(n, 9); } else if (to == 3) { if (__IN(2, OPM_Options, 32)) { OPM_WriteString((CHAR*)"__CHR", 6); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 30c2c7e7..49c91eed 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 60051d13..f08085ef 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 6717f71b..72b7e0cb 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index efcb7845..8f725aaa 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 2e13990f..070acb18 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f173fc32..97923f8d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 98443ee2..24d6197a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index accc2e6a..afd5e004 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 9ebac10a..ce00b00c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 369dceed..97cfe790 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 8c6bf3f2..695d46a5 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b071c3a8..d35766eb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 1560dc0d..6adfb219 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index f6b467bb..5f5a39b3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ab7785db..57da5b24 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 23b25f53..61383b15 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 95c8d77e..511c4d6b 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/01]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index a6b8cf67..5cdad662 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -678,6 +678,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(100) END |OPT.Set: IF (g = OPT.Set) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF (g = OPT.Set) THEN Convert(z, y.typ) ELSE err(100) END |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 0d29d56d..dd089baf 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -232,10 +232,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END END Entier; - PROCEDURE SizeCast(from, to: LONGINT); + PROCEDURE SizeCast(n: OPT.Node; to: LONGINT); BEGIN - IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + IF (to < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN + OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; + OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); + OPM.WriteInt(OPM.SignedMaximum(to) + 1); OPM.Write(CloseParen) + ELSE + IF (n.typ.size # to) & ((n.typ.size > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN + OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + END END END SizeCast; @@ -243,16 +249,14 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN - OPM.WriteString("__SETOF("); Entier(n, MinPrec); - OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) - ELSIF to = OPT.Int THEN - IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.Options) THEN - OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; - OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); - OPM.WriteInt(OPM.SignedMaximum(newtype.size) + 1); OPM.Write(CloseParen) - ELSE - SizeCast(n.typ.size, newtype.size); Entier(n, 9) + IF from = OPT.Set THEN (* Sets of different size *) + SizeCast(n, newtype.size); Entier(n, 9) + ELSE (* Set from integer *) + OPM.WriteString("__SETOF("); Entier(n, MinPrec); + OPM.WriteString(","); OPM.WriteInt(newtype.size*8); OPM.Write(CloseParen) END + ELSIF to = OPT.Int THEN (* integers of different size *) + SizeCast(n, newtype.size); Entier(n, 9) ELSIF to = OPT.Char THEN IF OPM.ranchk IN OPM.Options THEN OPM.WriteString("__CHR"); IF SideEffects(n) THEN OPM.Write("F") END ; diff --git a/src/runtime/LowReal.Mod b/src/runtime/LowReal.Mod deleted file mode 100644 index e5a8f8a6..00000000 --- a/src/runtime/LowReal.Mod +++ /dev/null @@ -1,417 +0,0 @@ -(* $Id: LowReal.Mod,v 1.5 1999/09/02 13:17:38 acken Exp $ *) -MODULE LowReal; - -(* - LowReal - Gives access to the underlying properties of the type REAL - for IEEE single-precision numbers. - Copyright (C) 1995 Michael Griebling - - This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*) - - -IMPORT SYSTEM; - -(* - - Real number properties are defined as follows: - - radix--The whole number value of the radix used to represent the - corresponding read number values. - - places--The whole number value of the number of radix places used - to store values of the corresponding real number type. - - expoMin--The whole number value of the exponent minimum. - - expoMax--The whole number value of the exponent maximum. - - large--The largest value of the corresponding real number type. - - small--The smallest positive value of the corresponding real number - type, represented to maximal precision. - - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 - (IEEE 754:1987) in all regards. - - NOTES - 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 - is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 - is used for the type REAL. - - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and - notification. - - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number - type nearest to the mathematical result. - - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. - - exception--A Boolean value that is TRUE if and only if every operation that - attempts to produce a real value out of range raises an exception. - - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than - the stored values. - - nModes--The whole number value giving the number of bit positions needed for - the status flags for mode control. - -*) -CONST - radix* = 2; - places* = 24; - expoMax* = 127; - expoMin* = 1-expoMax; - large* = MAX(REAL); (*3.40282347E+38;*) - (*small* = 1.17549435E-38; (* 2^(-126) *)*) - small* = 1/8.50705917E37; (* don't know better way; -- noch *) - IEC559* = TRUE; - LIA1* = FALSE; - rounds* = FALSE; - gUnderflow* = TRUE; (* there are IEEE numbers smaller than `small' *) - exception* = FALSE; (* at least in the default implementation *) - extend* = FALSE; - nModes* = 0; - - TEN = 10.0; (* some commonly-used constants *) - ONE = 1.0; - ZERO = 0.0; - - expOffset = expoMax; - (*hiBit = 22;*) - (*expBit = hiBit+1;*) - nMask = {0..22,31}; (* number mask *) - expMask = {23..30}; (* exponent mask *) - -TYPE - Modes* = SET; - -VAR - (*small* : REAL; tmp: REAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - ErrorHandler*: PROCEDURE (errno : INTEGER); - err-: INTEGER; - -(* Error handler default stub which can be replaced *) - -PROCEDURE DefaultHandler (errno : INTEGER); -BEGIN - err:=errno -END DefaultHandler; - -PROCEDURE ClearError*; -BEGIN - err:=0 -END ClearError; - - -PROCEDURE exponent*(x: REAL): INTEGER; -(* - The value of the call exponent(x) shall be the exponent value of `x' - that lies between `expoMin' and `expoMax'. An exception shall occur - and may be raised if `x' is equal to 0.0. - *) - VAR w: SYSTEM.INT16; -BEGIN - (* NOTE: x=0.0 should raise exception *) - IF x = ZERO THEN RETURN 0 END; - - RETURN SYSTEM.VAL(INTEGER, SYSTEM.LSH((SYSTEM.VAL(SYSTEM.SET32, x) * expMask), -23)); - - - SYSTEM.GET(SYSTEM.ADR(x)+2, w); (* Load most significant word *) - RETURN ((w DIV 128) MOD 256) - expOffset -END exponent; - -PROCEDURE SetExponent(VAR x: REAL; ex: SYSTEM.INT32); - VAR s: SYSTEM.SET32; -BEGIN - ex := SYSTEM.LSH(ex + expOffset, 23); - s := SYSTEM.VAL(SYSTEM.SET32, s) * nMask + SYSTEM.VAL(SYSTEM.SET32, ex) * expMask; - SYSTEM.PUT(SYSTEM.ADR(x), s) -END SetExponent; - -PROCEDURE exponent10*(x: REAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is - equal to 0.0. - *) -VAR exp: INTEGER; -BEGIN - exp := 0; x := ABS(x); - IF x = ZERO THEN RETURN exp END; (* exception could be raised here *) - WHILE x >= TEN DO x := x/TEN; INC(exp) END; - WHILE (x > ZERO) & (x < 1.0) DO x := x*TEN; DEC(exp) END; - RETURN exp -END exponent10; - -(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) - -PROCEDURE fraction*(x: REAL): REAL; -(* - The value of the call fraction(x) shall be the significand (or - significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). -*) -VAR c: CHAR; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE - (* Set top 7 bits of exponent to 0111111 *) - SYSTEM.GET(SYSTEM.ADR(x)+3, c); - c := CHR(((ORD(c) DIV 128) * 128) + 63); (* Set X0111111 (X unchanged) *) - SYSTEM.PUT(SYSTEM.ADR(x)+3, c); - (* Set bottom bit of exponent to 0 *) - SYSTEM.GET(SYSTEM.ADR(x)+2, c); - c := CHR(ORD(c) MOD 128); (* Set 0XXXXXXX (X unchanged) *) - SYSTEM.PUT(SYSTEM.ADR(x)+2, c); - RETURN x * 2.0; - END -(* - CONST eZero={(hiBit+2)..29}; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE RETURN SYSTEM.VAL(REAL,(SYSTEM.VAL(SET,x)*nMask)+eZero)*2.0 (* set the mantissa's exponent to zero *) - END -*) -END fraction; - -PROCEDURE IsInfinity * (real: REAL) : BOOLEAN; - VAR c0, c1, c2, c3: CHAR; -BEGIN - SYSTEM.GET(SYSTEM.ADR(real)+0, c3); - SYSTEM.GET(SYSTEM.ADR(real)+1, c2); - SYSTEM.GET(SYSTEM.ADR(real)+2, c1); - SYSTEM.GET(SYSTEM.ADR(real)+3, c0); - RETURN (ORD(c0) MOD 128 = 127) & (ORD(c1) = 128) & (ORD(c2) = 0) & (ORD(c3) = 0) -END IsInfinity; - -PROCEDURE IsNaN * (real: REAL) : BOOLEAN; - VAR c0, c1, c2, c3: CHAR; -BEGIN - SYSTEM.GET(SYSTEM.ADR(real)+0, c3); - SYSTEM.GET(SYSTEM.ADR(real)+1, c2); - SYSTEM.GET(SYSTEM.ADR(real)+2, c1); - SYSTEM.GET(SYSTEM.ADR(real)+3, c0); - RETURN (ORD(c0) MOD 128 = 127) - & (ORD(c1) DIV 128 = 1) - & ((ORD(c1) MOD 128 # 0) OR (ORD(c2) # 0) OR (ORD(c3) # 0)) -END IsNaN; - -PROCEDURE sign*(x: REAL): REAL; -(* - The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, - or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. -*) -BEGIN - IF x expoMax THEN RETURN large * sign(x) (* exception raised here *) - ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) - END; - SetExponent(x, SHORT(exp)); - (* SetExponent replaces these 2 lines: - lexp := SYSTEM.VAL(SET, SYSTEM.LSH(exp + expOffset, expBit)); (* shifted exponent bits *) - RETURN SYSTEM.VAL(REAL, (SYSTEM.VAL(SET, x) * nMask) + lexp) (* insert new exponent *) - *) -END scale; - -PROCEDURE ulp*(x: REAL): REAL; -(* - The value of the call ulp(x) shall be the value of the corresponding - real number type equal to a unit in the last place of `x', if such a - value exists; otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN scale(ONE, exponent(x)-places+1) -END ulp; - -PROCEDURE succ*(x: REAL): REAL; -(* - The value of the call succ(x) shall be the next value of the - corresponding real number type greater than `x', if such a type - exists; otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN x+ulp(x)*sign(x) -END succ; - -PROCEDURE pred*(x: REAL): REAL; -(* - The value of the call pred(x) shall be the next value of the - corresponding real number type less than `x', if such a type exists; - otherwise an exception shall occur and may be raised. -*) -BEGIN - RETURN x-ulp(x)*sign(x) -END pred; - -PROCEDURE intpart*(x: REAL): REAL; -(* - The value of the call intpart(x) shall be the integral part of `x'. - For negative values, this shall be -intpart(abs(x)). -*) - VAR loBit: INTEGER; -BEGIN - loBit := (hiBit+1) - exponent(x); - IF loBit <= 0 THEN RETURN x (* no fractional part *) - ELSIF loBit <= hiBit+1 THEN - RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*{loBit..31}) (* integer part is extracted *) - ELSE RETURN ZERO (* no whole part *) - END -END intpart; - -PROCEDURE fractpart*(x: REAL): REAL; -(* - The value of the call fractpart(x) shall be the fractional part of - `x'. This satifies the relationship fractpart(x)+intpart(x)=x. -*) -BEGIN - RETURN x-intpart(x) -END fractpart; - -PROCEDURE trunc*(x: REAL; n: INTEGER): REAL; -(* - The value of the call trunc(x,n) shall be the value of the most - significant `n' places of `x'. An exception shall occur and may be - raised if `n' is less than or equal to zero. -*) - VAR loBit: INTEGER; mask: SET; -BEGIN loBit:=places-n; - IF n<=0 THEN RETURN ZERO (* exception should be raised *) - ELSIF loBit<=0 THEN RETURN x (* nothing was truncated *) - ELSE mask:={loBit..31}; (* truncation bit mask *) - RETURN SYSTEM.VAL(REAL,SYSTEM.VAL(SET,x)*mask) - END -END trunc; - -PROCEDURE round*(x: REAL; n: INTEGER): REAL; -(* - The value of the call round(x,n) shall be the value of `x' rounded to - the most significant `n' places. An exception shall occur and may be - raised if such a value does not exist, or if `n' is less than or equal - to zero. -*) - VAR loBit: INTEGER; num, mask: SET; r: REAL; -BEGIN loBit:=places-n; - IF n<=0 THEN RETURN ZERO (* exception should be raised *) - ELSIF loBit<=0 THEN RETURN x (* nothing was rounded *) - ELSE mask:={loBit..31}; num:=SYSTEM.VAL(SET,x); (* truncation bit mask and number as SET *) - x:=SYSTEM.VAL(REAL,num*mask); (* truncated result *) - IF loBit-1 IN num THEN (* check if result should be rounded *) - r:=scale(ONE,exponent(x)-n+1); (* rounding fraction *) - IF 31 IN num THEN RETURN x-r (* negative rounding toward -infinity *) - ELSE RETURN x+r (* positive rounding toward +infinity *) - END - ELSE RETURN x (* return truncated result *) - END - END -END round; - -PROCEDURE synthesize*(expart: INTEGER; frapart: REAL): REAL; -(* - The value of the call synthesize(expart,frapart) shall be a value of - the corresponding real number type contructed from the value of - `expart' and `frapart'. This value shall satisfy the relationship - synthesize(exponent(x),fraction(x)) = x. -*) -BEGIN - RETURN scale(frapart, expart) -END synthesize; - - -PROCEDURE setMode*(m: Modes); -(* - The call setMode(m) shall set status flags from the value of `m', - appropriate to the underlying implementation of the corresponding real - number type. - - NOTES - 3 -- Many implementations of floating point provide options for - setting flags within the system which control details of the handling - of the type. Although two procedures are provided, one for each real - number type, the effect may be the same. Typical effects that can be - obtained by this means are: - a) Ensuring that overflow will raise an exception; - b) Allowing underflow to raise an exception; - c) Controlling the rounding; - d) Allowing special values to be produced (e.g. NaNs in - implementations conforming to IEC 559:1989 (IEEE 754:1987)); - e) Ensuring that special valu access will raise an exception; - Since these effects are so varied, the values of type `Modes' that may - be used are not specified by this International Standard. - 4 -- The effects of `setMode' on operation on values of the - corresponding real number type in coroutines other than the calling - coroutine is not defined. Implementations are not require to preserve - the status flags (if any) with the coroutine state. -*) -BEGIN - (* hardware dependent mode setting of coprocessor *) -END setMode; - -PROCEDURE currentMode*(): Modes; -(* - The value of the call currentMode() shall be the current status flags - (in the form set by `setMode'), or the default status flags (if - `setMode' is not used). - - NOTE 5 -- The value of the call currentMode() is not necessarily the - value of set by `setMode', since a call of `setMode' might attempt to - set flags that cannot be set by the program. -*) -BEGIN - RETURN {} -END currentMode; - -PROCEDURE IsLowException*(): BOOLEAN; -(* - Returns TRUE if the current coroutine is in the exceptional execution state - because of the raising of the LowReal exception; otherwise returns FALSE. -*) -BEGIN - RETURN FALSE -END IsLowException; - -BEGIN - (* install the default error handler -- just sets err variable *) - ErrorHandler:=DefaultHandler; -(* tmp := power0(2,126); (* this is test to calculate small as a variable at runtime; -- noch *) - small := sml; - small := 1/power0(2,126); - *) -END LowReal. - - diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index 392534bd..3e8c492e 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -1,12 +1,12 @@ -(* $Id: RealMath.Mod,v 1.6 1999/09/02 13:19:17 acken Exp $ *) -MODULE oocRealMath; +MODULE Math; -(* MathL - Oakwood REAL Mathematics. - Adapted (with minimal changes) from OOC RealMath.Mod *) +IMPORT SYSTEM; -(* - RealMath - Target independent mathematical functions for REAL - (IEEE single-precision) numbers. +(* Math - Oakwood REAL Mathematics. + Adapted from OOC LowReal.Mod and RealMath.Mod + + Target independent mathematical functions for REAL + (IEEE single - precision) numbers. Numerical approximations are taken from "Software Manual for the Elementary Functions" by Cody & Waite and "Computer Approximations" @@ -26,82 +26,245 @@ MODULE oocRealMath; You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 - 1307 USA *) -IMPORT l := LowReal, S := SYSTEM; +(* + Real number properties are defined as follows: + + radix - -The whole number value of the radix used to represent the + corresponding read number values. + + places - -The whole number value of the number of radix places used + to store values of the corresponding real number type. + + expoMin - -The whole number value of the exponent minimum. + + expoMax - -The whole number value of the exponent maximum. + + large - -The largest value of the corresponding real number type. + + small - -The smallest positive value of the corresponding real number + type, represented to maximal precision. + + IEC559 - -A Boolean value that is TRUE if and only if the implementation + of the corresponding real number type conforms to IEC 559:1989 + (IEEE 754:1987) in all regards. + + NOTES + 6 -- If `IEC559' is TRUE, the value of `radix' is 2. + 7 -- If LowReal.IEC559 is TRUE, the 32 - bit format of IEC 559:1989 + is used for the type REAL. + 7 -- If LowLong.IEC559 is TRUE, the 64 - bit format of IEC 559:1989 + is used for the type REAL. + + LIA1 - -A Boolean value that is TRUE if and only if the implementation of + the corresponding real number type conforms to ISO/IEC 10967 - 1:199x + (LIA - 1) in all regards: parameters, arithmetic, exceptions, and + notification. + + rounds - -A Boolean value that is TRUE if and only if each operation produces + a result that is one of the values of the corresponding real number + type nearest to the mathematical result. + + gUnderflow - -A Boolean value that is TRUE if and only if there are values of + the corresponding real number type between 0.0 and `small'. + + exception - -A Boolean value that is TRUE if and only if every operation that + attempts to produce a real value out of range raises an exception. + + extend - -A Boolean value that is TRUE if and only if expressions of the + corresponding real number type are computed to higher precision than + the stored values. + + nModes - -The whole number value giving the number of bit positions needed for + the status flags for mode control. + *) CONST pi* = 3.1415926535897932384626433832795028841972; e* = 2.7182818284590452353602874713526624977572; - ZERO=0.0; ONE=1.0; HALF=0.5; TWO=2.0; (* local constants *) + places* = 24; + large* = MAX(REAL); (* 3.40282347E+38. Largest number this package accepts *) +(*small* = 1.17549435E-38; *) (* 2^(-126) *) + small* = 1/8.50705917E37; (* don't know better way; -- noch *) + expoMax* = 127; + expoMin* = 1-expoMax; - (* internally-used constants *) - huge = l.large; (* largest number this package accepts *) - miny = ONE/huge; (* smallest number this package accepts *) - sqrtHalf = 0.70710678118654752440; - Limit = 2.4414062E-4; (* 2**(-MantBits/2) *) - eps = 2.9802322E-8; (* 2**(-MantBits-1) *) - piInv = 0.31830988618379067154; (* 1/pi *) - piByTwo = 1.57079632679489661923132; - piByFour = 0.78539816339744830962; - lnv = 0.6931610107421875; (* should be exact *) - vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) - ln2Inv = 1.44269504088896340735992468100189213; + expOffset = expoMax; + nMask = {0..22,31}; (* number mask: Sign and mantissa *) + expMask = {23..30}; (* exponent mask: exponent value + 127 *) + + ZERO = 0.0; + HALF = 0.5; + ONE = 1.0; + TWO = 2.0; + TEN = 10.0; + miny = ONE/large; (* Smallest number thispackage accepts *) + sqrtHalf = 0.70710678118654752440; + Limit = 2.4414062E-4; (* 2 * *( - MantBits/2) *) + eps = 2.9802322E-8; (* 2 * *( - MantBits - 1) *) + piInv = 0.31830988618379067154; (* 1/pi *) + piByTwo = 1.57079632679489661923132; + piByFour = 0.78539816339744830962; + lnv = 0.6931610107421875; (* should be exact *) + vbytwo = 0.13830277879601902638E-4; (* used in sinh/cosh *) + ln2Inv = 1.44269504088896340735992468100189213; (* error/exception codes *) - NoError*=0; IllegalRoot*=1; IllegalLog*=2; Overflow*=3; IllegalPower*=4; IllegalLogBase*=5; - IllegalTrig*=6; IllegalInvTrig*=7; HypInvTrigClipped*=8; IllegalHypInvTrig*=9; - LossOfAccuracy*=10; Underflow*=11; + NoError* = 0; IllegalRoot* = 1; IllegalLog* = 2; Overflow* = 3; + IllegalPower* = 4; IllegalLogBase* = 5; IllegalTrig* = 6; IllegalInvTrig* = 7; + HypInvTrigClipped* = 8; IllegalHypInvTrig* = 9; LossOfAccuracy* = 10; Underflow* = 11; VAR + ErrorHandler*: PROCEDURE (errno : INTEGER); + err-: INTEGER; + a1: ARRAY 18 OF REAL; (* lookup table for power function *) a2: ARRAY 9 OF REAL; (* lookup table for power function *) - em: REAL; (* largest number such that 1+epsilon > 1.0 *) + em: REAL; (* largest number such that 1 + epsilon > 1.0 *) LnInfinity: REAL; (* natural log of infinity *) LnSmall: REAL; (* natural log of very small number *) SqrtInfinity: REAL; (* square root of infinity *) TanhMax: REAL; (* maximum Tanh value *) t: REAL; (* internal variables *) -(* internally used support routines *) + +PROCEDURE DefaultErrorHandler(errno : INTEGER); +BEGIN err:=errno END DefaultErrorHandler; + +PROCEDURE ClearError*; +BEGIN err:=0 END ClearError; + + +(* TYPE REAL: 1/sign, 8/exponent, 23/significand *) + +PROCEDURE fraction*(x: REAL): REAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + VAR s: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO + ELSE + s := SYSTEM.VAL(SYSTEM.SET32, x) * nMask + {24..29}; + RETURN SYSTEM.VAL(REAL, s) * 2.0; + END +END fraction; + +PROCEDURE exponent*(x: REAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. + *) +BEGIN + IF x = ZERO THEN RETURN 0 (* NOTE: x=0.0 should raise exception *) + ELSE + RETURN SHORT(SYSTEM.LSH(SYSTEM.VAL(SYSTEM.INT32, x), -23) MOD 256) - 127 + END +END exponent; + +PROCEDURE sign*(x: REAL): REAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x < ZERO THEN RETURN -ONE ELSE RETURN ONE END +END sign; + +PROCEDURE scale*(x: REAL; n: INTEGER): REAL; +(* + The value of the call scale(x,n) shall be the value x*radix^n if such + a value exists; otherwise an execption shall occur and may be raised. +*) + VAR exp: LONGINT; lexp: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO END; + exp := exponent(x) + n; (* new exponent *) + IF exp > expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + lexp := SYSTEM.VAL(SYSTEM.SET32, x) * nMask (* sign and significand *) + + SYSTEM.VAL(SYSTEM.SET32, SYSTEM.LSH(exp+expOffset, 23)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(REAL, lexp) +END scale; + +PROCEDURE ulp*(x: REAL): REAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: REAL): REAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: REAL): REAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; + PROCEDURE SinCos (x, y, sign: REAL): REAL; CONST - ymax=9099; (* ENTIER(pi*2**(MantBits/2)) *) - r1=-0.1666665668E+0; - r2= 0.8333025139E-2; - r3=-0.1980741872E-3; - r4= 0.2601903036E-5; + ymax = 9099; (* ENTIER(pi * 2* * (MantBits/2)) *) + r1 = -0.1666665668E+0; + r2 = 0.8333025139E-2; + r3 = -0.1980741872E-3; + r4 = 0.2601903036E-5; VAR n: LONGINT; xn, f, g: REAL; BEGIN - IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + IF y >= ymax THEN ErrorHandler(LossOfAccuracy); RETURN ZERO END; (* determine the reduced number *) - n:=ENTIER(y*piInv+HALF); xn:=n; - IF ODD(n) THEN sign:=-sign END; - x:=ABS(x); - IF x#y THEN xn:=xn-HALF END; + n := ENTIER(y * piInv + HALF); xn := n; + IF ODD(n) THEN sign := -sign END; + x := ABS(x); + IF x # y THEN xn := xn - HALF END; (* fractional part of reduced number *) - f:=SHORT(ABS(LONG(x)) - LONG(xn)*pi); + f := SHORT(ABS(LONG(x)) - LONG(xn) * pi); (* Pre: |f| <= pi/2 *) - IF ABS(f)= 0 *) CONST - P0=0.41731; P1=0.59016; + P0 = 0.41731; P1 = 0.59016; VAR xMant, yEst, z: REAL; xExp: INTEGER; BEGIN (* optimize zeros and check for illegal negative roots *) - IF x=ZERO THEN RETURN ZERO END; - IF x=LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF x= LnInfinity THEN ErrorHandler(Overflow); RETURN large + ELSIF x < LnSmall THEN ErrorHandler(Underflow); RETURN ZERO + ELSIF ABS(x) < eps THEN RETURN ONE END; (* Decompose and scale the number *) - n:=round(ln2Inv*x); - xn:=n; g:=SHORT(LONG(x)-LONG(xn)*ln2); + n := round(ln2Inv * x); + xn := n; g := SHORT(LONG(x) - LONG(xn) * ln2); (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) - z:=g*g; p:=(P1*z+P0)*g; q:=Q1*z+HALF; - RETURN l.scale(HALF+p/(q-p), SHORT(n+1)) + z := g * g; p := (P1 * z + P0) * g; q := Q1 * z + HALF; + RETURN scale(HALF + p/(q - p), SHORT(n + 1)) END exp; -PROCEDURE ln*(x: REAL): REAL; +PROCEDURE ln * (x: REAL): REAL; (* Returns the natural logarithm of x for x > 0 *) CONST - c1=355.0/512.0; c2=-2.121944400546905827679E-4; - A0=-0.5527074855E+0; B0=-0.6632718214E+1; + c1 = 355.0/512.0; c2 = -2.121944400546905827679E-4; + A0 = -0.5527074855E+0; B0 = -0.6632718214E+1; VAR f, zn, zd, r, z, w, xn: REAL; n: INTEGER; BEGIN (* ensure illegal inputs are trapped and handled *) - IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + IF x <= ZERO THEN ErrorHandler(IllegalLog); RETURN -large END; (* reduce the range of the input *) - f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; - IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + f := fraction(x) * HALF; n := exponent(x) + 1; + IF f > sqrtHalf THEN zn := (f - HALF) - HALF; zd := f * HALF + HALF + ELSE zn := f - HALF; zd := zn * HALF + HALF; DEC(n) END; (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) - z:=zn/zd; w:=z*z; r:=z+z*(w*A0/(w+B0)); + z := zn/zd; w := z * z; r := z + z * (w * A0/(w + B0)); (* scale the output *) - xn:=n; - RETURN (xn*c2+r)+xn*c1 + xn := n; + RETURN (xn * c2 + r) + xn * c1 END ln; (* The angle in all trigonometric functions is measured in radians *) -PROCEDURE sin*(x: REAL): REAL; +PROCEDURE sin * (x: REAL): REAL; (* Returns the sine of x for all x *) BEGIN - IF xymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + y := ABS(x); + IF y > ymax THEN ErrorHandler(LossOfAccuracy); RETURN ZERO END; (* determine n and the fraction f *) - n:=round(x*twoByPi); xn:=n; - f:=SHORT(LONG(x)-LONG(xn)*piByTwo); + n := round(x * twoByPi); xn := n; + f := SHORT(LONG(x) - LONG(xn) * piByTwo); (* check for underflow *) - IF ABS(f)HALF THEN - i:=1-flag; - IF y>ONE THEN l.ErrorHandler(IllegalInvTrig); res:=huge; RETURN END; + y := ABS(x); + IF y > HALF THEN + i := 1 - flag; + IF y > ONE THEN ErrorHandler(IllegalInvTrig); res := large; RETURN END; (* reduce the input argument *) - g:=(ONE-y)*HALF; r:=-sqrt(g); y:=r+r; + g := (ONE-y) * HALF; r := -sqrt(g); y := r + r; (* compute approximation *) - r:=((P2*g+P1)*g)/((g+Q1)*g+Q0); - res:=y+(y*r) + r := ((P2 * g + P1) * g)/((g + Q1) * g + Q0); + res := y + (y * r) ELSE - i:=flag; - IF yONE THEN f:=ONE/f; n:=2 - ELSE n:=0 + IF f > ONE THEN f := ONE/f; n := 2 + ELSE n := 0 END; (* check if f should be scaled *) - IF f>rt32 THEN f:=(((a*f-HALF)-HALF)+f)/(rt3+f); INC(n) END; + IF f > rt32 THEN f := (((a * f - HALF) - HALF) + f)/(rt3 + f); INC(n) END; (* check for underflow *) - IF ABS(f)1 THEN res:=-res END; + IF n > 1 THEN res := -res END; CASE n OF - | 1: res:=res+piBySix - | 2: res:=res+piByTwo - | 3: res:=res+piByThree + | 1: res := res + piBySix + | 2: res := res + piByTwo + | 3: res := res + piByThree | ELSE (* do nothing *) END; RETURN res END atan; -PROCEDURE arctan*(x: REAL): REAL; - (* Returns the arctangent of x, in the range [-pi/2, pi/2] for all x *) +PROCEDURE arctan * (x: REAL): REAL; + (* Returns the arctangent of x, in the range [ - pi/2, pi/2] for all x *) BEGIN - IF x<0 THEN RETURN -atan(-x) + IF x < 0 THEN RETURN -atan( - x) ELSE RETURN atan(x) END END arctan; -PROCEDURE power*(base, exponent: REAL): REAL; +PROCEDURE power * (base, exp: REAL): REAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) - CONST P1=0.83357541E-1; K=0.4426950409; - Q1=0.69314675; Q2=0.24018510; Q3=0.54360383E-1; - OneOver16=0.0625; XMAX=16*(l.expoMax+1)-1; (*XMIN=16*l.expoMin;*) XMIN=-2016; (* to make it easier for voc; -- noch *) + CONST P1 = 0.83357541E-1; K = 0.4426950409; + Q1 = 0.69314675; Q2 = 0.24018510; Q3 = 0.54360383E-1; + OneOver16 = 0.0625; + XMAX = 16 * (expoMax + 1) - 1; + (* XMIN = 16 * expoMin; *) XMIN = -2016; (* to make it easier for voc; -- noch *) VAR z, g, R, v, u2, u1, w1, w2: REAL; w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) - IF base<=ZERO THEN - IF base#ZERO THEN l.ErrorHandler(IllegalPower); base:=-base - ELSIF exponent>ZERO THEN RETURN ZERO - ELSE l.ErrorHandler(IllegalPower); RETURN huge + IF base <= ZERO THEN + IF base # ZERO THEN ErrorHandler(IllegalPower); base := -base + ELSIF exp > ZERO THEN RETURN ZERO + ELSE ErrorHandler(IllegalPower); RETURN large END END; (* extract the exponent of base to m and clear exponent of base in g *) - g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + g := fraction(base) * HALF; + m := exponent(base) + 1; (* determine p table offset with an unrolled binary search *) - p:=1; - IF g<=a1[9] THEN p:=9 END; - IF g<=a1[p+4] THEN INC(p, 4) END; - IF g<=a1[p+2] THEN INC(p, 2) END; + p := 1; + IF g <= a1[9] THEN p := 9 END; + IF g <= a1[p + 4] THEN INC(p, 4) END; + IF g <= a1[p + 2] THEN INC(p, 2) END; (* compute scaled z so that |z| <= 0.044 *) - z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + z := ((g - a1[p + 1]) - a2[(p + 1) DIV 2])/(g + a1[p + 1]); z := z + z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=P1*v*z; R:=R+K*R; u2:=(R+z*K)+z; - u1:=(m*16-p)*OneOver16; w:=LONG(exponent)*(LONG(u1)+LONG(u2)); (* need extra precision *) + v := z * z; R := P1 * v*z; R := R + K * R; u2 := (R + z * K) + z; + u1 := (m * 16 - p) * OneOver16; w := LONG(exp) * (LONG(u1) + LONG(u2)); (* need extra precision *) (* calculations below were modified to work properly -- incorrect in cited reference? *) - iw1:=ENTIER(16*w); w1:=iw1*OneOver16; w2:=SHORT(w-w1); + iw1 := ENTIER(16 * w); w1 := iw1 * OneOver16; w2 := SHORT(w - w1); (* check for overflow/underflow *) - IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF iw1 XMAX THEN ErrorHandler(Overflow); RETURN large + ELSIF iw1 < XMIN THEN ErrorHandler(Underflow); RETURN ZERO END; - (* final approximation 2**w2-1 where -0.0625 <= w2 <= 0 *) - IF w2>ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; z:=((Q3*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; - RETURN l.scale(z, SHORT(mp)) + (* final approximation 2 * *w2 - 1 where -0.0625 <= w2 <= 0 *) + IF w2 > ZERO THEN INC(iw1); w2 := w2 - OneOver16 END; + IF iw1 < 0 THEN i := 0 ELSE i := 1 END; + mp := div(iw1, 16) + i; pp := 16 * mp - iw1; + z := ((Q3 * w2 + Q2) * w2 + Q1) * w2; + z := a1[pp + 1] + a1[pp + 1] * z; + RETURN scale(z, SHORT(mp)) END power; -PROCEDURE IsRMathException*(): BOOLEAN; +PROCEDURE IsRMathException * (): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. *) @@ -403,14 +572,14 @@ END IsRMathException; Following routines are provided as extensions to the ISO standard. They are either used as the basis of other functions or provide useful functions which are not part of the ISO standard. -*) + *) PROCEDURE log* (x, base: REAL): REAL; (* log(x,base) is the logarithm of x base 'base'. All positive arguments are allowed but base > 0 and base # 1 *) BEGIN (* log(x, base) = ln(x) / ln(base) *) - IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + IF base <= ZERO THEN ErrorHandler(IllegalLogBase); RETURN -large ELSE RETURN ln(x)/ln(base) END END log; @@ -421,29 +590,29 @@ PROCEDURE ipower* (x: REAL; base: INTEGER): REAL; PROCEDURE Adjust(xadj: REAL): REAL; BEGIN - IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + IF base = 0 THEN RETURN ONE (* x * *0 = 1 *) + ELSIF ABS(x) < miny THEN + IF base > 0 THEN RETURN ZERO ELSE ErrorHandler(Overflow); RETURN Adjust(large) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; - IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) - ELSIF Exp<-y THEN RETURN ZERO + Exp := (exponent(x) + 1) * base; y := LnInfinity * ln2Inv; + IF Exp > y THEN ErrorHandler(Overflow); RETURN Adjust(large) + ELSIF Exp< - y THEN RETURN ZERO END; - (* compute x**base using an optimised algorithm from Knuth, slightly + (* compute x * *base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) - y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + y := ONE; IF base < 0 THEN neg := TRUE; base := -base ELSE neg:= FALSE END; LOOP - IF ODD(base) THEN y:=y*x END; - base:=base DIV 2; IF base=0 THEN EXIT END; - x:=x*x; + IF ODD(base) THEN y := y * x END; + base := base DIV 2; IF base = 0 THEN EXIT END; + x := x * x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END END ipower; @@ -451,34 +620,34 @@ END ipower; PROCEDURE sincos* (x: REAL; VAR Sin, Cos: REAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN - Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) + Sin := sin(x); Cos := sqrt(ONE-Sin * Sin) END sincos; PROCEDURE arctan2* (xn, xd: REAL): REAL; -(* arctan2(xn,xd) is the quadrant-correct arc tangent atan(xn/xd). If the +(* arctan2(xn,xd) is the quadrant - correct arc tangent atan(xn/xd). If the denominator xd is zero, then the numerator xn must not be zero. All arguments are legal except xn = xd = 0. *) VAR res: REAL; xpdiff: LONGINT; BEGIN (* check for error conditions *) - IF xd=ZERO THEN - IF xn=ZERO THEN l.ErrorHandler(IllegalTrig); RETURN ZERO - ELSIF xn<0 THEN RETURN -piByTwo + IF xd = ZERO THEN + IF xn = ZERO THEN ErrorHandler(IllegalTrig); RETURN ZERO + ELSIF xn < 0 THEN RETURN -piByTwo ELSE RETURN piByTwo END; ELSE - xpdiff:=l.exponent(xn)-l.exponent(xd); - IF ABS(xpdiff)>=l.expoMax-3 THEN + xpdiff := exponent(xn) - exponent(xd); + IF ABS(xpdiff) >= expoMax - 3 THEN (* overflow detected *) - IF xn<0 THEN RETURN -piByTwo + IF xn < 0 THEN RETURN -piByTwo ELSE RETURN piByTwo END ELSE - res:=ABS(xn/xd); - IF res#ZERO THEN res:=atan(res) END; - IF xdLnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + f := y * y; y := f * ((f * P1 + P0)/(f + Q0)); RETURN x + x * y + ELSIF y > LnInfinity THEN (* handle exp overflows *) + y := y - lnv; + IF y > LnInfinity - lnv + 0.69 THEN ErrorHandler(Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); f := f + f * vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); f:=(f-ONE/f)*HALF + ELSE f := exp(y); f := (f - ONE/f) * HALF END; - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + (* reach here when 1 < ABS(x) < LnInfinity - lnv + 0.69 *) + IF x > ZERO THEN RETURN f ELSE RETURN -f END END sinh; PROCEDURE cosh* (x: REAL): REAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large that exp(|x|) overflows. *) VAR y, f: REAL; -BEGIN y:=ABS(x); - IF y>LnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) +BEGIN y := ABS(x); + IF y > LnInfinity THEN (* handle exp overflows *) + y := y - lnv; + IF y > LnInfinity - lnv + 0.69 THEN ErrorHandler(Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); RETURN f + f * vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + ELSE f := exp(y); RETURN (f + ONE/f) * HALF END END cosh; PROCEDURE tanh* (x: REAL): REAL; (* tanh(x) is the hyperbolic tangent of x. All arguments are legal. *) - CONST P0=-0.8237728127; P1=-0.3831010665E-2; Q0=2.471319654; ln3over2=0.5493061443; - BIG=9.010913347; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + CONST P0 = -0.8237728127; P1 = -0.3831010665E-2; Q0 = 2.471319654; ln3over2 = 0.5493061443; + BIG = 9.010913347; (* (ln(2) + (t + 1) * ln(B))/2 where t = mantissa bits, B = base *) VAR f, t: REAL; -BEGIN f:=ABS(x); - IF f>BIG THEN t:=ONE - ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) - ELSIF f BIG THEN t := ONE + ELSIF f > ln3over2 THEN t := ONE - TWO/(exp(TWO * f) + ONE) + ELSIF f < Limit THEN t := f ELSE (* approximation from "Software Manual for the Elementary Functions" *) - t:=f*f; t:=t*(P1*t+P0)/(t+Q0); t:=f+f*t + t := f * f; t := t * (P1 * t + P0)/(t + Q0); t := f + f * t END; - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); - IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; - ELSIF x SqrtInfinity * HALF THEN ErrorHandler(HypInvTrigClipped); + IF x > ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF x < ZERO THEN RETURN -ln( - x + sqrt(x * x + ONE)) + ELSE RETURN ln(x + sqrt(x * x + ONE)) END END arcsinh; @@ -553,9 +722,9 @@ PROCEDURE arccosh* (x: REAL): REAL; (* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) - ELSE RETURN ln(x+sqrt(x*x-ONE)) + IF x < ONE THEN ErrorHandler(IllegalHypInvTrig); RETURN ZERO + ELSIF x > SqrtInfinity * HALF THEN ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x + sqrt(x * x - ONE)) END END arccosh; @@ -563,14 +732,14 @@ PROCEDURE arctanh* (x: REAL): REAL; (* arctanh(x) is the arc hyperbolic tangent of x. |x| < 1 - sqrt(em), where em is machine epsilon. Note that |x| must not be so close to 1 that the result is less accurate than half precision. *) - CONST TanhLimit=0.999984991; (* Tanh(5.9) *) + CONST TanhLimit = 0.999984991; (* Tanh(5.9) *) VAR t: REAL; -BEGIN t:=ABS(x); - IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); - IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) +BEGIN t := ABS(x); + IF (t >= ONE) OR (t > (ONE - TWO * em)) THEN ErrorHandler(IllegalHypInvTrig); + IF x < ZERO THEN RETURN -TanhMax ELSE RETURN TanhMax END + ELSIF t > TanhLimit THEN ErrorHandler(LossOfAccuracy) END; - RETURN arcsinh(x/sqrt(ONE-x*x)) + RETURN arcsinh(x/sqrt(ONE - x * x)) END arctanh; PROCEDURE ToREAL(h: HUGEINT): REAL; @@ -578,14 +747,17 @@ BEGIN RETURN SYSTEM.VAL(REAL, h) END ToREAL; BEGIN - (* determine some fundamental constants used by hyperbolic trig functions *) - em:=l.ulp(ONE); - LnInfinity:=ln(huge); - LnSmall:=ln(miny); - SqrtInfinity:=sqrt(huge); - t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + ErrorHandler := DefaultErrorHandler; - (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) + (* determine fundamental constants used by hyperbolic trig functions *) + em := ulp(ONE); + LnInfinity := ln(large); + LnSmall := ln(miny); + SqrtInfinity := sqrt(large); + t := pred(ONE)/sqrt(em); + TanhMax := ln(t + sqrt(t * t + ONE)); + + (* initialize tables for the power() function a1[i] = 2 * *((1 - i)/16) *) a1[1] := ONE; a1[2] := ToREAL(3F75257DH); a1[3] := ToREAL(3F6AC0C7H); @@ -604,7 +776,7 @@ BEGIN a1[16] := ToREAL(3F05AAC3H); a1[17] := HALF; - (* a2[i]=2**[(1-2i)/16] - a1[2i]; delta resolution *) + (* a2[i] = 2 * *[(1 - 2i)/16] - a1[2i]; delta resolution *) a2[1] := ToREAL(31A92436H); a2[2] := ToREAL(336C2A95H); a2[3] := ToREAL(31A8FC24H); @@ -613,4 +785,4 @@ BEGIN a2[6] := ToREAL(32C12342H); a2[7] := ToREAL(32E75624H); a2[8] := ToREAL(32CF9890H) -END oocRealMath. +END Math. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index d4abd1e3..6ad77214 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -199,11 +199,9 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowReal.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/LowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod # cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod @printf "\nMaking lib$(ONAME)$(MODEL)\n" From b71526ff5c3ad588faed5e677037df5d905ec50d Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 4 Oct 2016 12:04:43 +0100 Subject: [PATCH 074/140] Add Mathl.Mod. Math and Mathl now compiling, but little tested. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/LowLReal.Mod | 486 ------------------------- src/runtime/Math.Mod | 3 +- src/runtime/MathL.Mod | 520 +++++++++++++++++---------- src/tools/make/oberon.mk | 2 +- 199 files changed, 542 insertions(+), 869 deletions(-) delete mode 100644 src/runtime/LowLReal.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5ccc86c7..dcdaea0d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4df07327..d902e57e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 3e713505..b214554c 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 16672654..a550ad52 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index d4fe9c38..eee301c1 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9b65a9b8..adb24e10 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index bf82f949..ca5c6c89 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5ccc86c7..dcdaea0d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4df07327..d902e57e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bd0b6935..911d49ab 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 16672654..a550ad52 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index d4fe9c38..eee301c1 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f656fcc8..f6698990 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 6feea28a..baa9464f 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 980cd0fc..05693822 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index fefffb47..74b0c2ac 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 2dd37317..d929bf31 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index dc9db0d8..c0f06627 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 57b8190a..3f625202 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index bc0b1d98..69eb0109 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 643f8fc5..aa541ba7 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index a8d1a2b2..5adea265 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5004eab0..8a61c677 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index c278b7af..66f4fc90 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index f677d8cf..79765125 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 14ebab63..ff4f1129 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 97cfe790..ebb0ff54 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 695d46a5..b75c50d4 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index afea83b3..d994f80e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index d797cd7d..ee2c6a91 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ed20badb..bf247ca6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 15cedcc4..2b27eb13 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 352866db..19cf402a 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c2760a09..8430bf82 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f691a0ee..016b40ed 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bd0b6935..911d49ab 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ab191652..65f5d6d9 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index f08085ef..6ea96ec6 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 7b5e8a8c..f88bbad9 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e0dfb26e..e1231b49 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f656fcc8..f6698990 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 6feea28a..baa9464f 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5eeecbcd..f176c32c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8d939331..cd60e0eb 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 29896228..51248a3a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index a2df0b07..06562971 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 85708a3f..f2adf7f8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 2dd37317..d929bf31 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index dc9db0d8..c0f06627 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 57b8190a..3f625202 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index c6f0ec55..eb8d7d25 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 80807ca6..4df43c2a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 7917b570..bab5adcc 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fad4716b..fd8f546f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6d64b896..662ac74a 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index bc0b1d98..69eb0109 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b798756b..d7aadb69 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 643f8fc5..aa541ba7 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index b466e3aa..90da6ba9 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index bd835f8d..f7f892bf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index af7eca8a..d97f3caa 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index a8d1a2b2..5adea265 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 5fe4dd5c..88225ce2 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5004eab0..8a61c677 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 49c91eed..ab72377c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index f08085ef..6ea96ec6 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 72b7e0cb..4d3199e6 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8f725aaa..e99e1be2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 070acb18..04c87a8c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 97923f8d..7d395538 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 24d6197a..98731ba9 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index afd5e004..7d4bf19a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index ce00b00c..939e74d8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 97cfe790..ebb0ff54 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 695d46a5..b75c50d4 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d35766eb..49c6425d 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 6adfb219..e7ecd052 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 5f5a39b3..b58bcc2a 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 57da5b24..cb8a5a95 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 61383b15..92ed02e4 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 511c4d6b..393203ef 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/03]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/LowLReal.Mod b/src/runtime/LowLReal.Mod deleted file mode 100644 index b90958b2..00000000 --- a/src/runtime/LowLReal.Mod +++ /dev/null @@ -1,486 +0,0 @@ -(* $Id: LowLReal.Mod,v 1.6 1999/09/02 13:15:35 acken Exp $ *) -MODULE oocLowLReal; - -(* ToDo. support 64 bit builds *) - -(* - LowLReal - Gives access to the underlying properties of the type LONGREAL - for IEEE double-precision numbers. - Copyright (C) 1996 Michael Griebling - - This module is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This module is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*) - - -IMPORT Low := LowReal, S := SYSTEM; - -(* - - Real number properties are defined as follows: - - radix--The whole number value of the radix used to represent the - corresponding read number values. - - places--The whole number value of the number of radix places used - to store values of the corresponding real number type. - - expoMin--The whole number value of the exponent minimum. - - expoMax--The whole number value of the exponent maximum. - - large--The largest value of the corresponding real number type. - - small--The smallest positive value of the corresponding real number - type, represented to maximal precision. - - IEC559--A Boolean value that is TRUE if and only if the implementation - of the corresponding real number type conforms to IEC 559:1989 - (IEEE 754:1987) in all regards. - - NOTES - 6 -- If `IEC559' is TRUE, the value of `radix' is 2. - 7 -- If LowReal.IEC559 is TRUE, the 32-bit format of IEC 559:1989 - is used for the type REAL. - 7 -- If LowLong.IEC559 is TRUE, the 64-bit format of IEC 559:1989 - is used for the type REAL. - - LIA1--A Boolean value that is TRUE if and only if the implementation of - the corresponding real number type conforms to ISO/IEC 10967-1:199x - (LIA-1) in all regards: parameters, arithmetic, exceptions, and - notification. - - rounds--A Boolean value that is TRUE if and only if each operation produces - a result that is one of the values of the corresponding real number - type nearest to the mathematical result. - - gUnderflow--A Boolean value that is TRUE if and only if there are values of - the corresponding real number type between 0.0 and `small'. - - exception--A Boolean value that is TRUE if and only if every operation that - attempts to produce a real value out of range raises an exception. - - extend--A Boolean value that is TRUE if and only if expressions of the - corresponding real number type are computed to higher precision than - the stored values. - - nModes--The whole number value giving the number of bit positions needed for - the status flags for mode control. - -*) - -CONST - radix*= 2; - places*= 53; - expoMax*= 1023; - expoMin*= 1-expoMax; - large*= MAX(LONGREAL); (*1.7976931348623157D+308;*) (* MAX(LONGREAL) *) - (*small*= 2.2250738585072014D-308;*) - small*= 2.2250738585072014/9.9999999999999981D307(*/10^308)*); - IEC559*= TRUE; - LIA1*= FALSE; - rounds*= FALSE; - gUnderflow*= TRUE; (* there are IEEE numbers smaller than `small' *) - exception*= FALSE; (* at least in the default implementation *) - extend*= FALSE; - nModes*= 0; - ONE=1.0D0; (* some commonly-used constants *) - ZERO=0.0D0; - TEN=1.0D1; - - DEBUG = TRUE; - - expOffset=expoMax; - hiBit=19; - expBit=hiBit+1; - nMask={0..hiBit,31}; (* number mask *) - expMask={expBit..30}; (* exponent mask *) - -TYPE - Modes*= SET; - LongInt=ARRAY 2 OF LONGINT; - LongSet=ARRAY 2 OF SET; - -VAR - (*sml* : LONGREAL; tmp: LONGREAL;*) (* this was a test to get small as a variable at runtime. obviously, compile time preferred; -- noch *) - isBigEndian-: BOOLEAN; (* set when target is big endian *) - (* - PROCEDURE power0(i, j : INTEGER) : LONGREAL; (* used to calculate sml at runtime; -- noch *) - VAR k : INTEGER; - p : LONGREAL; - BEGIN - k := 1; - p := i; - REPEAT - p := p * i; - INC(k); - UNTIL k=j; - RETURN p; - END power0; -*) - -(* Errors are handled through the LowReal module *) - -PROCEDURE err*(): INTEGER; -BEGIN - RETURN Low.err -END err; - -PROCEDURE ClearError*; -BEGIN - Low.ClearError -END ClearError; - -PROCEDURE ErrorHandler*(err: INTEGER); -BEGIN - Low.ErrorHandler(err) -END ErrorHandler; - -(* type-casting utilities *) - -PROCEDURE Move (VAR x: LONGREAL; VAR ra: ARRAY OF LONGINT); -(* typecast a LONGREAL to an array of LONGINTs *) - VAR t: LONGINT; -BEGIN - S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END -END Move; - -PROCEDURE MoveSet (VAR x: LONGREAL; VAR ra: ARRAY OF SET); -(* typecast a LONGREAL to an array of LONGINTs *) - VAR t: SET; -BEGIN - S.MOVE(S.ADR(x),S.ADR(ra),SIZE(LONGREAL)); - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END -END MoveSet; - -(* Note: The below should be done with a type cast -- - once the compiler supports such things. *) -(*<* PUSH; Warnings := FALSE *>*) -PROCEDURE Real * (ra: ARRAY OF LONGINT): LONGREAL; -(* typecast an array of big endian LONGINTs to a LONGREAL *) - VAR t: LONGINT; x: LONGREAL; -BEGIN - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; - S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); - RETURN x -END Real; - -PROCEDURE ToReal (ra: ARRAY OF SET): LONGREAL; -(* typecast an array of LONGINTs to a LONGREAL *) - VAR t: SET; x: LONGREAL; -BEGIN - IF ~isBigEndian THEN t:=ra[0]; ra[0]:=ra[1]; ra[1]:=t END; - S.MOVE(S.ADR(ra),S.ADR(x),SIZE(LONGREAL)); - RETURN x -END ToReal; -(*<* POP *> *) - -PROCEDURE exponent*(x: LONGREAL): INTEGER; -(* - The value of the call exponent(x) shall be the exponent value of `x' - that lies between `expoMin' and `expoMax'. An exception shall occur - and may be raised if `x' is equal to 0.0. - *) - VAR ra: LongInt; -BEGIN - (* NOTE: x=0.0 should raise exception *) - IF x=ZERO THEN RETURN 0 - ELSE Move(x, ra); - RETURN SHORT(S.LSH(ra[0],-expBit) MOD 2048)-expOffset - END -END exponent; - -PROCEDURE exponent10*(x: LONGREAL): INTEGER; -(* - The value of the call exponent10(x) shall be the base 10 exponent - value of `x'. An exception shall occur and may be raised if `x' is - equal to 0.0. - *) -VAR exp: INTEGER; -BEGIN - IF x=ZERO THEN RETURN 0 END; (* exception could be raised here *) - exp:=0; x:=ABS(x); - WHILE x>=TEN DO x:=x/TEN; INC(exp) END; - WHILE x<1 DO x:=x*TEN; DEC(exp) END; - RETURN exp -END exponent10; - -PROCEDURE fraction*(x: LONGREAL): LONGREAL; -(* - The value of the call fraction(x) shall be the significand (or - significant) part of `x'. Hence the following relationship shall - hold: x = scale(fraction(x), exponent(x)). -*) - CONST eZero={(hiBit+2)..29}; - VAR ra: LongInt; -BEGIN - IF x=ZERO THEN RETURN ZERO - ELSE Move(x, ra); - ra[0]:=S.VAL(LONGINT, S.VAL(SET,ra[0])*nMask+eZero); - RETURN Real(ra)*2.0D0 - END -END fraction; - -PROCEDURE IsInfinity * (real: LONGREAL) : BOOLEAN; - CONST signMask={0..30}; - VAR ra: LongSet; -BEGIN - MoveSet(real, ra); - RETURN (ra[0]*signMask=expMask) & (ra[1]={}) -END IsInfinity; - -PROCEDURE IsNaN * (real: LONGREAL) : BOOLEAN; - CONST fracMask={0..hiBit}; - VAR ra: LongSet; -BEGIN - MoveSet(real, ra); - RETURN (ra[0]*expMask=expMask) & ((ra[1]#{}) OR (ra[0]*fracMask#{})) -END IsNaN; - -PROCEDURE sign*(x: LONGREAL): LONGREAL; -(* - The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, - or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or - -1.0 if `x' is equal to 0.0. -*) -BEGIN - IF xexpoMax THEN RETURN large*sign(x) (* exception raised here *) - ELSIF exp 1.0 *) - LnInfinity: LONGREAL; (* natural log of infinity *) - LnSmall: LONGREAL; (* natural log of very small number *) - SqrtInfinity: LONGREAL; (* square root of infinity *) - TanhMax: LONGREAL; (* maximum Tanh value *) - t: LONGREAL; (* internal variables *) + a1: ARRAY 18 OF LONGREAL; (* lookup table for power function *) + a2: ARRAY 9 OF LONGREAL; (* lookup table for power function *) + em: LONGREAL; (* largest number such that 1 + epsilon > 1.0 *) + LnInfinity: LONGREAL; (* natural log of infinity *) + LnSmall: LONGREAL; (* natural log of very small number *) + SqrtInfinity: LONGREAL; (* square root of infinity *) + TanhMax: LONGREAL; (* maximum Tanh value *) + t: LONGREAL; (* internal variables *) + NumberMask: SYSTEM.SET64; (* Sign and significand, {0..51, 63} *) + ExponentMask: SYSTEM.SET64; (* Exponent part, {53..62} *) + ZeroExponent: SYSTEM.SET64; (* Zero valued exponent {54..61} *) + i: INTEGER; (* For initialisation loops in module body. *) + + + + +(* TYPE LONGREAL: 1/sign, 11/exponent, 52/significand *) + +PROCEDURE fraction*(x: LONGREAL): LONGREAL; +(* + The value of the call fraction(x) shall be the significand (or + significant) part of `x'. Hence the following relationship shall + hold: x = scale(fraction(x), exponent(x)). +*) + VAR s: SET; +BEGIN + IF x = ZERO THEN RETURN ZERO + ELSE + s := SYSTEM.VAL(SYSTEM.SET64, x) * NumberMask + ZeroExponent; + RETURN SYSTEM.VAL(LONGREAL, s) * 2.0; + END +END fraction; + +PROCEDURE exponent*(x: LONGREAL): INTEGER; +(* + The value of the call exponent(x) shall be the exponent value of `x' + that lies between `expoMin' and `expoMax'. An exception shall occur + and may be raised if `x' is equal to 0.0. +*) + VAR i: SYSTEM.INT64; +BEGIN + IF x = ZERO THEN RETURN 0 (* NOTE: x=0.0 should raise exception *) + ELSE + i := SYSTEM.LSH(SYSTEM.VAL(SYSTEM.INT64, x), -52) MOD 2048; + RETURN SYSTEM.VAL(INTEGER, i) - 1023 + END +END exponent; + +PROCEDURE sign*(x: LONGREAL): LONGREAL; +(* + The value of the call sign(x) shall be 1.0 if `x' is greater than 0.0, + or shall be -1.0 if `x' is less than 0.0, or shall be either 1.0 or + -1.0 if `x' is equal to 0.0. +*) +BEGIN + IF x < ZERO THEN RETURN -ONE ELSE RETURN ONE END +END sign; + +PROCEDURE scale*(x: LONGREAL; n: INTEGER): LONGREAL; +(* + The value of the call scale(x,n) shall be the value x*radix^n if such + a value exists; otherwise an execption shall occur and may be raised. +*) + VAR exp: LONGINT; lexp: SYSTEM.SET64; +BEGIN + IF x = ZERO THEN RETURN ZERO END; + exp := exponent(x) + n; (* new exponent *) + IF exp > expoMax THEN RETURN large * sign(x) (* exception raised here *) + ELSIF exp < expoMin THEN RETURN small * sign(x) (* exception here as well *) + END; + lexp := SYSTEM.VAL(SYSTEM.SET64, x) * NumberMask (* sign and significand *) + + SYSTEM.VAL(SYSTEM.SET64, SYSTEM.LSH(exp + expOffset, 52)); (* shifted exponent bits *) + RETURN SYSTEM.VAL(LONGREAL, lexp) +END scale; + +PROCEDURE ulp*(x: LONGREAL): LONGREAL; +(* + The value of the call ulp(x) shall be the value of the corresponding + real number type equal to a unit in the last place of `x', if such a + value exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN scale(ONE, exponent(x)-places+1) +END ulp; + +PROCEDURE succ*(x: LONGREAL): LONGREAL; +(* + The value of the call succ(x) shall be the next value of the + corresponding real number type greater than `x', if such a type + exists; otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x+ulp(x)*sign(x) +END succ; + +PROCEDURE pred*(x: LONGREAL): LONGREAL; +(* + The value of the call pred(x) shall be the next value of the + corresponding real number type less than `x', if such a type exists; + otherwise an exception shall occur and may be raised. +*) +BEGIN + RETURN x-ulp(x)*sign(x) +END pred; -(* internally used support routines *) PROCEDURE SinCos (x, y, sign: LONGREAL): LONGREAL; CONST - ymax=210828714; (* ENTIER(pi*2**(MantBits/2)) *) - c1=3.1416015625D0; - c2=-8.908910206761537356617D-6; - r1=-0.16666666666666665052D+0; - r2= 0.83333333333331650314D-2; - r3=-0.19841269841201840457D-3; - r4= 0.27557319210152756119D-5; - r5=-0.25052106798274584544D-7; - r6= 0.16058936490371589114D-9; - r7=-0.76429178068910467734D-12; - r8= 0.27204790957888846175D-14; + ymax = 210828714; (* ENTIER(pi*2**(MantBits/2)) *) + c1 = 3.1416015625D0; + c2 = -8.908910206761537356617D-6; + r1 = -0.16666666666666665052D+0; + r2 = 0.83333333333331650314D-2; + r3 = -0.19841269841201840457D-3; + r4 = 0.27557319210152756119D-5; + r5 = -0.25052106798274584544D-7; + r6 = 0.16058936490371589114D-9; + r7 = -0.76429178068910467734D-12; + r8 = 0.27204790957888846175D-14; VAR n: LONGINT; xn, f, x1, g: LONGREAL; BEGIN - IF y>=ymax THEN l.ErrorHandler(LossOfAccuracy); RETURN ZERO END; + IF y >= ymax THEN Math.ErrorHandler(Math.LossOfAccuracy); RETURN ZERO END; (* determine the reduced number *) - n:=ENTIER(y*piInv+HALF); xn:=n; - IF ODD(n) THEN sign:=-sign END; - x:=ABS(x); - IF x#y THEN xn:=xn-HALF END; + n := ENTIER(y*piInv + HALF); xn := n; + IF ODD(n) THEN sign := -sign END; + x := ABS(x); + IF x # y THEN xn := xn-HALF END; (* fractional part of reduced number *) - x1:=ENTIER(x); - f:=((x1-xn*c1)+(x-x1))-xn*c2; + x1 := ENTIER(x); + f := ((x1-xn*c1) + (x-x1))-xn*c2; (* Pre: |f| <= pi/2 *) - IF ABS(f)LnInfinity THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF x LnInfinity THEN Math.ErrorHandler(Math.Overflow); RETURN large + ELSIF x < LnSmall THEN RETURN ZERO + ELSIF ABS(x) < eps THEN RETURN ONE END; (* Decompose and scale the number *) - IF x>=ZERO THEN n:=SHORT(ENTIER(ln2Inv*x+HALF)) - ELSE n:=SHORT(ENTIER(ln2Inv*x-HALF)) + IF x >= ZERO THEN n := SHORT(ENTIER(ln2Inv*x + HALF)) + ELSE n := SHORT(ENTIER(ln2Inv*x-HALF)) END; - xn:=n; g:=(x-xn*c1)-xn*c2; + xn := n; g := (x-xn*c1)-xn*c2; (* Calculate exp(g)/2 from "Software Manual for the Elementary Functions" *) - z:=g*g; p:=((P2*z+P1)*z+P0)*g; q:=(Q2*z+Q1)*z+HALF; - RETURN l.scale(HALF+p/(q-p), n+1) + z := g*g; p := ((P2*z + P1)*z + P0)*g; q := (Q2*z + Q1)*z + HALF; + RETURN scale(HALF + p/(q-p), n + 1) END exp; PROCEDURE ln*(x: LONGREAL): LONGREAL; @@ -177,20 +327,20 @@ PROCEDURE ln*(x: LONGREAL): LONGREAL; VAR f, zn, zd, r, z, w, p, q, xn: LONGREAL; n: INTEGER; BEGIN (* ensure illegal inputs are trapped and handled *) - IF x<=ZERO THEN l.ErrorHandler(IllegalLog); RETURN -huge END; + IF x <= ZERO THEN Math.ErrorHandler(Math.IllegalLog); RETURN -large END; (* reduce the range of the input *) - f:=l.fraction(x)*HALF; n:=l.exponent(x)+1; - IF f>sqrtHalf THEN zn:=(f-HALF)-HALF; zd:=f*HALF+HALF - ELSE zn:=f-HALF; zd:=zn*HALF+HALF; DEC(n) + f := fraction(x)*HALF; n := exponent(x) + 1; + IF f > sqrtHalf THEN zn := (f-HALF)-HALF; zd := f*HALF + HALF + ELSE zn := f-HALF; zd := zn*HALF + HALF; DEC(n) END; (* evaluate rational approximation from "Software Manual for the Elementary Functions" *) - z:=zn/zd; w:=z*z; q:=((w+Q2)*w+Q1)*w+Q0; p:=w*((P2*w+P1)*w+P0); r:=z+z*(p/q); + z := zn/zd; w := z*z; q := ((w + Q2)*w + Q1)*w + Q0; p := w*((P2*w + P1)*w + P0); r := z + z*(p/q); (* scale the output *) - xn:=n; - RETURN (xn*c2+r)+xn*c1 + xn := n; + RETURN (xn*c2 + r) + xn*c1 END ln; @@ -198,14 +348,14 @@ END ln; PROCEDURE sin* (x: LONGREAL): LONGREAL; BEGIN - IF xONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + IF ABS(x) > ONE THEN Math.ErrorHandler(Math.IllegalInvTrig); RETURN large ELSE RETURN arctan2(x, sqrt(ONE-x*x)) END END arcsin; @@ -229,7 +379,7 @@ END arcsin; PROCEDURE arccos*(x: LONGREAL): LONGREAL; (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) BEGIN - IF ABS(x)>ONE THEN l.ErrorHandler(IllegalInvTrig); RETURN huge + IF ABS(x) > ONE THEN Math.ErrorHandler(Math.IllegalInvTrig); RETURN large ELSE RETURN arctan2(sqrt(ONE-x*x), x) END END arccos; @@ -240,7 +390,7 @@ BEGIN RETURN arctan2(x, ONE) END arctan; -PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; +PROCEDURE power*(base, exp: LONGREAL): LONGREAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) CONST @@ -251,54 +401,56 @@ PROCEDURE power*(base, exponent: LONGREAL): LONGREAL; Q3=0.55504108664085595326D-1; Q4=0.96181290595172416964D-2; Q5=0.13333541313585784703D-2; Q6=0.15400290440989764601D-3; Q7=0.14928852680595608186D-4; - OneOver16=0.0625D0; XMAX=16*l.expoMax-1; (*XMIN=16*l.expoMin+1;*) XMIN=-16351; (* noch *) + OneOver16 = 0.0625D0; + XMAX = 16*expoMax - 1; (*XMIN=16*l.expoMin + 1;*) + XMIN = -16351; (* noch *) VAR z, g, R, v, u2, u1, w1, w2, y1, y2, w: LONGREAL; m, p, i: INTEGER; mp, pp, iw1: LONGINT; BEGIN (* handle all possible error conditions *) - IF ABS(exponent)ZERO THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN -huge END + IF ABS(exp) < miny THEN RETURN ONE (* base**0 = 1 *) + ELSIF base < ZERO THEN Math.ErrorHandler(Math.IllegalPower); RETURN -large + ELSIF ABS(base) < miny THEN + IF exp > ZERO THEN RETURN ZERO ELSE Math.ErrorHandler(Math.Overflow); RETURN -large END END; (* extract the exponent of base to m and clear exponent of base in g *) - g:=l.fraction(base)*HALF; m:=l.exponent(base)+1; + g := fraction(base)*HALF; m := exponent(base) + 1; (* determine p table offset with an unrolled binary search *) - p:=1; - IF g<=a1[9] THEN p:=9 END; - IF g<=a1[p+4] THEN INC(p, 4) END; - IF g<=a1[p+2] THEN INC(p, 2) END; + p := 1; + IF g <= a1[9] THEN p := 9 END; + IF g <= a1[p + 4] THEN INC(p, 4) END; + IF g <= a1[p + 2] THEN INC(p, 2) END; (* compute scaled z so that |z| <= 0.044 *) - z:=((g-a1[p+1])-a2[(p+1) DIV 2])/(g+a1[p+1]); z:=z+z; + z := ((g-a1[p + 1])-a2[(p + 1) DIV 2])/(g + a1[p + 1]); z := z + z; (* approximation for log2(z) from "Software Manual for the Elementary Functions" *) - v:=z*z; R:=(((P4*v+P3)*v+P2)*v+P1)*v*z; R:=R+K*R; u2:=(R+z*K)+z; u1:=(m*16-p)*OneOver16; + v := z*z; R := (((P4*v + P3)*v + P2)*v + P1)*v*z; R := R + K*R; u2 := (R + z*K) + z; u1 := (m*16-p)*OneOver16; (* generate w with extra precision calculations *) - y1:=ENTIER(16*exponent)*OneOver16; y2:=exponent-y1; w:=u2*exponent+u1*y2; - w1:=ENTIER(16*w)*OneOver16; w2:=w-w1; w:=w1+u1*y1; - w1:=ENTIER(16*w)*OneOver16; w2:=w2+(w-w1); w:=ENTIER(16*w2)*OneOver16; - iw1:=ENTIER(16*(w+w1)); w2:=w2-w; + y1 := ENTIER(16*exp)*OneOver16; y2 := exp-y1; w := u2*exp + u1*y2; + w1 := ENTIER(16*w)*OneOver16; w2 := w-w1; w := w1 + u1*y1; + w1 := ENTIER(16*w)*OneOver16; w2 := w2 + (w-w1); w := ENTIER(16*w2)*OneOver16; + iw1 := ENTIER(16*(w + w1)); w2 := w2-w; (* check for overflow/underflow *) - IF iw1>XMAX THEN l.ErrorHandler(Overflow); RETURN huge - ELSIF iw1 XMAX THEN Math.ErrorHandler(Math.Overflow); RETURN large + ELSIF iw1 < XMIN THEN RETURN ZERO (* underflow *) END; (* final approximation 2**w2-1 where -0.0625 <= w2 <= 0 *) - IF w2>ZERO THEN INC(iw1); w2:=w2-OneOver16 END; IF iw1<0 THEN i:=0 ELSE i:=1 END; - mp:=div(iw1, 16)+i; pp:=16*mp-iw1; - z:=((((((Q7*w2+Q6)*w2+Q5)*w2+Q4)*w2+Q3)*w2+Q2)*w2+Q1)*w2; z:=a1[pp+1]+a1[pp+1]*z; - RETURN l.scale(z, SHORT(mp)) + IF w2 > ZERO THEN INC(iw1); w2 := w2-OneOver16 END; IF iw1 < 0 THEN i := 0 ELSE i := 1 END; + mp := div(iw1, 16) + i; pp := 16*mp-iw1; + z := ((((((Q7*w2 + Q6)*w2 + Q5)*w2 + Q4)*w2 + Q3)*w2 + Q2)*w2 + Q1)*w2; z := a1[pp + 1] + a1[pp + 1]*z; + RETURN scale(z, SHORT(mp)) END power; PROCEDURE round*(x: LONGREAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN - IF x 0 and base # 1. *) BEGIN (* log(x, base) = log2(x) / log2(base) *) - IF base<=ZERO THEN l.ErrorHandler(IllegalLogBase); RETURN -huge + IF base <= ZERO THEN Math.ErrorHandler(Math.IllegalLogBase); RETURN -large ELSE RETURN ln(x)/ln(base) END END log; @@ -333,29 +485,29 @@ PROCEDURE ipower* (x: LONGREAL; base: INTEGER): LONGREAL; PROCEDURE Adjust(xadj: LONGREAL): LONGREAL; BEGIN - IF (x0 THEN RETURN ZERO ELSE l.ErrorHandler(Overflow); RETURN Adjust(huge) END + ELSIF ABS(x) < miny THEN + IF base > 0 THEN RETURN ZERO ELSE Math.ErrorHandler(Math.Overflow); RETURN Adjust(large) END END; (* trap potential overflows and underflows *) - Exp:=(l.exponent(x)+1)*base; y:=LnInfinity*ln2Inv; - IF Exp>y THEN l.ErrorHandler(Overflow); RETURN Adjust(huge) - ELSIF Exp<-y THEN RETURN ZERO + Exp := (exponent(x) + 1)*base; y := LnInfinity*ln2Inv; + IF Exp > y THEN Math.ErrorHandler(Math.Overflow); RETURN Adjust(large) + ELSIF Exp < -y THEN RETURN ZERO END; (* compute x**base using an optimised algorithm from Knuth, slightly altered : p442, The Art Of Computer Programming, Vol 2 *) - y:=ONE; IF base<0 THEN neg:=TRUE; base := -base ELSE neg:= FALSE END; + y := ONE; IF base < 0 THEN neg := TRUE; base := -base ELSE neg:= FALSE END; LOOP - IF ODD(base) THEN y:=y*x END; - base:=base DIV 2; IF base=0 THEN EXIT END; - x:=x*x; + IF ODD(base) THEN y := y*x END; + base := base DIV 2; IF base=0 THEN EXIT END; + x := x*x; END; IF neg THEN RETURN ONE/y ELSE RETURN y END END ipower; @@ -363,7 +515,7 @@ END ipower; PROCEDURE sincos* (x: LONGREAL; VAR Sin, Cos: LONGREAL); (* More efficient sin/cos implementation if both values are needed. *) BEGIN - Sin:=sin(x); Cos:=sqrt(ONE-Sin*Sin) + Sin := sin(x); Cos := sqrt(ONE-Sin*Sin) END sincos; PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; @@ -378,43 +530,43 @@ PROCEDURE arctan2* (xn, xd: LONGREAL): LONGREAL; PiOver2=pi/2; Sqrt3=1.7320508075688772935D0; VAR atan, z, z2, p, q: LONGREAL; xnExp, xdExp: INTEGER; Quadrant: SHORTINT; BEGIN - IF ABS(xd)=l.expoMax-3 THEN l.ErrorHandler(Overflow); atan:=PiOver2 - ELSIF xnExp-xdExp= expoMax-3 THEN Math.ErrorHandler(Math.Overflow); atan := PiOver2 + ELSIF xnExp-xdExp < expoMin + 3 THEN atan := ZERO ELSE (* ensure division of xn/xd always produces a number < 1 & resolve quadrant *) - IF ABS(xn)>ABS(xd) THEN z:=ABS(xd/xn); Quadrant:=2 - ELSE z:=ABS(xn/xd); Quadrant:=0 + IF ABS(xn) > ABS(xd) THEN z := ABS(xd/xn); Quadrant := 2 + ELSE z := ABS(xn/xd); Quadrant := 0 END; (* further reduce range to within 0 to 2-sqrt(3) *) - IF z>TWO-Sqrt3 THEN z:=(z*Sqrt3-ONE)/(Sqrt3+z); INC(Quadrant) END; + IF z > TWO-Sqrt3 THEN z := (z*Sqrt3-ONE)/(Sqrt3 + z); INC(Quadrant) END; (* approximation from "Computer Approximations" table ARCTN 5075 *) - IF ABS(z)1 THEN atan:=-atan END; + IF Quadrant > 1 THEN atan := -atan END; CASE Quadrant OF - 1: atan:=atan+pi/6 - | 2: atan:=atan+PiOver2 - | 3: atan:=atan+pi/3 + 1: atan := atan + pi/6 + | 2: atan := atan + PiOver2 + | 3: atan := atan + pi/3 | ELSE (* angle is correct *) END END; (* map negative xds into the correct quadrant *) - IF xdLnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); f:=f+f*vbytwo (* don't change to f(1+vbytwo) *) + f := y*y; p := ((P3*f + P2)*f + P1)*f + P0; q := ((f + Q2)*f + Q1)*f + Q0; y := f*(p/q); RETURN x + x*y + ELSIF y > LnInfinity THEN (* handle exp overflows *) + y := y-lnv; + IF y > LnInfinity-lnv + 0.69 THEN Math.ErrorHandler(Math.Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); f := f + f*vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); f:=(f-ONE/f)*HALF + ELSE f := exp(y); f := (f-ONE/f)*HALF END; - (* reach here when 1 < ABS(x) < LnInfinity-lnv+0.69 *) - IF x>ZERO THEN RETURN f ELSE RETURN -f END + (* reach here when 1 < ABS(x) < LnInfinity-lnv + 0.69 *) + IF x > ZERO THEN RETURN f ELSE RETURN -f END END sinh; PROCEDURE cosh* (x: LONGREAL): LONGREAL; (* cosh(x) is the hyperbolic cosine of x. The argument x must not be so large that exp(|x|) overflows. *) VAR y, f: LONGREAL; -BEGIN y:=ABS(x); - IF y>LnInfinity THEN (* handle exp overflows *) - y:=y-lnv; - IF y>LnInfinity-lnv+0.69 THEN l.ErrorHandler(Overflow); - IF x>ZERO THEN RETURN huge ELSE RETURN -huge END - ELSE f:=exp(y); RETURN f+f*vbytwo (* don't change to f(1+vbytwo) *) +BEGIN y := ABS(x); + IF y > LnInfinity THEN (* handle exp overflows *) + y := y-lnv; + IF y > LnInfinity-lnv + 0.69 THEN Math.ErrorHandler(Math.Overflow); + IF x > ZERO THEN RETURN large ELSE RETURN -large END + ELSE f := exp(y); RETURN f + f*vbytwo (* don't change to f(1 + vbytwo) *) END - ELSE f:=exp(y); RETURN (f+ONE/f)*HALF + ELSE f := exp(y); RETURN (f + ONE/f)*HALF END END cosh; @@ -467,25 +619,25 @@ PROCEDURE tanh* (x: LONGREAL): LONGREAL; P0=-0.16134119023996228053D+4; P1=-0.99225929672236083313D+2; P2=-0.96437492777225469787D+0; Q0= 0.48402357071988688686D+4; Q1= 0.22337720718962312926D+4; Q2= 0.11274474380534949335D+3; ln3over2=0.54930614433405484570D0; - BIG=19.06154747D0; (* (ln(2)+(t+1)*ln(B))/2 where t=mantissa bits, B=base *) + BIG=19.06154747D0; (* (ln(2) + (t + 1)*ln(B))/2 where t=mantissa bits, B=base *) VAR f, t: LONGREAL; -BEGIN f:=ABS(x); - IF f>BIG THEN t:=ONE - ELSIF f>ln3over2 THEN t:=ONE-TWO/(exp(TWO*f)+ONE) - ELSIF f BIG THEN t := ONE + ELSIF f > ln3over2 THEN t := ONE-TWO/(exp(TWO*f) + ONE) + ELSIF f < Limit THEN t := f ELSE (* approximation from "Software Manual for the Elementary Functions" *) - t:=f*f; t:=t*(((P2*t+P1)*t+P0)/(((t+Q2)*t+Q1)*t+Q0)); t:=f+f*t + t := f*f; t := t*(((P2*t + P1)*t + P0)/(((t + Q2)*t + Q1)*t + Q0)); t := f + f*t END; - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); - IF x>ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; - ELSIF x SqrtInfinity*HALF THEN Math.ErrorHandler(Math.HypInvTrigClipped); + IF x > ZERO THEN RETURN ln(SqrtInfinity) ELSE RETURN -ln(SqrtInfinity) END; + ELSIF x < ZERO THEN RETURN -ln(-x + sqrt(x*x + ONE)) + ELSE RETURN ln(x + sqrt(x*x + ONE)) END END arcsinh; @@ -493,9 +645,9 @@ PROCEDURE arccosh* (x: LONGREAL): LONGREAL; (* arccosh(x) is the arc hyperbolic cosine of x. All arguments greater than or equal to 1 are legal. *) BEGIN - IF xSqrtInfinity*HALF THEN l.ErrorHandler(HypInvTrigClipped); RETURN ln(SqrtInfinity) - ELSE RETURN ln(x+sqrt(x*x-ONE)) + IF x < ONE THEN Math.ErrorHandler(Math.IllegalHypInvTrig); RETURN ZERO + ELSIF x > SqrtInfinity*HALF THEN Math.ErrorHandler(Math.HypInvTrigClipped); RETURN ln(SqrtInfinity) + ELSE RETURN ln(x + sqrt(x*x-ONE)) END END arccosh; @@ -505,10 +657,10 @@ PROCEDURE arctanh* (x: LONGREAL): LONGREAL; result is less accurate than half precision. *) CONST TanhLimit=0.999984991D0; (* Tanh(5.9) *) VAR t: LONGREAL; -BEGIN t:=ABS(x); - IF (t>=ONE) OR (t>(ONE-TWO*em)) THEN l.ErrorHandler(IllegalHypInvTrig); - IF xTanhLimit THEN l.ErrorHandler(LossOfAccuracy) +BEGIN t := ABS(x); + IF (t >= ONE) OR (t > (ONE-TWO*em)) THEN Math.ErrorHandler(Math.IllegalHypInvTrig); + IF x < ZERO THEN RETURN -TanhMax ELSE RETURN TanhMax END + ELSIF t > TanhLimit THEN Math.ErrorHandler(Math.LossOfAccuracy) END; RETURN arcsinh(x/sqrt(ONE-x*x)) END arctanh; @@ -518,16 +670,24 @@ BEGIN RETURN SYSTEM.VAL(LONGREAL, h) END ToLONGREAL; BEGIN + (* Initialise masks. *) + NumberMask := {}; INCL(NumberMask, 63); + FOR i := 0 TO 51 DO INCL(NumberMask, i) END; + ExponentMask := -NumberMask; + ZeroExponent := {}; + FOR i := 54 TO 61 DO INCL(ZeroExponent, i) END; + (* determine some fundamental constants used by hyperbolic trig functions *) - em:=l.ulp(ONE); - LnInfinity:=ln(huge); - LnSmall:=ln(miny); - SqrtInfinity:=sqrt(huge); - t:=l.pred(ONE)/sqrt(em); TanhMax:=ln(t+sqrt(t*t+ONE)); + em := ulp(ONE); + LnInfinity := ln(large); + LnSmall := ln(miny); + SqrtInfinity := sqrt(large); + t := pred(ONE)/sqrt(em); + TanhMax := ln(t + sqrt(t*t + ONE)); (* initialize some tables for the power() function a1[i]=2**((1-i)/16) *) (* disable compiler warnings about 32-bit negative integers *) - (*<* PUSH; Warnings := FALSE *>*) + (* < * PUSH; Warnings := FALSE * > *) a1[ 1] := ONE; a1[ 2] := ToLONGREAL(3FEEA4AFA2A490DAH); a1[ 3] := ToLONGREAL(3FED5818DCFBA487H); @@ -557,6 +717,6 @@ BEGIN a2[8] := ToLONGREAL(3C88A62E4ADC0000H); (* reenable compiler warnings *) - (*<* POP *>*) + (* < * POP * > *) END MathL. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6ad77214..4e054338 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -200,7 +200,7 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod -# cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod From a828ff79a49fc8cefb1fa81225fd2d31f2798705 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 8 Oct 2016 17:02:46 +0100 Subject: [PATCH 075/140] Implement Out.Real and Out.LongReal. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-44/Out.h | 3 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-48/Out.h | 3 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/unix-88/Out.h | 3 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/windows-48/Out.h | 3 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 267 +++++++++++++++++++++++++-- bootstrap/windows-88/Out.h | 3 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Math.Mod | 24 +-- src/runtime/MathL.Mod | 2 +- src/runtime/Out.Mod | 194 ++++++++++++++++++- src/tools/make/oberon.mk | 5 +- 199 files changed, 1670 insertions(+), 285 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index dcdaea0d..cb7920a3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index d902e57e..4a49d744 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index b214554c..f9666e9a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a550ad52..3ba187a5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index eee301c1..a96c77e9 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index adb24e10..340d4654 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index ca5c6c89..0992f4eb 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index dcdaea0d..cb7920a3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index d902e57e..4a49d744 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 911d49ab..7ebdfd73 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a550ad52..3ba187a5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index eee301c1..a96c77e9 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index f6698990..92376713 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index baa9464f..107cdc6c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 05693822..2324bd31 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 74b0c2ac..5156a13d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index d929bf31..e3aceaf6 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c0f06627..29ed6e2f 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3f625202..273f6c11 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 69eb0109..ec6acf95 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index aa541ba7..ddd0d49c 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5adea265..60915d55 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 8a61c677..e3b8aff9 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 66f4fc90..37cb4c91 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(1, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 79765125..feddb176 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ff4f1129..ffacb767 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ebb0ff54..0d2f319e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index b75c50d4..4b01b650 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index d994f80e..a444fff2 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ee2c6a91..a447dbad 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index bf247ca6..860107f9 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 2b27eb13..84c9bb20 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 19cf402a..ab3bb29b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 8430bf82..7da9b7b0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 016b40ed..768bfd2c 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 911d49ab..7ebdfd73 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 65f5d6d9..ce5e3036 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6ea96ec6..790b4f75 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(Platform_StdOut, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index f88bbad9..3e82ab82 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e1231b49..c5ff14b6 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index f6698990..92376713 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index baa9464f..107cdc6c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f176c32c..2dd6f251 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index cd60e0eb..3498204c 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 51248a3a..14d86591 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 06562971..dd50c47a 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f2adf7f8..99068de9 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index d929bf31..e3aceaf6 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c0f06627..29ed6e2f 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3f625202..273f6c11 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index eb8d7d25..95fc4f94 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4df43c2a..bfc64251 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index bab5adcc..d04325c7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index fd8f546f..54cd9a85 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 662ac74a..69a5580c 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 69eb0109..ec6acf95 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d7aadb69..d2a06df9 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index aa541ba7..ddd0d49c 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 90da6ba9..ee87db69 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index f7f892bf..02c301dc 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d97f3caa..98dd65e7 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5adea265..60915d55 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 88225ce2..f5b615f8 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 8a61c677..e3b8aff9 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ab72377c..43fd6331 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6ea96ec6..790b4f75 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Platform.h" +#include "Strings.h" @@ -18,7 +19,13 @@ export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); export void Out_String (CHAR *str, LONGINT str__len); +export REAL Out_Ten (int16 e); +static LONGREAL Out_TenL (int16 e); +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +#define Out_Entier32(x) (int32)(x) +#define Out_Entier64(x) (int64)(x) void Out_Open (void) { @@ -36,7 +43,7 @@ void Out_String (CHAR *str, LONGINT str__len) int16 error; __DUP(str, str__len, CHAR); l = 0; - while ((l < str__len && str[l] != 0x00)) { + while ((l < str__len && str[__X(l, str__len)] != 0x00)) { l += 1; } error = Platform_Write(Platform_StdOut, (address)str, l); @@ -60,13 +67,13 @@ void Out_Int (int64 x, int64 n) x = __DIV(x, 10); i = 1; while (x != 0) { - s[i] = (CHAR)(48 + __MOD(x, 10)); + s[__X(i, 22)] = (CHAR)(48 + __MOD(x, 10)); x = __DIV(x, 10); i += 1; } } if (negative) { - s[i] = '-'; + s[__X(i, 22)] = '-'; i += 1; } while (n > (int64)i) { @@ -75,28 +82,262 @@ void Out_Int (int64 x, int64 n) } while (i > 0) { i -= 1; - Out_Char(s[i]); + Out_Char(s[__X(i, 22)]); } } -void Out_Real (REAL x, int16 n) -{ -} - -void Out_LongReal (LONGREAL x, int16 n) -{ -} - void Out_Ln (void) { Out_String(Platform_NL, 3); } +static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +{ + *i -= 1; + s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); +} + +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +{ + int16 j, l; + __DUP(t, t__len, CHAR); + l = Strings_Length(t, t__len); + if (l > *i) { + l = *i; + } + *i -= l; + j = 0; + while (j < l) { + s[__X(*i + j, s__len)] = t[__X(j, t__len)]; + j += 1; + } + __DEL(t); +} + +REAL Out_Ten (int16 e) +{ + REAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_Real (REAL x, int16 n) +{ + int16 e; + int32 f; + CHAR s[30]; + int16 i; + REAL x0; + BOOLEAN nn, en; + int32 m; + int16 d; + nn = __VAL(int32, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); + f = __MASK(__VAL(int32, x), -8388608); + i = 30; + if (e == 255) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = __ASHR((e - 127) * 77, 8); + if (e >= 0) { + x = x / (REAL)Out_Ten(e); + } else { + x = Out_Ten(-e) * x; + } + if (x >= (REAL)10) { + x = 1.0000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 2; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); + } + x0 = Out_Ten(7); + x = x0 * x + 5.0000000e-001; + if (x >= (REAL)10 * x0) { + x = 1.0000000e-001 * x; + e += 1; + } + m = Out_Entier32(x); + } + d = 8; + while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + +static LONGREAL Out_TenL (int16 e) +{ + LONGREAL _o_result; + LONGREAL r, power; + r = (LONGREAL)1; + power = (LONGREAL)10; + while (e > 0) { + if (__ODD(e)) { + r = r * power; + } + power = power * power; + e = __ASHR(e, 1); + } + _o_result = r; + return _o_result; +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + int16 e; + int64 f; + CHAR s[30]; + int16 i; + LONGREAL x0; + BOOLEAN nn, en; + int64 m; + int16 d; + nn = __VAL(int64, x) < 0; + if (nn) { + n -= 1; + } + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + i = 30; + if (e == 2047) { + if (f == 0) { + Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); + } + } else { + if (e == 0) { + Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + m = 0; + } else { + if (nn) { + x = -x; + } + e = (int16)__ASHR((e - 1023) * 77, 8); + if (e >= 0) { + x = x / (LONGREAL)Out_TenL(e); + } else { + x = Out_TenL(-e) * x; + } + if (x >= (LONGREAL)10) { + x = 1.00000000000000e-001 * x; + e += 1; + } + en = e < 0; + if (en) { + e = -e; + } + d = 3; + while (d > 0) { + Out_digit(e, (void*)s, 30, &i); + e = __DIV(e, 10); + d -= 1; + } + if (en) { + Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + } else { + Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + } + x0 = Out_TenL(15); + x = x0 * x + 5.00000000000000e-001; + if (x >= (LONGREAL)10 * x0) { + x = 1.00000000000000e-001 * x; + e += 1; + } + m = Out_Entier64(x); + } + d = 16; + while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + m = __DIV(m, 10); + d -= 1; + } + while (d > 1) { + Out_digit(m, (void*)s, 30, &i); + m = __DIV(m, 10); + d -= 1; + } + i -= 1; + s[__X(i, 30)] = '.'; + Out_digit(m, (void*)s, 30, &i); + } + n -= 30 - i; + while (n > 0) { + Out_Char(' '); + n -= 1; + } + if (nn) { + Out_Char('-'); + } + while (i < 30) { + Out_Char(s[__X(i, 30)]); + i += 1; + } +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); + __MODULE_IMPORT(Strings); __REGMOD("Out", 0); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 4d3199e6..9076f6d1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -15,6 +15,7 @@ import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); +import REAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e99e1be2..6f3c4e4f 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 04c87a8c..1008cc4b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 7d395538..4e18ac01 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 98731ba9..5728d211 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 7d4bf19a..37643e92 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 939e74d8..b7482150 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ebb0ff54..0d2f319e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index b75c50d4..4b01b650 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 49c6425d..5ecfeea1 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index e7ecd052..20eeca0d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b58bcc2a..b1328b1c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index cb8a5a95..27684ca4 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 92ed02e4..a2c7b023 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 393203ef..83b8a893 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/04]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Math.Mod b/src/runtime/Math.Mod index 216275ef..b3ca4e6a 100644 --- a/src/runtime/Math.Mod +++ b/src/runtime/Math.Mod @@ -271,7 +271,7 @@ END div; PROCEDURE^ arctan2* (xn, xd: REAL): REAL; PROCEDURE^ sincos* (x: REAL; VAR Sin, Cos: REAL); -PROCEDURE round * (x: REAL): LONGINT; +PROCEDURE round* (x: REAL): LONGINT; (* Returns the value of x rounded to the nearest integer *) BEGIN IF x < ZERO THEN RETURN -ENTIER(HALF - x) @@ -279,7 +279,7 @@ BEGIN END END round; -PROCEDURE sqrt * (x: REAL): REAL; +PROCEDURE sqrt* (x: REAL): REAL; (* Returns the positive square root of x where x >= 0 *) CONST P0 = 0.41731; P1 = 0.59016; @@ -306,7 +306,7 @@ BEGIN RETURN scale(yEst, xExp DIV 2) END sqrt; -PROCEDURE exp * (x: REAL): REAL; +PROCEDURE exp* (x: REAL): REAL; (* Returns the exponential of x for x < Ln(MAX(REAL)) *) CONST ln2 = 0.6931471805599453094172321D0; @@ -328,7 +328,7 @@ BEGIN RETURN scale(HALF + p/(q - p), SHORT(n + 1)) END exp; -PROCEDURE ln * (x: REAL): REAL; +PROCEDURE ln* (x: REAL): REAL; (* Returns the natural logarithm of x for x > 0 *) CONST c1 = 355.0/512.0; c2 = -2.121944400546905827679E-4; @@ -354,7 +354,7 @@ END ln; (* The angle in all trigonometric functions is measured in radians *) -PROCEDURE sin * (x: REAL): REAL; +PROCEDURE sin* (x: REAL): REAL; (* Returns the sine of x for all x *) BEGIN IF x < ZERO THEN RETURN SinCos(x, -x, -ONE) @@ -362,13 +362,13 @@ BEGIN END END sin; -PROCEDURE cos * (x: REAL): REAL; +PROCEDURE cos* (x: REAL): REAL; (* Returns the cosine of x for all x *) BEGIN RETURN SinCos(x, ABS(x) + piByTwo, ONE) END cos; -PROCEDURE tan * (x: REAL): REAL; +PROCEDURE tan* (x: REAL): REAL; (* Returns the tangent of x where x cannot be an odd multiple of pi/2 *) CONST ymax = 6434; (* ENTIER(2 * *(MantBits/2) * pi/2) *) @@ -428,7 +428,7 @@ BEGIN END END asincos; -PROCEDURE arcsin * (x: REAL): REAL; +PROCEDURE arcsin* (x: REAL): REAL; (* Returns the arcsine of x, in the range [ - pi/2, pi/2] where -1 <= x <= 1 *) VAR res: REAL; i: LONGINT; @@ -442,7 +442,7 @@ BEGIN RETURN res END arcsin; -PROCEDURE arccos * (x: REAL): REAL; +PROCEDURE arccos* (x: REAL): REAL; (* Returns the arccosine of x, in the range [0, pi] where -1 <= x <= 1 *) VAR res: REAL; i: LONGINT; @@ -497,7 +497,7 @@ BEGIN RETURN res END atan; -PROCEDURE arctan * (x: REAL): REAL; +PROCEDURE arctan* (x: REAL): REAL; (* Returns the arctangent of x, in the range [ - pi/2, pi/2] for all x *) BEGIN IF x < 0 THEN RETURN -atan( - x) @@ -505,7 +505,7 @@ BEGIN END END arctan; -PROCEDURE power * (base, exp: REAL): REAL; +PROCEDURE power* (base, exp: REAL): REAL; (* Returns the value of the number base raised to the power exponent for base > 0 *) CONST P1 = 0.83357541E-1; K = 0.4426950409; @@ -558,7 +558,7 @@ BEGIN RETURN scale(z, SHORT(mp)) END power; -PROCEDURE IsRMathException * (): BOOLEAN; +PROCEDURE IsRMathException* (): BOOLEAN; (* Returns TRUE if the current coroutine is in the exceptional execution state because of the raising of the RealMath exception; otherwise returns FALSE. *) diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index c3355d2e..69f994bb 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -96,7 +96,7 @@ CONST ONE = 1.0D0; HALF = 0.5D0; TWO = 2.0D0; - miny = ONE/large; (* Smallest number this package accepts *) + miny = ONE/large; (* Smallest number this package accepts *) sqrtHalf = 0.70710678118654752440D0; Limit = 1.0536712D-8; (* 2**(-MantBits/2) *) eps = 5.5511151D-17; (* 2**(-MantBits-1) *) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 66db1944..72287c56 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,6 +1,6 @@ -MODULE Out; (* D C W Brown. 2016-09-27 *) +MODULE Out; (* DCW Brown. 2016-09-27 *) - IMPORT SYSTEM, Platform; +IMPORT SYSTEM, Platform, Strings; PROCEDURE Open*; BEGIN @@ -40,16 +40,190 @@ BEGIN WHILE i > 0 DO DEC(i); Char(s[i]) END END Int; -PROCEDURE Real*(x: REAL; n: INTEGER); -BEGIN -END Real; - -PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); -BEGIN -END LongReal; - PROCEDURE Ln*; BEGIN String(Platform.NL) END Ln; + +(* Real and Longreal display *) + +PROCEDURE digit(n: HUGEINT; VAR s: ARRAY OF CHAR; VAR i: INTEGER); +BEGIN + DEC(i); s[i] := CHR(n MOD 10 + 48); +END digit; + +PROCEDURE prepend(t: ARRAY OF CHAR; VAR s: ARRAY OF CHAR; VAR i: INTEGER); + VAR j, l: INTEGER; +BEGIN + l := Strings.Length(t); IF l > i THEN l := i END; + DEC(i, l); j := 0; + WHILE j < l DO s[i+j] := t[j]; INC(j) END +END prepend; + + +PROCEDURE Ten*(e: INTEGER): REAL; +VAR r, power: LONGREAL; +BEGIN r := 1.0; power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r*power END; + power := power*power; e := e DIV 2 + END; + RETURN SHORT(r) +END Ten; + +PROCEDURE -Entier32(x: REAL): SYSTEM.INT32 "(int32)(x)"; + +PROCEDURE Real*(x: REAL; n: INTEGER); + +(* Real(x, n) writes the real number x to the end of the output stream using an + exponential form. If the textual representation of x requires m characters (including a + two-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded + with blanks at the left end. A plus sign of the mantissa is not written. + REAL is 1/sign, 8/exponent, 23/significand *) + +CONST + maxsigdigits = 8; (* Max significant digits to display from mantissa *) + +VAR + e: INTEGER; (* Exponent field *) + f: SYSTEM.INT32; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + x0: REAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: SYSTEM.INT32; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + +BEGIN + nn := SYSTEM.VAL(SYSTEM.INT32, x) < 0; IF nn THEN DEC(n) END; + e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(SYSTEM.INT32, x) DIV 800000H) MOD 100H); + f := SYSTEM.VAL(SYSTEM.INT32, x) MOD 800000H; + + i := LEN(s); + IF e = 0FFH THEN (* NaN / Infinity *) + IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END + ELSE + IF e = 0 THEN prepend("E+00", s, i); m := 0; + ELSE + IF nn THEN x := -x END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := (e - 127) * 77 DIV 256; + IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; + IF x >= 10.0 THEN x := 0.1 * x; INC(e) END; + + (* Generate the exponent digits *) + en := e < 0; IF en THEN e := - e END; + d := 2; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + IF en THEN prepend("E-", s, i) ELSE prepend("E+", s, i) END; + + (* Scale x to 8 significant digits *) + x0 := Ten(maxsigdigits-1); x := x0*x + 0.5; + IF x >= 10.0*x0 THEN x := 0.1*x; INC(e) END; + m := Entier32(x) + END; + + (* Drop trailing zeroes where we don't have room *) + d := maxsigdigits; + WHILE (d > 2) & (d > n-5) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + + (* Render significant digits *) + WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; + DEC(i); s[i] := '.'; + digit(m, s, i); + END; + + (* Generate leading padding *) + DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; + + (* Render prepared number from right end of buffer s *) + IF nn THEN Char("-") END; + WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END Real; + + +PROCEDURE TenL(e: INTEGER): LONGREAL; + VAR r, power: LONGREAL; +BEGIN r := 1.0; power := 10.0; + WHILE e > 0 DO + IF ODD(e) THEN r := r*power END; + power := power*power; e := e DIV 2; + END; + RETURN r +END TenL; + +PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); + +(* LongReal(x, n) writes the long real number x to the end of the output stream using an + exponential form. If the textual representation of x requires m characters (including a + three-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded + with blanks at the left end. A plus sign of the mantissa is not written. + LONGREAL is 1/sign, 11/exponent, 52/significand *) + +CONST + maxsigdigits = 16; (* Max significant digits to display from mantissa *) + +VAR + e: INTEGER; (* Exponent field *) + f: HUGEINT; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + x0: LONGREAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: HUGEINT; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + +BEGIN + nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; + e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(HUGEINT, x) DIV 10000000000000H) MOD 800H); + f := SYSTEM.VAL(HUGEINT, x) MOD 10000000000000H; + + i := LEN(s); + IF e = 7FFH THEN (* NaN / Infinity *) + IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END + ELSE + IF e = 0 THEN prepend("D+000", s, i); m := 0; + ELSE + IF nn THEN x := -x END; + + (* Scale e to be an exponent of 10 rather than 2 *) + e := SHORT(LONG(e - 1023) * 77 DIV 256); + IF e >= 0 THEN x := x / TenL(e) ELSE x := TenL(-e) * x END ; + IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; + + (* Generate the exponent digits *) + en := e < 0; IF en THEN e := - e END; + d := 3; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + IF en THEN prepend("D-", s, i) ELSE prepend("D+", s, i) END; + + (* Scale x to 15 significant digits *) + x0 := TenL(maxsigdigits-1); + x := x0 * x + 0.5D0; + IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; + m := Entier64(x) + END; + + (* Drop trailing zeroes where we don't have room *) + d := maxsigdigits; + WHILE (d > 2) & (d > n-6) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + + (* Render significant digits *) + WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; + DEC(i); s[i] := '.'; + digit(m, s, i); + END; + + (* Generate leading padding *) + DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; + + (* Render prepared number from right end of buffer s *) + IF nn THEN Char("-") END; + WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END LongReal; + + END Out. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 4e054338..b8688337 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -104,8 +104,8 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod @@ -195,9 +195,9 @@ runtime: cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod @@ -387,6 +387,7 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" +# cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) From ebd1a2e695ad423685465bc48e4a77135b2a60de Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 8 Oct 2016 17:30:44 +0100 Subject: [PATCH 076/140] Add tests for Out.Real, Out.LongReal. --- makefile | 2 +- src/test/confidence/out/expected | 190 ++++++++++++++++++++++++++++ src/test/confidence/out/outtest.mod | 119 +++++++++++++++++ src/test/confidence/out/result-O2 | 93 ++++++++++++++ src/test/confidence/out/result-OC | 93 ++++++++++++++ src/test/confidence/out/test.sh | 15 +++ src/tools/make/oberon.mk | 1 + 7 files changed, 512 insertions(+), 1 deletion(-) create mode 100644 src/test/confidence/out/expected create mode 100644 src/test/confidence/out/outtest.mod create mode 100644 src/test/confidence/out/result-O2 create mode 100644 src/test/confidence/out/result-OC create mode 100644 src/test/confidence/out/test.sh diff --git a/makefile b/makefile index 82c50d44..b8323eea 100644 --- a/makefile +++ b/makefile @@ -239,7 +239,7 @@ uninstall: configuration # confidence: Run a set of confidence tests confidence: configuration - @make -f src/tools/make/oberon.mk -s confidence + @make -f src/tools/make/oberon.mk -s confidence MODEL=2 planned-binary-change: @date >src/test/confidence/planned-binary-change diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected new file mode 100644 index 00000000..5343a884 --- /dev/null +++ b/src/test/confidence/out/expected @@ -0,0 +1,190 @@ +--- Testing with Oberon 2 variable model --- +Out module tests. +SIZE(INTEGER) = 2 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +--- Testing with Component Pascal variable model --- +Out module tests. +SIZE(INTEGER) = 4 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod new file mode 100644 index 00000000..b2a00669 --- /dev/null +++ b/src/test/confidence/out/outtest.mod @@ -0,0 +1,119 @@ +MODULE outtest; + +IMPORT Out; + +VAR + r: REAL; + lr: LONGREAL; + +PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; +PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; +PROCEDURE wl; BEGIN Out.Ln END wl; + + +BEGIN + ws("Out module tests."); wl; + ws("SIZE(INTEGER) = "); wi(SIZE(INTEGER)); wl; wl; + + ws("Testing LONGREAL."); wl; wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 1); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 1); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 1); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 1); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 1); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 1); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 1); wl; + ws(" 0.0: "); Out.LongReal(0.0, 1); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 1); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 1); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 1); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 12); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 12); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 12); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 12); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 12); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 12); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 12); wl; + ws(" 0.0: "); Out.LongReal(0.0, 12); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 12); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 12); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 12); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 30); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 30); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 30); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 30); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 30); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 30); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 30); wl; + ws(" 0.0: "); Out.LongReal(0.0, 30); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 30); wl; + lr := 0.0; lr := 1/lr; + ws(" 1/0.0: "); Out.LongReal(lr, 30); wl; + lr := 0.0; lr := -1/lr; + ws("-1/0.0: "); Out.LongReal(lr, 30); wl; + wl; wl; wl; + + + ws("Testing REAL."); wl; wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 1); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 1); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 1); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 1); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 1); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 1); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 1); wl; + ws(" 0.0: "); Out.Real(0.0, 1); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 1); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 1); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 1); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 12); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 12); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 12); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 12); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 12); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 12); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 12); wl; + ws(" 0.0: "); Out.Real(0.0, 12); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 12); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 12); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 12); wl; + wl; + ws(" 1 2 3"); wl; + ws(" 123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 30); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 30); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 30); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 30); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 30); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 30); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 30); wl; + ws(" 0.0: "); Out.Real(0.0, 30); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 30); wl; + r := 0.0; r := 1/r; + ws(" 1/0.0: "); Out.Real(r, 30); wl; + r := 0.0; r := -1/r; + ws("-1/0.0: "); Out.Real(r, 30); wl; + wl; + +END outtest. diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 new file mode 100644 index 00000000..1121e4ae --- /dev/null +++ b/src/test/confidence/out/result-O2 @@ -0,0 +1,93 @@ +Out module tests. +SIZE(INTEGER) = 2 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC new file mode 100644 index 00000000..8713aa8e --- /dev/null +++ b/src/test/confidence/out/result-OC @@ -0,0 +1,93 @@ +Out module tests. +SIZE(INTEGER) = 4 + +Testing LONGREAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.0D+000 + 1.1D0: 1.1D+000 + 2.1D0: 2.1D+000 +-1.1D0: -1.1D+000 + 1.1D3: 1.1D+003 + 1.1D-3: 1.1D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.0D+000 + 0.000123D0: 1.23D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.00000D+000 + 1.1D0: 1.10000D+000 + 2.1D0: 2.10000D+000 +-1.1D0: -1.1000D+000 + 1.1D3: 1.10000D+003 + 1.1D-3: 1.10000D-003 + 1.2345678987654321D3: 1.23456789876543D+003 + 0.0: 0.00000D+000 + 0.000123D0: 1.23000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0D0: 1.000000000000000D+000 + 1.1D0: 1.100000000000000D+000 + 2.1D0: 2.100000000000000D+000 +-1.1D0: -1.100000000000000D+000 + 1.1D3: 1.100000000000000D+003 + 1.1D-3: 1.100000000000000D-003 + 1.2345678987654321D3: 1.234567898765430D+003 + 0.0: 0.000000000000000D+000 + 0.000123D0: 1.230000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + + + +Testing REAL. + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0E+00 + 1.1E0: 1.1E+00 + 2.1E0: 2.1E+00 +-1.1E0: -1.1E+00 + 1.1E3: 1.1E+03 + 1.1E-3: 1.1E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.0E+00 + 0.000123E0: 1.23E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.10000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + + 1 2 3 + 123456789012345678901234567890 + 1.0E0: 1.0000000E+00 + 1.1E0: 1.1000000E+00 + 2.1E0: 2.1000000E+00 +-1.1E0: -1.1000000E+00 + 1.1E3: 1.1000000E+03 + 1.1E-3: 1.1000000E-03 + 1.2345678987654321E3: 1.2345680E+03 + 0.0: 0.0000000E+00 + 0.000123E0: 1.2300000E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + diff --git a/src/test/confidence/out/test.sh b/src/test/confidence/out/test.sh new file mode 100644 index 00000000..48198a64 --- /dev/null +++ b/src/test/confidence/out/test.sh @@ -0,0 +1,15 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP outtest.mod -m -O2 +#../../../../voc outtest.mod -m -O2 +./outtest >result-O2 +$OBECOMP outtest.mod -m -OC +#../../../../voc outtest.mod -m -OC +./outtest >result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index b8688337..d8a8dd6b 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -389,6 +389,7 @@ confidence: @printf "\n\n--- Confidence tests ---\n\n" # cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) From ee77ec43ca8805aeccf654adf12c72dc08b49c6e Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 11:42:22 +0100 Subject: [PATCH 077/140] Out.Mod. Add buffer, simplify real output. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 224 +++++++++++---------------- bootstrap/unix-44/Out.h | 5 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 17 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 224 +++++++++++---------------- bootstrap/unix-48/Out.h | 5 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 17 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 224 +++++++++++---------------- bootstrap/unix-88/Out.h | 5 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 17 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 224 +++++++++++---------------- bootstrap/windows-48/Out.h | 5 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 17 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 224 +++++++++++---------------- bootstrap/windows-88/Out.h | 5 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 17 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Out.Mod | 170 ++++++++------------ src/runtime/Strings.Mod | 6 +- src/test/confidence/out/expected | 36 ++--- src/test/confidence/out/result-O2 | 18 +-- src/test/confidence/out/result-OC | 18 +-- 200 files changed, 803 insertions(+), 1045 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index cb7920a3..c983396b 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4a49d744..ba64fc56 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f9666e9a..9ec11e5d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 3ba187a5..0667398d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a96c77e9..4897b84e 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 340d4654..6fd83b96 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 0992f4eb..82b41cda 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index cb7920a3..c983396b 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4a49d744..ba64fc56 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 7ebdfd73..55178203 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 3ba187a5..0667398d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a96c77e9..4897b84e 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 92376713..421c5f47 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 107cdc6c..e27e5f53 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2324bd31..00efd9fc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5156a13d..1e455c40 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index e3aceaf6..b09688eb 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 29ed6e2f..a5b2fe18 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 273f6c11..73f0a95b 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index ec6acf95..f377d2a5 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ddd0d49c..5c4e3c07 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 60915d55..3e3e97fb 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index e3b8aff9..fd84941f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 37cb4c91..3df836a0 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(1, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(1, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(1, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(1, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index feddb176..ddd65b5f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ffacb767..f2194f3c 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 0d2f319e..ce4a885a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 4b01b650..26669d1c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a444fff2..0c55ce0a 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a447dbad..8cee9102 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 860107f9..8758813f 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 84c9bb20..bcf77f96 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index ab3bb29b..5302c9f4 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 7da9b7b0..abb65cd0 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 768bfd2c..10e8168f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 7ebdfd73..55178203 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index ce5e3036..96075563 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 790b4f75..b21d426b 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(Platform_StdOut, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(Platform_StdOut, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(Platform_StdOut, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 3e82ab82..d50ae9ec 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c5ff14b6..3aa708ca 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 92376713..421c5f47 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 107cdc6c..e27e5f53 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 2dd6f251..b303a7c4 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 3498204c..8ac138be 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 14d86591..207eeb63 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index dd50c47a..b9443fd9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 99068de9..98e13fc1 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index e3aceaf6..b09688eb 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 29ed6e2f..a5b2fe18 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 273f6c11..73f0a95b 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 95fc4f94..abb938ae 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bfc64251..3233aa7b 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d04325c7..6931fe6e 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 54cd9a85..48f0d967 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 69a5580c..40825f04 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index ec6acf95..f377d2a5 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d2a06df9..e18ab6ff 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ddd0d49c..5c4e3c07 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ee87db69..49d03b82 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 02c301dc..288a081d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 98dd65e7..bc45e385 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 60915d55..3e3e97fb 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f5b615f8..95947e81 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index e3b8aff9..fd84941f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 43fd6331..0d54d226 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 790b4f75..b21d426b 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -7,34 +7,63 @@ #include "SYSTEM.h" #include "Platform.h" -#include "Strings.h" +static CHAR Out_buf[128]; +static int16 Out_in; export void Out_Char (CHAR ch); +export void Out_Flush (void); export void Out_Int (int64 x, int64 n); +static int32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); export void Out_String (CHAR *str, LONGINT str__len); -export REAL Out_Ten (int16 e); -static LONGREAL Out_TenL (int16 e); +export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); -#define Out_Entier32(x) (int32)(x) #define Out_Entier64(x) (int64)(x) +void Out_Flush (void) +{ + int16 error; + if (Out_in > 0) { + error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + } + Out_in = 0; +} + void Out_Open (void) { } void Out_Char (CHAR ch) { - int16 error; - error = Platform_Write(Platform_StdOut, (address)&ch, 1); + if (Out_in >= 128) { + Out_Flush(); + } + Out_buf[__X(Out_in, 128)] = ch; + Out_in += 1; + if (ch == 0x0a) { + Out_Flush(); + } +} + +static int32 Out_Length (CHAR *s, LONGINT s__len) +{ + int32 _o_result; + int32 l; + l = 0; + while ((l < s__len && s[__X(l, s__len)] != 0x00)) { + l += 1; + } + _o_result = l; + return _o_result; } void Out_String (CHAR *str, LONGINT str__len) @@ -42,11 +71,16 @@ void Out_String (CHAR *str, LONGINT str__len) int32 l; int16 error; __DUP(str, str__len, CHAR); - l = 0; - while ((l < str__len && str[__X(l, str__len)] != 0x00)) { - l += 1; + l = Out_Length((void*)str, str__len); + if (Out_in + l > 128) { + Out_Flush(); + } + if (l > 128) { + error = Platform_Write(Platform_StdOut, (address)str, l); + } else { + __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + Out_in += (int16)l; } - error = Platform_Write(Platform_StdOut, (address)str, l); __DEL(str); } @@ -89,6 +123,7 @@ void Out_Int (int64 x, int64 n) void Out_Ln (void) { Out_String(Platform_NL, 3); + Out_Flush(); } static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) @@ -99,13 +134,14 @@ static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) { - int16 j, l; + int16 j; + int32 l; __DUP(t, t__len, CHAR); - l = Strings_Length(t, t__len); + l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= l; + *i -= (int16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -114,116 +150,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -REAL Out_Ten (int16 e) -{ - REAL _o_result; - LONGREAL r, power; - r = (LONGREAL)1; - power = (LONGREAL)10; - while (e > 0) { - if (__ODD(e)) { - r = r * power; - } - power = power * power; - e = __ASHR(e, 1); - } - _o_result = r; - return _o_result; -} - -void Out_Real (REAL x, int16 n) -{ - int16 e; - int32 f; - CHAR s[30]; - int16 i; - REAL x0; - BOOLEAN nn, en; - int32 m; - int16 d; - nn = __VAL(int32, x) < 0; - if (nn) { - n -= 1; - } - e = (int16)__MASK(__ASHR(__VAL(int32, x), 23), -256); - f = __MASK(__VAL(int32, x), -8388608); - i = 30; - if (e == 255) { - if (f == 0) { - Out_prepend((CHAR*)"Infinity", 9, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); - } - } else { - if (e == 0) { - Out_prepend((CHAR*)"E+00", 5, (void*)s, 30, &i); - m = 0; - } else { - if (nn) { - x = -x; - } - e = __ASHR((e - 127) * 77, 8); - if (e >= 0) { - x = x / (REAL)Out_Ten(e); - } else { - x = Out_Ten(-e) * x; - } - if (x >= (REAL)10) { - x = 1.0000000e-001 * x; - e += 1; - } - en = e < 0; - if (en) { - e = -e; - } - d = 2; - while (d > 0) { - Out_digit(e, (void*)s, 30, &i); - e = __DIV(e, 10); - d -= 1; - } - if (en) { - Out_prepend((CHAR*)"E-", 3, (void*)s, 30, &i); - } else { - Out_prepend((CHAR*)"E+", 3, (void*)s, 30, &i); - } - x0 = Out_Ten(7); - x = x0 * x + 5.0000000e-001; - if (x >= (REAL)10 * x0) { - x = 1.0000000e-001 * x; - e += 1; - } - m = Out_Entier32(x); - } - d = 8; - while ((((d > 2 && d > n - 5)) && (int)__MOD(m, 10) == 0)) { - m = __DIV(m, 10); - d -= 1; - } - while (d > 1) { - Out_digit(m, (void*)s, 30, &i); - m = __DIV(m, 10); - d -= 1; - } - i -= 1; - s[__X(i, 30)] = '.'; - Out_digit(m, (void*)s, 30, &i); - } - n -= 30 - i; - while (n > 0) { - Out_Char(' '); - n -= 1; - } - if (nn) { - Out_Char('-'); - } - while (i < 30) { - Out_Char(s[__X(i, 30)]); - i += 1; - } -} - -static LONGREAL Out_TenL (int16 e) +LONGREAL Out_Ten (int16 e) { LONGREAL _o_result; LONGREAL r, power; @@ -240,7 +167,7 @@ static LONGREAL Out_TenL (int16 e) return _o_result; } -void Out_LongReal (LONGREAL x, int16 n) +static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) { int16 e; int64 f; @@ -249,7 +176,7 @@ void Out_LongReal (LONGREAL x, int16 n) LONGREAL x0; BOOLEAN nn, en; int64 m; - int16 d; + int16 d, dr; nn = __VAL(int64, x) < 0; if (nn) { n -= 1; @@ -265,7 +192,15 @@ void Out_LongReal (LONGREAL x, int16 n) } } else { if (e == 0) { - Out_prepend((CHAR*)"D+000", 6, (void*)s, 30, &i); + d = i - exponentdigits; + while (i > d) { + i -= 1; + s[__X(i, 30)] = '0'; + } + i -= 1; + s[__X(i, 30)] = '+'; + i -= 1; + s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -273,9 +208,9 @@ void Out_LongReal (LONGREAL x, int16 n) } e = (int16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { - x = x / (LONGREAL)Out_TenL(e); + x = x / (LONGREAL)Out_Ten(e); } else { - x = Out_TenL(-e) * x; + x = Out_Ten(-e) * x; } if (x >= (LONGREAL)10) { x = 1.00000000000000e-001 * x; @@ -285,18 +220,21 @@ void Out_LongReal (LONGREAL x, int16 n) if (en) { e = -e; } - d = 3; + d = exponentdigits; while (d > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); d -= 1; } + i -= 1; if (en) { - Out_prepend((CHAR*)"D-", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '-'; } else { - Out_prepend((CHAR*)"D+", 3, (void*)s, 30, &i); + s[__X(i, 30)] = '+'; } - x0 = Out_TenL(15); + i -= 1; + s[__X(i, 30)] = exp; + x0 = Out_Ten(maxsigdigits - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -304,8 +242,12 @@ void Out_LongReal (LONGREAL x, int16 n) } m = Out_Entier64(x); } - d = 16; - while ((((d > 2 && d > n - 6)) && __MOD(m, 10) == 0)) { + d = maxsigdigits; + dr = n - (exponentdigits + 3); + if (dr < 2) { + dr = 2; + } + while ((d > dr && __MOD(m, 10) == 0)) { m = __DIV(m, 10); d -= 1; } @@ -332,13 +274,23 @@ void Out_LongReal (LONGREAL x, int16 n) } } +void Out_Real (REAL x, int16 n) +{ + Out_RealP(x, n, 2, 7, 'E'); +} + +void Out_LongReal (LONGREAL x, int16 n) +{ + Out_RealP(x, n, 3, 16, 'D'); +} + export void *Out__init(void) { __DEFMOD; __MODULE_IMPORT(Platform); - __MODULE_IMPORT(Strings); __REGMOD("Out", 0); + __REGCMD("Flush", Out_Flush); __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 9076f6d1..362b4414 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -9,13 +9,14 @@ import void Out_Char (CHAR ch); +import void Out_Flush (void); import void Out_Int (int64 x, int64 n); import void Out_Ln (void); import void Out_LongReal (LONGREAL x, int16 n); import void Out_Open (void); import void Out_Real (REAL x, int16 n); import void Out_String (CHAR *str, LONGINT str__len); -import REAL Out_Ten (int16 e); +import LONGREAL Out_Ten (int16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6f3c4e4f..7efc77b3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 1008cc4b..52d679bb 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4e18ac01..8697b424 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 5728d211..e764f95f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 37643e92..8a95a8eb 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -24,15 +24,22 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { int16 _o_result; - int16 i; + int32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { i += 1; } - _o_result = i; - __DEL(s); - return _o_result; + if (i <= 32767) { + _o_result = (int16)i; + __DEL(s); + return _o_result; + } else { + _o_result = 32767; + __DEL(s); + return _o_result; + } + __RETCHK; } void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index b7482150..4989383b 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 0d2f319e..ce4a885a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 4b01b650..26669d1c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 5ecfeea1..408d5ec7 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 20eeca0d..b0247272 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b1328b1c..5df06422 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 27684ca4..ef0da35c 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index a2c7b023..65b16ccc 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 83b8a893..2211e981 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 72287c56..9463fef8 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -1,24 +1,46 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) -IMPORT SYSTEM, Platform, Strings; +IMPORT SYSTEM, Platform; + +VAR buf: ARRAY 128 OF CHAR; in: INTEGER; + +PROCEDURE Flush*; +VAR error: Platform.ErrorCode; +BEGIN + IF in > 0 THEN error := Platform.Write(Platform.StdOut, SYSTEM.ADR(buf), in) END; + in := 0; +END Flush; PROCEDURE Open*; BEGIN END Open; PROCEDURE Char*(ch: CHAR); - VAR error: Platform.ErrorCode; BEGIN - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(ch), 1) + IF in >= LEN(buf) THEN Flush END; + buf[in] := ch; INC(in); + IF ch = 0AX THEN Flush END; END Char; +PROCEDURE Length(VAR s: ARRAY OF CHAR): LONGINT; +VAR l: LONGINT; +BEGIN l := 0; WHILE (l < LEN(s)) & (s[l] # 0X) DO INC(l) END; RETURN l +END Length; + PROCEDURE String*(str: ARRAY OF CHAR); VAR l: LONGINT; error: Platform.ErrorCode; BEGIN - l := 0; WHILE (l < LEN(str)) & (str[l] # 0X) DO INC(l) END; - error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) + l := Length(str); + IF in + l > LEN(buf) THEN Flush END; + IF l > LEN(buf) THEN + (* Doesn't fit buf. Bypass buffering. *) + error := Platform.Write(Platform.StdOut, SYSTEM.ADR(str), l) + ELSE + SYSTEM.MOVE(SYSTEM.ADR(str), SYSTEM.ADR(buf[in]), l); INC(in, SHORT(l)); + END END String; + PROCEDURE Int*(x, n: HUGEINT); CONST zero = ORD('0'); VAR s: ARRAY 22 OF CHAR; i: INTEGER; negative: BOOLEAN; @@ -41,7 +63,7 @@ BEGIN END Int; PROCEDURE Ln*; -BEGIN String(Platform.NL) +BEGIN String(Platform.NL); Flush; END Ln; @@ -53,109 +75,27 @@ BEGIN END digit; PROCEDURE prepend(t: ARRAY OF CHAR; VAR s: ARRAY OF CHAR; VAR i: INTEGER); - VAR j, l: INTEGER; + VAR j: INTEGER; l: LONGINT; BEGIN - l := Strings.Length(t); IF l > i THEN l := i END; - DEC(i, l); j := 0; + l := Length(t); IF l > i THEN l := i END; + DEC(i, SHORT(l)); j := 0; WHILE j < l DO s[i+j] := t[j]; INC(j) END END prepend; -PROCEDURE Ten*(e: INTEGER): REAL; +PROCEDURE Ten*(e: INTEGER): LONGREAL; VAR r, power: LONGREAL; -BEGIN r := 1.0; power := 10.0; +BEGIN r := 1.0D0; power := 1.0D1; WHILE e > 0 DO IF ODD(e) THEN r := r*power END; power := power*power; e := e DIV 2 END; - RETURN SHORT(r) -END Ten; - -PROCEDURE -Entier32(x: REAL): SYSTEM.INT32 "(int32)(x)"; - -PROCEDURE Real*(x: REAL; n: INTEGER); - -(* Real(x, n) writes the real number x to the end of the output stream using an - exponential form. If the textual representation of x requires m characters (including a - two-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded - with blanks at the left end. A plus sign of the mantissa is not written. - REAL is 1/sign, 8/exponent, 23/significand *) - -CONST - maxsigdigits = 8; (* Max significant digits to display from mantissa *) - -VAR - e: INTEGER; (* Exponent field *) - f: SYSTEM.INT32; (* Fraction field *) - s: ARRAY 30 OF CHAR; (* Buffer built backwards *) - i: INTEGER; (* Index into s *) - x0: REAL; - nn: BOOLEAN; (* Number negative *) - en: BOOLEAN; (* Exponent negative *) - m: SYSTEM.INT32; (* Mantissa digits *) - d: INTEGER; (* Significant digit count to display *) - -BEGIN - nn := SYSTEM.VAL(SYSTEM.INT32, x) < 0; IF nn THEN DEC(n) END; - e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(SYSTEM.INT32, x) DIV 800000H) MOD 100H); - f := SYSTEM.VAL(SYSTEM.INT32, x) MOD 800000H; - - i := LEN(s); - IF e = 0FFH THEN (* NaN / Infinity *) - IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END - ELSE - IF e = 0 THEN prepend("E+00", s, i); m := 0; - ELSE - IF nn THEN x := -x END; - - (* Scale e to be an exponent of 10 rather than 2 *) - e := (e - 127) * 77 DIV 256; - IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; - IF x >= 10.0 THEN x := 0.1 * x; INC(e) END; - - (* Generate the exponent digits *) - en := e < 0; IF en THEN e := - e END; - d := 2; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; - IF en THEN prepend("E-", s, i) ELSE prepend("E+", s, i) END; - - (* Scale x to 8 significant digits *) - x0 := Ten(maxsigdigits-1); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN x := 0.1*x; INC(e) END; - m := Entier32(x) - END; - - (* Drop trailing zeroes where we don't have room *) - d := maxsigdigits; - WHILE (d > 2) & (d > n-5) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; - - (* Render significant digits *) - WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; - DEC(i); s[i] := '.'; - digit(m, s, i); - END; - - (* Generate leading padding *) - DEC(n, LEN(s)-i); WHILE n > 0 DO Char(" "); DEC(n) END; - - (* Render prepared number from right end of buffer s *) - IF nn THEN Char("-") END; - WHILE i < LEN(s) DO Char(s[i]); INC(i) END -END Real; - - -PROCEDURE TenL(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; -BEGIN r := 1.0; power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r*power END; - power := power*power; e := e DIV 2; - END; RETURN r -END TenL; +END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; -PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR); (* LongReal(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a @@ -163,9 +103,6 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); with blanks at the left end. A plus sign of the mantissa is not written. LONGREAL is 1/sign, 11/exponent, 52/significand *) -CONST - maxsigdigits = 16; (* Max significant digits to display from mantissa *) - VAR e: INTEGER; (* Exponent field *) f: HUGEINT; (* Fraction field *) @@ -176,6 +113,7 @@ VAR en: BOOLEAN; (* Exponent negative *) m: HUGEINT; (* Mantissa digits *) d: INTEGER; (* Significant digit count to display *) + dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; @@ -186,22 +124,32 @@ BEGIN IF e = 7FFH THEN (* NaN / Infinity *) IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END ELSE - IF e = 0 THEN prepend("D+000", s, i); m := 0; + IF e = 0 THEN + d := i - exponentdigits; WHILE i > d DO DEC(i); s[i] := "0" END; + DEC(i); s[i] := "+"; + DEC(i); s[i] := exp; + m := 0; ELSE IF nn THEN x := -x END; (* Scale e to be an exponent of 10 rather than 2 *) e := SHORT(LONG(e - 1023) * 77 DIV 256); - IF e >= 0 THEN x := x / TenL(e) ELSE x := TenL(-e) * x END ; + IF e >= 0 THEN x := x / Ten(e) ELSE x := Ten(-e) * x END ; IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; (* Generate the exponent digits *) en := e < 0; IF en THEN e := - e END; - d := 3; WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; - IF en THEN prepend("D-", s, i) ELSE prepend("D+", s, i) END; + d := exponentdigits; + WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + DEC(i); IF en THEN s[i] := "-" ELSE s[i] := "+" END; + DEC(i); s[i] := exp; - (* Scale x to 15 significant digits *) - x0 := TenL(maxsigdigits-1); + (* Todo: generate more than maxsigdigits if we have room for them *) + + (* Scale x to enoughsignificant digits to reliably test for trailing + zeroes. + todo or to the amount of space available, if greater. *) + x0 := Ten(maxsigdigits-1); x := x0 * x + 0.5D0; IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; m := Entier64(x) @@ -209,7 +157,9 @@ BEGIN (* Drop trailing zeroes where we don't have room *) d := maxsigdigits; - WHILE (d > 2) & (d > n-6) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; + dr := n - (exponentdigits + 3); (* 3 for '.', D/E and +/- *) + IF dr < 2 THEN dr := 2 END; + WHILE (d > dr) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; (* Render significant digits *) WHILE d > 1 DO digit(m, s, i); m := m DIV 10; DEC(d) END; @@ -223,7 +173,15 @@ BEGIN (* Render prepared number from right end of buffer s *) IF nn THEN Char("-") END; WHILE i < LEN(s) DO Char(s[i]); INC(i) END +END RealP; + + +PROCEDURE Real*(x: REAL; n: INTEGER); +BEGIN RealP(x, n, 2, 7, "E"); +END Real; + +PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); +BEGIN RealP(x, n, 3, 16, "D"); END LongReal; - END Out. diff --git a/src/runtime/Strings.Mod b/src/runtime/Strings.Mod index e6fe12ac..0dcfa6d2 100644 --- a/src/runtime/Strings.Mod +++ b/src/runtime/Strings.Mod @@ -32,10 +32,10 @@ MODULE Strings; (*HM 94-06-22 / *) PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; + VAR i: LONGINT; BEGIN - i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; - RETURN i + i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END; + IF i <= MAX(INTEGER) THEN RETURN SHORT(i) ELSE RETURN MAX(INTEGER) END END Length; diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index 5343a884..b71feae8 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -80,15 +80,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity @@ -176,15 +176,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 index 1121e4ae..78548b4d 100644 --- a/src/test/confidence/out/result-O2 +++ b/src/test/confidence/out/result-O2 @@ -79,15 +79,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC index 8713aa8e..fc82e517 100644 --- a/src/test/confidence/out/result-OC +++ b/src/test/confidence/out/result-OC @@ -79,15 +79,15 @@ Testing REAL. 1 2 3 123456789012345678901234567890 - 1.0E0: 1.0000000E+00 - 1.1E0: 1.1000000E+00 - 2.1E0: 2.1000000E+00 --1.1E0: -1.1000000E+00 - 1.1E3: 1.1000000E+03 - 1.1E-3: 1.1000000E-03 - 1.2345678987654321E3: 1.2345680E+03 - 0.0: 0.0000000E+00 - 0.000123E0: 1.2300000E-04 + 1.0E0: 1.000000E+00 + 1.1E0: 1.100000E+00 + 2.1E0: 2.100000E+00 +-1.1E0: -1.100000E+00 + 1.1E3: 1.100000E+03 + 1.1E-3: 1.100000E-03 + 1.2345678987654321E3: 1.234568E+03 + 0.0: 0.000000E+00 + 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity From fb3753c55d0acd09225fc4982768a3235a53f1a7 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 12:11:57 +0100 Subject: [PATCH 078/140] Add hard reset and clean to postpush script. --- src/tools/make/postpush.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index fe9e62ad..47956785 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -43,7 +43,7 @@ if ($buildneeded) { } else { close(STDIN); close(STDOUT); close(STDERR); # child process system 'echo Syncing voc>postpush.log'; - system '(cd voc; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; + system '(cd voc; git reset --hard; git clean -dfx; git pull; git checkout -f ' . $branch . '; git pull; git checkout -f) >>postpush.log'; exec 'perl voc/src/tools/make/buildall.pl ' . $branch . ' >/tmp/buildall.log'; exit; } From 1ef199dd933d4c1843b62405fb25d56f97b4cfcc Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 12:22:07 +0100 Subject: [PATCH 079/140] Add hard reset and clean to buildall script. --- src/tools/make/buildall.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 01f262c2..d4f36bd0 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -6,6 +6,7 @@ use Cwd; my $branch = "master"; + if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( @@ -14,7 +15,8 @@ my %machines = ( "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" . "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd vishaps/voc && git pull && git checkout $branch && git pull;" + . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" + . "git pull && git checkout $branch && git pull;" . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], @@ -55,7 +57,8 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && sudo git clean -dfx &&" + . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From 1a3364269eb8b619f2dbcbf9742010fc2ad84add Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 11 Oct 2016 15:35:37 +0100 Subject: [PATCH 080/140] Remove unwanted result files from git and correct use of sudo in buildall. --- .gitignore | 1 + src/test/confidence/out/result-O2 | 93 ------------------------------- src/test/confidence/out/result-OC | 93 ------------------------------- src/tools/make/buildall.pl | 2 +- 4 files changed, 2 insertions(+), 187 deletions(-) delete mode 100644 src/test/confidence/out/result-O2 delete mode 100644 src/test/confidence/out/result-OC diff --git a/.gitignore b/.gitignore index 2c05bb3a..db4032e0 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /src/test/**/*.sym **/*.stackdump /src/test/confidence/**/result +/src/test/confidence/**/result-* /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map diff --git a/src/test/confidence/out/result-O2 b/src/test/confidence/out/result-O2 deleted file mode 100644 index 78548b4d..00000000 --- a/src/test/confidence/out/result-O2 +++ /dev/null @@ -1,93 +0,0 @@ -Out module tests. -SIZE(INTEGER) = 2 - -Testing LONGREAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.0D+000 - 1.1D0: 1.1D+000 - 2.1D0: 2.1D+000 --1.1D0: -1.1D+000 - 1.1D3: 1.1D+003 - 1.1D-3: 1.1D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.0D+000 - 0.000123D0: 1.23D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.00000D+000 - 1.1D0: 1.10000D+000 - 2.1D0: 2.10000D+000 --1.1D0: -1.1000D+000 - 1.1D3: 1.10000D+003 - 1.1D-3: 1.10000D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.00000D+000 - 0.000123D0: 1.23000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - - -Testing REAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.0E+00 - 1.1E0: 1.1E+00 - 2.1E0: 2.1E+00 --1.1E0: -1.1E+00 - 1.1E3: 1.1E+03 - 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.0E+00 - 0.000123E0: 1.23E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.10000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - diff --git a/src/test/confidence/out/result-OC b/src/test/confidence/out/result-OC deleted file mode 100644 index fc82e517..00000000 --- a/src/test/confidence/out/result-OC +++ /dev/null @@ -1,93 +0,0 @@ -Out module tests. -SIZE(INTEGER) = 4 - -Testing LONGREAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.0D+000 - 1.1D0: 1.1D+000 - 2.1D0: 2.1D+000 --1.1D0: -1.1D+000 - 1.1D3: 1.1D+003 - 1.1D-3: 1.1D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.0D+000 - 0.000123D0: 1.23D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.00000D+000 - 1.1D0: 1.10000D+000 - 2.1D0: 2.10000D+000 --1.1D0: -1.1000D+000 - 1.1D3: 1.10000D+003 - 1.1D-3: 1.10000D-003 - 1.2345678987654321D3: 1.23456789876543D+003 - 0.0: 0.00000D+000 - 0.000123D0: 1.23000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity - - - -Testing REAL. - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.0E+00 - 1.1E0: 1.1E+00 - 2.1E0: 2.1E+00 --1.1E0: -1.1E+00 - 1.1E3: 1.1E+03 - 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.0E+00 - 0.000123E0: 1.23E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.10000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity - diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index d4f36bd0..20d99cbd 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -57,7 +57,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && sudo git clean -dfx &&" + my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && $sudo git clean -dfx &&" . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; logged($cmd, $machine); } From f0a68cf6f9f5b8a3bc160275fd9b93bfc75b0a15 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 11:12:08 +0100 Subject: [PATCH 081/140] Improved Out.Real* layout and build type independence. --- bootstrap/unix-44/Out.c | 54 +++++--- bootstrap/unix-48/Out.c | 54 +++++--- bootstrap/unix-88/Out.c | 54 +++++--- bootstrap/windows-48/Out.c | 54 +++++--- bootstrap/windows-88/Out.c | 54 +++++--- src/runtime/Out.Mod | 70 ++++++---- src/test/confidence/out/expected | 196 +++++++++++++++++++--------- src/test/confidence/out/outtest.mod | 130 +++++++++++++----- 8 files changed, 456 insertions(+), 210 deletions(-) diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 3df836a0..1d0fcf65 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index b21d426b..eb112d34 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index b21d426b..eb112d34 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -21,7 +21,7 @@ export void Out_Ln (void); export void Out_LongReal (LONGREAL x, int16 n); export void Out_Open (void); export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp); +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); export LONGREAL Out_Ten (int16 e); static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); @@ -167,12 +167,12 @@ LONGREAL Out_Ten (int16 e) return _o_result; } -static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdigits, CHAR exp) +static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) { int16 e; int64 f; CHAR s[30]; - int16 i; + int16 i, el; LONGREAL x0; BOOLEAN nn, en; int64 m; @@ -191,16 +191,35 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi Out_prepend((CHAR*)"NaN", 4, (void*)s, 30, &i); } } else { + if (long_) { + el = 3; + dr = n - 6; + if (dr > 17) { + dr = 17; + } + d = dr; + if (d < 16) { + d = 16; + } + } else { + el = 2; + dr = n - 5; + if (dr > 9) { + dr = 9; + } + d = dr; + if (d < 7) { + d = 7; + } + } if (e == 0) { - d = i - exponentdigits; - while (i > d) { + while (el > 0) { i -= 1; s[__X(i, 30)] = '0'; + el -= 1; } i -= 1; s[__X(i, 30)] = '+'; - i -= 1; - s[__X(i, 30)] = exp; m = 0; } else { if (nn) { @@ -220,11 +239,10 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi if (en) { e = -e; } - d = exponentdigits; - while (d > 0) { + while (el > 0) { Out_digit(e, (void*)s, 30, &i); e = __DIV(e, 10); - d -= 1; + el -= 1; } i -= 1; if (en) { @@ -232,9 +250,7 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } else { s[__X(i, 30)] = '+'; } - i -= 1; - s[__X(i, 30)] = exp; - x0 = Out_Ten(maxsigdigits - 1); + x0 = Out_Ten(d - 1); x = x0 * x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; @@ -242,8 +258,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi } m = Out_Entier64(x); } - d = maxsigdigits; - dr = n - (exponentdigits + 3); + i -= 1; + if (long_) { + s[__X(i, 30)] = 'D'; + } else { + s[__X(i, 30)] = 'E'; + } if (dr < 2) { dr = 2; } @@ -276,12 +296,12 @@ static void Out_RealP (LONGREAL x, int16 n, int16 exponentdigits, int16 maxsigdi void Out_Real (REAL x, int16 n) { - Out_RealP(x, n, 2, 7, 'E'); + Out_RealP(x, n, 0); } void Out_LongReal (LONGREAL x, int16 n) { - Out_RealP(x, n, 3, 16, 'D'); + Out_RealP(x, n, 1); } diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 9463fef8..ec960404 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -95,7 +95,7 @@ END Ten; PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; -PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR); +PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); (* LongReal(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a @@ -104,16 +104,17 @@ PROCEDURE RealP(x: LONGREAL; n, exponentdigits, maxsigdigits: INTEGER; exp: CHAR LONGREAL is 1/sign, 11/exponent, 52/significand *) VAR - e: INTEGER; (* Exponent field *) - f: HUGEINT; (* Fraction field *) - s: ARRAY 30 OF CHAR; (* Buffer built backwards *) - i: INTEGER; (* Index into s *) - x0: LONGREAL; - nn: BOOLEAN; (* Number negative *) - en: BOOLEAN; (* Exponent negative *) - m: HUGEINT; (* Mantissa digits *) - d: INTEGER; (* Significant digit count to display *) - dr: INTEGER; (* Number of insignificant digits that can be dropped *) + e: INTEGER; (* Exponent field *) + f: HUGEINT; (* Fraction field *) + s: ARRAY 30 OF CHAR; (* Buffer built backwards *) + i: INTEGER; (* Index into s *) + el: INTEGER; (* Exponent length *) + x0: LONGREAL; + nn: BOOLEAN; (* Number negative *) + en: BOOLEAN; (* Exponent negative *) + m: HUGEINT; (* Mantissa digits *) + d: INTEGER; (* Significant digit count to display *) + dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; @@ -124,10 +125,25 @@ BEGIN IF e = 7FFH THEN (* NaN / Infinity *) IF f = 0 THEN prepend("Infinity", s, i) ELSE prepend("NaN", s, i) END ELSE + (* Calculate number of significant digits caller has proposed space for, and + number of digits to generate. *) + IF long THEN + el := 3; + dr := n-6; (* Leave room for dp and '+D000' *) + IF dr > 17 THEN dr := 17 END; (* Limit to max useful significant digits *) + d := dr; (* Number of digits to generate *) + IF d < 16 THEN d := 16 END (* Generate enough digits to do trailing zero supporession *) + ELSE + el := 2; + dr := n-5; (* Leave room for dp and '+E00' *) + IF dr > 9 THEN dr := 9 END; (* Limit to max useful significant digits *) + d := dr; (* Number of digits to generate *) + IF d < 7 THEN d := 7 END (* Generate enough digits to do trailing zero supporession *) + END; + IF e = 0 THEN - d := i - exponentdigits; WHILE i > d DO DEC(i); s[i] := "0" END; + WHILE el > 0 DO DEC(i); s[i] := "0"; DEC(el) END; DEC(i); s[i] := "+"; - DEC(i); s[i] := exp; m := 0; ELSE IF nn THEN x := -x END; @@ -139,25 +155,23 @@ BEGIN (* Generate the exponent digits *) en := e < 0; IF en THEN e := - e END; - d := exponentdigits; - WHILE d > 0 DO digit(e, s, i); e := e DIV 10; DEC(d) END; + WHILE el > 0 DO digit(e, s, i); e := e DIV 10; DEC(el) END; DEC(i); IF en THEN s[i] := "-" ELSE s[i] := "+" END; - DEC(i); s[i] := exp; - (* Todo: generate more than maxsigdigits if we have room for them *) - - (* Scale x to enoughsignificant digits to reliably test for trailing - zeroes. - todo or to the amount of space available, if greater. *) - x0 := Ten(maxsigdigits-1); - x := x0 * x + 0.5D0; + (* Scale x to enough significant digits to reliably test for trailing + zeroes or to the amount of space available, if greater. *) + x0 := Ten(d-1); + x := x0 * x; + x := x + 0.5D0; (* Do not combine with previous line as doing so + introduces a least significant bit difference + between 32 bit and 64 bit builds. *) IF x >= 10.0D0 * x0 THEN x := 0.1D0 * x; INC(e) END; m := Entier64(x) END; - (* Drop trailing zeroes where we don't have room *) - d := maxsigdigits; - dr := n - (exponentdigits + 3); (* 3 for '.', D/E and +/- *) + DEC(i); IF long THEN s[i] := "D" ELSE s[i] := "E" END; + + (* Drop trailing zeroes where caller proposes to use less space *) IF dr < 2 THEN dr := 2 END; WHILE (d > dr) & (m MOD 10 = 0) DO m := m DIV 10; DEC(d) END; @@ -177,11 +191,11 @@ END RealP; PROCEDURE Real*(x: REAL; n: INTEGER); -BEGIN RealP(x, n, 2, 7, "E"); +BEGIN RealP(x, n, FALSE); END Real; PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); -BEGIN RealP(x, n, 3, 16, "D"); +BEGIN RealP(x, n, TRUE); END LongReal; END Out. diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index b71feae8..acc6253e 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -1,11 +1,39 @@ --- Testing with Oberon 2 variable model --- +Real number hex representation. + 1.0D0: 3FF0000000000000 + 1.1D0: 3FF199999999999A + 2.1D0: 4000CCCCCCCCCCCD +-1.1D0: BFF199999999999A + 1.1D3: 4091300000000000 + 1.1D-3: 3F5205BC01A36E2F + 1.2345678987654321D3: 40934A45874103D8 + 0.0: 0000000000000000 + 0.000123D0: 3F201F31F46ED246 + 1/0.0: 7FF0000000000000 +-1/0.0: FFF0000000000000 + 0.0/0.0: FFF8000000000000 + + 1.0E0: 3F800000 + 1.1E0: 3F8CCCCD + 2.1E0: 40066666 +-1.1E0: BF8CCCCD + 1.1E3: 44898000 + 1.1E-3: 3A902DE0 + 1.2345678987654321E3: 449A522C + 0.0: 00000000 + 0.000123E0: 3900F990 + 1/0.0: 7F800000 +-1/0.0: FF800000 + 0.0/0.0: FFC00000 + + Out module tests. SIZE(INTEGER) = 2 Testing LONGREAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.0D+000 1.1D0: 1.1D+000 2.1D0: 2.1D+000 @@ -17,9 +45,10 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.00000D+000 1.1D0: 1.10000D+000 2.1D0: 2.10000D+000 @@ -31,27 +60,29 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0D0: 1.0000000000000000D+000 + 1.1D0: 1.1000000000000000D+000 + 2.1D0: 2.1000000000000000D+000 +-1.1D0: -1.1000000000000000D+000 + 1.1D3: 1.1000000000000000D+003 + 1.1D-3: 1.1000000000000000D-003 + 1.2345678987654321D3: 1.2345678987654300D+003 + 0.0: 0.0000000000000000D+000 + 0.000123D0: 1.2300000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN Testing REAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0E0: 1.0E+00 1.1E0: 1.1E+00 2.1E0: 2.1E+00 @@ -63,6 +94,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN 1 2 3 123456789012345678901234567890 @@ -77,31 +109,61 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0E0: 1.00000000E+00 + 1.1E0: 1.10000002E+00 + 2.1E0: 2.09999990E+00 +-1.1E0: -1.10000002E+00 + 1.1E3: 1.10000000E+03 + 1.1E-3: 1.09999999E-03 + 1.2345678987654321E3: 1.23456787E+03 + 0.0: 0.00000000E+00 + 0.000123E0: 1.23000005E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN --- Testing with Component Pascal variable model --- +Real number hex representation. + 1.0D0: 3FF0000000000000 + 1.1D0: 3FF199999999999A + 2.1D0: 4000CCCCCCCCCCCD +-1.1D0: BFF199999999999A + 1.1D3: 4091300000000000 + 1.1D-3: 3F5205BC01A36E2F + 1.2345678987654321D3: 40934A45874103D8 + 0.0: 0000000000000000 + 0.000123D0: 3F201F31F46ED246 + 1/0.0: 7FF0000000000000 +-1/0.0: FFF0000000000000 + 0.0/0.0: FFF8000000000000 + + 1.0E0: 3F800000 + 1.1E0: 3F8CCCCD + 2.1E0: 40066666 +-1.1E0: BF8CCCCD + 1.1E3: 44898000 + 1.1E-3: 3A902DE0 + 1.2345678987654321E3: 449A522C + 0.0: 00000000 + 0.000123E0: 3900F990 + 1/0.0: 7F800000 +-1/0.0: FF800000 + 0.0/0.0: FFC00000 + + Out module tests. SIZE(INTEGER) = 4 Testing LONGREAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.0D+000 1.1D0: 1.1D+000 2.1D0: 2.1D+000 @@ -113,9 +175,10 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0D0: 1.00000D+000 1.1D0: 1.10000D+000 2.1D0: 2.10000D+000 @@ -127,27 +190,29 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0D0: 1.000000000000000D+000 - 1.1D0: 1.100000000000000D+000 - 2.1D0: 2.100000000000000D+000 --1.1D0: -1.100000000000000D+000 - 1.1D3: 1.100000000000000D+003 - 1.1D-3: 1.100000000000000D-003 - 1.2345678987654321D3: 1.234567898765430D+003 - 0.0: 0.000000000000000D+000 - 0.000123D0: 1.230000000000000D-004 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0D0: 1.0000000000000000D+000 + 1.1D0: 1.1000000000000000D+000 + 2.1D0: 2.1000000000000000D+000 +-1.1D0: -1.1000000000000000D+000 + 1.1D3: 1.1000000000000000D+003 + 1.1D-3: 1.1000000000000000D-003 + 1.2345678987654321D3: 1.2345678987654300D+003 + 0.0: 0.0000000000000000D+000 + 0.000123D0: 1.2300000000000000D-004 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN Testing REAL. - 1 2 3 - 123456789012345678901234567890 + 1 2 3 4 + 1234567890123456789012345678901234567890 1.0E0: 1.0E+00 1.1E0: 1.1E+00 2.1E0: 2.1E+00 @@ -159,6 +224,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN 1 2 3 123456789012345678901234567890 @@ -173,18 +239,20 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity + 0.0/0.0: -NaN - 1 2 3 - 123456789012345678901234567890 - 1.0E0: 1.000000E+00 - 1.1E0: 1.100000E+00 - 2.1E0: 2.100000E+00 --1.1E0: -1.100000E+00 - 1.1E3: 1.100000E+03 - 1.1E-3: 1.100000E-03 - 1.2345678987654321E3: 1.234568E+03 - 0.0: 0.000000E+00 - 0.000123E0: 1.230000E-04 - 1/0.0: Infinity --1/0.0: -Infinity + 1 2 3 4 + 1234567890123456789012345678901234567890 + 1.0E0: 1.00000000E+00 + 1.1E0: 1.10000002E+00 + 2.1E0: 2.09999990E+00 +-1.1E0: -1.10000002E+00 + 1.1E3: 1.10000000E+03 + 1.1E-3: 1.09999999E-03 + 1.2345678987654321E3: 1.23456787E+03 + 0.0: 0.00000000E+00 + 0.000123E0: 1.23000005E-04 + 1/0.0: Infinity +-1/0.0: -Infinity + 0.0/0.0: -NaN diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod index b2a00669..37881960 100644 --- a/src/test/confidence/out/outtest.mod +++ b/src/test/confidence/out/outtest.mod @@ -1,23 +1,75 @@ MODULE outtest; -IMPORT Out; +IMPORT Out, SYSTEM; VAR r: REAL; lr: LONGREAL; + cw: SYSTEM.INT16; +PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; PROCEDURE wl; BEGIN Out.Ln END wl; +PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; b: SYSTEM.INT8; +BEGIN + i := SHORT(LEN(h)); + WHILE i > 0 DO + DEC(i); b := SYSTEM.VAL(SYSTEM.INT8, h[i]); + IF b DIV 16 MOD 16 < 10 THEN wc(CHR(b DIV 16 MOD 16 + 48)) ELSE wc(CHR(b DIV 16 MOD 16 + 55)) END; + IF b MOD 16 < 10 THEN wc(CHR(b MOD 16 + 48)) ELSE wc(CHR(b MOD 16 + 55)) END; + END +END wh; + + +(* +PROCEDURE -GetFpcw() '__asm__ __volatile__ ("fnstcw %0" : "=m" (outtest_cw))'; +*) + + BEGIN + (* + ws("Floating point control word: "); GetFpcw; wh(cw); wl; + wl; + *) + + ws("Real number hex representation."); wl; + lr := 1.0D0; ws(" 1.0D0: "); wh(lr); wl; + lr := 1.1D0; ws(" 1.1D0: "); wh(lr); wl; + lr := 2.1D0; ws(" 2.1D0: "); wh(lr); wl; + lr := -1.1D0; ws("-1.1D0: "); wh(lr); wl; + lr := 1.1D3; ws(" 1.1D3: "); wh(lr); wl; + lr := 1.1D-3; ws(" 1.1D-3: "); wh(lr); wl; + lr := 1.2345678987654321D3; ws(" 1.2345678987654321D3: "); wh(lr); wl; + lr := 0.0; ws(" 0.0: "); wh(lr); wl; + lr := 0.000123D0; ws(" 0.000123D0: "); wh(lr); wl; + lr := 0.0; lr := 1/lr; ws(" 1/0.0: "); wh(lr); wl; + lr := 0.0; lr := -1/lr; ws("-1/0.0: "); wh(lr); wl; + lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl; + wl; + r := 1.0E0; ws(" 1.0E0: "); wh(r); wl; + r := 1.1E0; ws(" 1.1E0: "); wh(r); wl; + r := 2.1E0; ws(" 2.1E0: "); wh(r); wl; + r := -1.1E0; ws("-1.1E0: "); wh(r); wl; + r := 1.1E3; ws(" 1.1E3: "); wh(r); wl; + r := 1.1E-3; ws(" 1.1E-3: "); wh(r); wl; + r := 1.2345678987654321E3; ws(" 1.2345678987654321E3: "); wh(r); wl; + r := 0.0; ws(" 0.0: "); wh(r); wl; + r := 0.000123E0; ws(" 0.000123E0: "); wh(r); wl; + r := 0.0; r := 1/r; ws(" 1/0.0: "); wh(r); wl; + r := 0.0; r := -1/r; ws("-1/0.0: "); wh(r); wl; + r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl; + wl; wl; + ws("Out module tests."); wl; ws("SIZE(INTEGER) = "); wi(SIZE(INTEGER)); wl; wl; ws("Testing LONGREAL."); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0D0: "); Out.LongReal( 1.0D0, 1); wl; ws(" 1.1D0: "); Out.LongReal( 1.1D0, 1); wl; ws(" 2.1D0: "); Out.LongReal( 2.1D0, 1); wl; @@ -31,9 +83,11 @@ BEGIN ws(" 1/0.0: "); Out.LongReal(lr, 1); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); Out.LongReal(lr, 1); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 1); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0D0: "); Out.LongReal( 1.0D0, 12); wl; ws(" 1.1D0: "); Out.LongReal( 1.1D0, 12); wl; ws(" 2.1D0: "); Out.LongReal( 2.1D0, 12); wl; @@ -47,28 +101,32 @@ BEGIN ws(" 1/0.0: "); Out.LongReal(lr, 12); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); Out.LongReal(lr, 12); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 12); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; - ws(" 1.0D0: "); Out.LongReal( 1.0D0, 30); wl; - ws(" 1.1D0: "); Out.LongReal( 1.1D0, 30); wl; - ws(" 2.1D0: "); Out.LongReal( 2.1D0, 30); wl; - ws("-1.1D0: "); Out.LongReal(-1.1D0, 30); wl; - ws(" 1.1D3: "); Out.LongReal( 1.1D3, 30); wl; - ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 30); wl; - ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 30); wl; - ws(" 0.0: "); Out.LongReal(0.0, 30); wl; - ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 30); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; + ws(" 1.0D0: "); Out.LongReal( 1.0D0, 40); wl; + ws(" 1.1D0: "); Out.LongReal( 1.1D0, 40); wl; + ws(" 2.1D0: "); Out.LongReal( 2.1D0, 40); wl; + ws("-1.1D0: "); Out.LongReal(-1.1D0, 40); wl; + ws(" 1.1D3: "); Out.LongReal( 1.1D3, 40); wl; + ws(" 1.1D-3: "); Out.LongReal( 1.1D-3, 40); wl; + ws(" 1.2345678987654321D3: "); Out.LongReal( 1.2345678987654321D3, 40); wl; + ws(" 0.0: "); Out.LongReal(0.0, 40); wl; + ws(" 0.000123D0: "); Out.LongReal(0.000123D0, 40); wl; lr := 0.0; lr := 1/lr; - ws(" 1/0.0: "); Out.LongReal(lr, 30); wl; + ws(" 1/0.0: "); Out.LongReal(lr, 40); wl; lr := 0.0; lr := -1/lr; - ws("-1/0.0: "); Out.LongReal(lr, 30); wl; + ws("-1/0.0: "); Out.LongReal(lr, 40); wl; + lr := 0.0; lr := 0.0D0/lr; + ws(" 0.0/0.0: "); Out.LongReal(lr, 40); wl; wl; wl; wl; ws("Testing REAL."); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; ws(" 1.0E0: "); Out.Real( 1.0E0, 1); wl; ws(" 1.1E0: "); Out.Real( 1.1E0, 1); wl; ws(" 2.1E0: "); Out.Real( 2.1E0, 1); wl; @@ -82,6 +140,8 @@ BEGIN ws(" 1/0.0: "); Out.Real(r, 1); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); Out.Real(r, 1); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 1); wl; wl; ws(" 1 2 3"); wl; ws(" 123456789012345678901234567890"); wl; @@ -98,22 +158,26 @@ BEGIN ws(" 1/0.0: "); Out.Real(r, 12); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); Out.Real(r, 12); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 12); wl; wl; - ws(" 1 2 3"); wl; - ws(" 123456789012345678901234567890"); wl; - ws(" 1.0E0: "); Out.Real( 1.0E0, 30); wl; - ws(" 1.1E0: "); Out.Real( 1.1E0, 30); wl; - ws(" 2.1E0: "); Out.Real( 2.1E0, 30); wl; - ws("-1.1E0: "); Out.Real(-1.1E0, 30); wl; - ws(" 1.1E3: "); Out.Real( 1.1E3, 30); wl; - ws(" 1.1E-3: "); Out.Real( 1.1E-3, 30); wl; - ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 30); wl; - ws(" 0.0: "); Out.Real(0.0, 30); wl; - ws(" 0.000123E0: "); Out.Real(0.000123E0, 30); wl; + ws(" 1 2 3 4"); wl; + ws(" 1234567890123456789012345678901234567890"); wl; + ws(" 1.0E0: "); Out.Real( 1.0E0, 40); wl; + ws(" 1.1E0: "); Out.Real( 1.1E0, 40); wl; + ws(" 2.1E0: "); Out.Real( 2.1E0, 40); wl; + ws("-1.1E0: "); Out.Real(-1.1E0, 40); wl; + ws(" 1.1E3: "); Out.Real( 1.1E3, 40); wl; + ws(" 1.1E-3: "); Out.Real( 1.1E-3, 40); wl; + ws(" 1.2345678987654321E3: "); Out.Real( 1.2345678987654321E3, 40); wl; + ws(" 0.0: "); Out.Real(0.0, 40); wl; + ws(" 0.000123E0: "); Out.Real(0.000123E0, 40); wl; r := 0.0; r := 1/r; - ws(" 1/0.0: "); Out.Real(r, 30); wl; + ws(" 1/0.0: "); Out.Real(r, 40); wl; r := 0.0; r := -1/r; - ws("-1/0.0: "); Out.Real(r, 30); wl; + ws("-1/0.0: "); Out.Real(r, 40); wl; + r := 0.0; r := 0.0E0/r; + ws(" 0.0/0.0: "); Out.Real(r, 40); wl; wl; END outtest. From dd6f704e68bb059b93a4b762d20a2a19f2f8f64c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 11:49:21 +0100 Subject: [PATCH 082/140] Don't display sign for NaN as x86 and arm generate it differently for 0.0/0.0 --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 11 ++++++----- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 11 ++++++----- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 11 ++++++----- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 11 ++++++----- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 11 ++++++----- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/runtime/Out.Mod | 3 ++- src/test/confidence/out/expected | 24 ++++++++++++------------ 197 files changed, 239 insertions(+), 233 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c983396b..4074c8b1 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index ba64fc56..c38c3f26 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 9ec11e5d..a1e67f1b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0667398d..4c779435 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 4897b84e..e45b429c 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 6fd83b96..2a154ebf 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 82b41cda..5a8c9b51 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c983396b..4074c8b1 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index ba64fc56..c38c3f26 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 55178203..bc22f7e2 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0667398d..4c779435 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 4897b84e..e45b429c 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 421c5f47..672171ee 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e27e5f53..802df5a7 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 00efd9fc..e380bc50 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 1e455c40..5c717742 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index b09688eb..1a82d9e8 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index a5b2fe18..abcafa6a 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 73f0a95b..5fdce638 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index f377d2a5..ca25d1e6 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 5c4e3c07..64a861ac 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 3e3e97fb..7be03e0d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index fd84941f..90adf5f7 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 1d0fcf65..944cc0e5 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index ddd65b5f..4d742327 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index f2194f3c..1df437c2 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index ce4a885a..6033652e 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 26669d1c..54f5d5ee 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 0c55ce0a..9b51335b 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8cee9102..3ca0b501 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8758813f..cb386d17 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index bcf77f96..c6dbfb3e 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5302c9f4..e5227fba 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index abb65cd0..76cc2b7c 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 10e8168f..e3a26a86 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 55178203..bc22f7e2 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 96075563..19522c13 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index eb112d34..146364f1 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index d50ae9ec..10094e2d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 3aa708ca..76bb3755 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 421c5f47..672171ee 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e27e5f53..802df5a7 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index b303a7c4..5ec069b8 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8ac138be..0bef890f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 207eeb63..286f28c0 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b9443fd9..98dcdccb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 98e13fc1..a643f9c2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index b09688eb..1a82d9e8 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index a5b2fe18..abcafa6a 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 73f0a95b..5fdce638 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index abb938ae..77ec53de 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 3233aa7b..aab1b7fe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6931fe6e..eb00fcda 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 48f0d967..84393696 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 40825f04..d6a60b2e 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index f377d2a5..ca25d1e6 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index e18ab6ff..b7b19fb7 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 5c4e3c07..64a861ac 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 49d03b82..1f2ff59f 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 288a081d..72800d6b 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bc45e385..595b3668 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 3e3e97fb..7be03e0d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 95947e81..d40fcd25 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index fd84941f..90adf5f7 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0d54d226..fa176ddf 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index eb112d34..146364f1 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -177,12 +177,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) BOOLEAN nn, en; int64 m; int16 d, dr; - nn = __VAL(int64, x) < 0; + e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); + f = __MASK((__VAL(int64, x)), -4503599627370496); + nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); i = 30; if (e == 2047) { if (f == 0) { @@ -251,7 +251,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) s[__X(i, 30)] = '+'; } x0 = Out_Ten(d - 1); - x = x0 * x + 5.00000000000000e-001; + x = x0 * x; + x = x + 5.00000000000000e-001; if (x >= (LONGREAL)10 * x0) { x = 1.00000000000000e-001 * x; e += 1; diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 362b4414..418e17e2 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 7efc77b3..4b4bd5d9 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 52d679bb..bc2df7c8 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 8697b424..ece1bf1d 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index e764f95f..523e9f9e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 8a95a8eb..c86ccc0e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4989383b..c12329ab 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index ce4a885a..6033652e 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 26669d1c..54f5d5ee 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 408d5ec7..44990c71 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index b0247272..e0bb109d 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 5df06422..c83fd7dd 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ef0da35c..21016d9e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 65b16ccc..afa2b377 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 2211e981..03038059 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index ec960404..6ba07c09 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -117,9 +117,10 @@ VAR dr: INTEGER; (* Number of insignificant digits that can be dropped *) BEGIN - nn := SYSTEM.VAL(HUGEINT, x) < 0; IF nn THEN DEC(n) END; e := SYSTEM.VAL(INTEGER, (SYSTEM.VAL(HUGEINT, x) DIV 10000000000000H) MOD 800H); f := SYSTEM.VAL(HUGEINT, x) MOD 10000000000000H; + nn := (SYSTEM.VAL(HUGEINT, x) < 0) & ~((e = 7FFH) & (f # 0)); (* Ignore sign on Nan *) + IF nn THEN DEC(n) END; i := LEN(s); IF e = 7FFH THEN (* NaN / Infinity *) diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index acc6253e..b5ab3a3b 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -45,7 +45,7 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -60,7 +60,7 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -75,7 +75,7 @@ Testing LONGREAL. 0.000123D0: 1.2300000000000000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -94,7 +94,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 123456789012345678901234567890 @@ -109,7 +109,7 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -124,7 +124,7 @@ Testing REAL. 0.000123E0: 1.23000005E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -175,7 +175,7 @@ Testing LONGREAL. 0.000123D0: 1.23D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -190,7 +190,7 @@ Testing LONGREAL. 0.000123D0: 1.23000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -205,7 +205,7 @@ Testing LONGREAL. 0.000123D0: 1.2300000000000000D-004 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN @@ -224,7 +224,7 @@ Testing REAL. 0.000123E0: 1.23E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 123456789012345678901234567890 @@ -239,7 +239,7 @@ Testing REAL. 0.000123E0: 1.230000E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN 1 2 3 4 1234567890123456789012345678901234567890 @@ -254,5 +254,5 @@ Testing REAL. 0.000123E0: 1.23000005E-04 1/0.0: Infinity -1/0.0: -Infinity - 0.0/0.0: -NaN + 0.0/0.0: NaN From ea3061523579836d384dbf706c9a4a92a5c712c4 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 12:08:39 +0100 Subject: [PATCH 083/140] Omit hex display of 0.0/0.0 from outtest as it differs between x86 and arm. --- src/test/confidence/out/outtest.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/confidence/out/outtest.mod b/src/test/confidence/out/outtest.mod index 37881960..aa1997cb 100644 --- a/src/test/confidence/out/outtest.mod +++ b/src/test/confidence/out/outtest.mod @@ -48,7 +48,7 @@ BEGIN lr := 0.000123D0; ws(" 0.000123D0: "); wh(lr); wl; lr := 0.0; lr := 1/lr; ws(" 1/0.0: "); wh(lr); wl; lr := 0.0; lr := -1/lr; ws("-1/0.0: "); wh(lr); wl; - lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl; +(*lr := 0.0; lr := 0.0D0/lr; ws(" 0.0/0.0: "); wh(lr); wl;*) wl; r := 1.0E0; ws(" 1.0E0: "); wh(r); wl; r := 1.1E0; ws(" 1.1E0: "); wh(r); wl; @@ -61,7 +61,7 @@ BEGIN r := 0.000123E0; ws(" 0.000123E0: "); wh(r); wl; r := 0.0; r := 1/r; ws(" 1/0.0: "); wh(r); wl; r := 0.0; r := -1/r; ws("-1/0.0: "); wh(r); wl; - r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl; +(*r := 0.0; r := 0.0E0/r; ws(" 0.0/0.0: "); wh(r); wl;*) wl; wl; ws("Out module tests."); wl; From b231efb466a552dcf6466be1ec68bdc61e9fe420 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 12 Oct 2016 12:30:27 +0100 Subject: [PATCH 084/140] Updated outtest expected results. --- src/test/confidence/out/expected | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index b5ab3a3b..586814dc 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -11,7 +11,6 @@ Real number hex representation. 0.000123D0: 3F201F31F46ED246 1/0.0: 7FF0000000000000 -1/0.0: FFF0000000000000 - 0.0/0.0: FFF8000000000000 1.0E0: 3F800000 1.1E0: 3F8CCCCD @@ -24,7 +23,6 @@ Real number hex representation. 0.000123E0: 3900F990 1/0.0: 7F800000 -1/0.0: FF800000 - 0.0/0.0: FFC00000 Out module tests. @@ -141,7 +139,6 @@ Real number hex representation. 0.000123D0: 3F201F31F46ED246 1/0.0: 7FF0000000000000 -1/0.0: FFF0000000000000 - 0.0/0.0: FFF8000000000000 1.0E0: 3F800000 1.1E0: 3F8CCCCD @@ -154,7 +151,6 @@ Real number hex representation. 0.000123E0: 3900F990 1/0.0: 7F800000 -1/0.0: FF800000 - 0.0/0.0: FFC00000 Out module tests. From 80de6dc2164864ab04d2bf671245084a57b37799 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 17:15:05 +0100 Subject: [PATCH 085/140] Rationalise -O2 vs -OC library build. --- bootstrap/unix-44/Compiler.c | 14 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 20 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 3 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 3 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 190 +++++++-------- bootstrap/unix-44/vt100.h | 56 ++--- bootstrap/unix-48/Compiler.c | 14 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 20 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 3 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 3 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 190 +++++++-------- bootstrap/unix-48/vt100.h | 56 ++--- bootstrap/unix-88/Compiler.c | 14 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 20 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 3 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 3 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 190 +++++++-------- bootstrap/unix-88/vt100.h | 56 ++--- bootstrap/windows-48/Compiler.c | 14 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 20 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 3 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 3 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 190 +++++++-------- bootstrap/windows-48/vt100.h | 56 ++--- bootstrap/windows-88/Compiler.c | 14 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 20 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 3 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 3 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 190 +++++++-------- bootstrap/windows-88/vt100.h | 56 ++--- makefile | 13 +- src/compiler/Compiler.Mod | 10 +- src/compiler/OPM.Mod | 18 +- src/compiler/extTools.Mod | 1 + src/library/misc/crt.Mod | 107 +++++---- src/library/misc/vt100.Mod | 342 --------------------------- src/library/s3/ethReals.Mod | 2 +- src/runtime/MathL.Mod | 4 +- src/runtime/Out.Mod | 1 + src/runtime/vt100.Mod | 4 +- src/tools/make/oberon.mk | 313 ++++++++++++------------ 206 files changed, 1129 insertions(+), 1456 deletions(-) delete mode 100644 src/library/misc/vt100.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4074c8b1..e46e005c 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c38c3f26..33cfbbec 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index a1e67f1b..c5d47d14 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4c779435..ff57e9c4 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index e45b429c..5e6af8ad 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 2a154ebf..ac65c9f1 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 5a8c9b51..60f267ed 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4074c8b1..e46e005c 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c38c3f26..33cfbbec 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index bc22f7e2..6f466b3e 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4c779435..ff57e9c4 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index e45b429c..5e6af8ad 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 672171ee..b5634f26 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 802df5a7..7709374b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e380bc50..22e659a7 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5c717742..42a47cdf 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 1a82d9e8..42134b68 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index abcafa6a..521ccc74 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5fdce638..2a860e62 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index ca25d1e6..686c674e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 64a861ac..29f9ae66 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 7be03e0d..85221274 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 90adf5f7..7e6d40e5 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 944cc0e5..67b82ce9 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d742327..d58fec88 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1df437c2..9216622f 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 6033652e..09708beb 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 54f5d5ee..14846883 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 44990c71..70424462 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 9b51335b..03f1e2aa 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 3ca0b501..b5337e4a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index cb386d17..948db354 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index c6dbfb3e..7712f182 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e5227fba..5cdcbe9c 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 76cc2b7c..d202f2cd 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e3a26a86..63fb92b5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index bc22f7e2..6f466b3e 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 19522c13..fd02ab90 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 146364f1..31b8cd52 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 10094e2d..6bc9bf9f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 76bb3755..79119240 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 672171ee..b5634f26 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 802df5a7..7709374b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 44990c71..70424462 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5ec069b8..82f1ab48 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 @@ -16,8 +16,8 @@ #include "OPV.h" #include "Platform.h" #include "Strings.h" +#include "VT100.h" #include "extTools.h" -#include "vt100.h" static CHAR Compiler_mname[256]; @@ -47,20 +47,20 @@ void Compiler_Module (BOOLEAN *done) if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" Main program.", 16); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (new) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogWStr((CHAR*)" New symbol file.", 19); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } OPM_RegisterNewSym(); } else if (ext) { @@ -175,8 +175,8 @@ export int main(int argc, char **argv) __MODULE_IMPORT(OPV); __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(extTools); - __MODULE_IMPORT(vt100); __REGMAIN("Compiler", 0); __REGCMD("Translate", Compiler_Translate); /* BEGIN */ diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 0bef890f..b9310392 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 286f28c0..c760742c 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 98dcdccb..9986f06f 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a643f9c2..9b8b7477 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 1a82d9e8..42134b68 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index abcafa6a..521ccc74 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5fdce638..2a860e62 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 77ec53de..e6fcdbbe 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index aab1b7fe..aa7126c9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index eb00fcda..b63ca81f 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 84393696..d2a4419b 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index d6a60b2e..4da49877 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index ca25d1e6..686c674e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -12,8 +12,8 @@ #include "Platform.h" #include "Strings.h" #include "Texts.h" +#include "VT100.h" #include "errors.h" -#include "vt100.h" typedef CHAR OPM_FileName[32]; @@ -325,7 +325,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" Miscellaneous", 16); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -f Disable vt100 control characters in status output.", 60); + OPM_LogWStr((CHAR*)" -f Disable VT100 control characters in status output.", 60); OPM_LogWLn(); OPM_LogWStr((CHAR*)" -V Display compiler debugging messages.", 46); OPM_LogWLn(); @@ -555,20 +555,20 @@ static void OPM_LogErrMsg (int16 n) CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"31m", 4); + VT100_SetAttr((CHAR*)"31m", 4); } OPM_LogWStr((CHAR*)" err ", 7); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } else { if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"35m", 4); + VT100_SetAttr((CHAR*)"35m", 4); } OPM_LogWStr((CHAR*)" warning ", 11); n = -n; if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } } OPM_LogWNum(n, 1); @@ -641,11 +641,11 @@ static void OPM_ShowLine (int64 pos) i -= 1; } if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"32m", 4); + VT100_SetAttr((CHAR*)"32m", 4); } OPM_LogW('^'); if (!__IN(16, OPM_Options, 32)) { - vt100_SetAttr((CHAR*)"0m", 3); + VT100_SetAttr((CHAR*)"0m", 3); } Files_Close(f); } @@ -1079,8 +1079,8 @@ export void *OPM__init(void) __MODULE_IMPORT(Platform); __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); + __MODULE_IMPORT(VT100); __MODULE_IMPORT(errors); - __MODULE_IMPORT(vt100); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b7b19fb7..b088cc93 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 64a861ac..29f9ae66 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 1f2ff59f..57f41cf8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 72800d6b..e7cd3549 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 595b3668..0a75e9c7 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 7be03e0d..85221274 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d40fcd25..d8da229b 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 90adf5f7..7e6d40e5 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index fa176ddf..48195728 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 146364f1..31b8cd52 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -315,5 +315,6 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 418e17e2..f91ee6a4 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 4b4bd5d9..eed18d02 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index bc2df7c8..aacc5cad 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index ece1bf1d..6135ec40 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 523e9f9e..86321454 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index c86ccc0e..92ce5fe0 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c12329ab..76b31eb9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 6033652e..09708beb 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 54f5d5ee..14846883 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 44990c71..70424462 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index e0bb109d..80c4a045 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index c83fd7dd..a6e5fe94 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -102,6 +102,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023); Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); + Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 21016d9e..d945916e 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index afa2b377..7c1212f5 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -10,40 +10,40 @@ #include "Strings.h" -export CHAR vt100_CSI[5]; -static CHAR vt100_tmpstr[32]; +export CHAR VT100_CSI[5]; +static CHAR VT100_tmpstr[32]; -export void vt100_CHA (int16 n); -export void vt100_CNL (int16 n); -export void vt100_CPL (int16 n); -export void vt100_CUB (int16 n); -export void vt100_CUD (int16 n); -export void vt100_CUF (int16 n); -export void vt100_CUP (int16 n, int16 m); -export void vt100_CUU (int16 n); -export void vt100_DECTCEMh (void); -export void vt100_DECTCEMl (void); -export void vt100_DSR (int16 n); -export void vt100_ED (int16 n); -export void vt100_EL (int16 n); -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void vt100_HVP (int16 n, int16 m); -export void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -export void vt100_RCP (void); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); -export void vt100_SCP (void); -export void vt100_SD (int16 n); -export void vt100_SGR (int16 n); -export void vt100_SGR2 (int16 n, int16 m); -export void vt100_SU (int16 n); -export void vt100_SetAttr (CHAR *attr, LONGINT attr__len); +export void VT100_CHA (int16 n); +export void VT100_CNL (int16 n); +export void VT100_CPL (int16 n); +export void VT100_CUB (int16 n); +export void VT100_CUD (int16 n); +export void VT100_CUF (int16 n); +export void VT100_CUP (int16 n, int16 m); +export void VT100_CUU (int16 n); +export void VT100_DECTCEMh (void); +export void VT100_DECTCEMl (void); +export void VT100_DSR (int16 n); +export void VT100_ED (int16 n); +export void VT100_EL (int16 n); +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (int16 n, int16 m); +export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +export void VT100_RCP (void); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +export void VT100_SCP (void); +export void VT100_SD (int16 n); +export void VT100_SGR (int16 n); +export void VT100_SGR2 (int16 n, int16 m); +export void VT100_SU (int16 n); +export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) { CHAR h; while (start < end) { @@ -55,7 +55,7 @@ static void vt100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; int16 s, e; @@ -79,55 +79,55 @@ void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) e += 1; } while (!(int_ == 0)); b[__X(e, 21)] = 0x00; - vt100_Reverse0((void*)b, 21, s, e - 1); + VT100_Reverse0((void*)b, 21, s, e - 1); } __COPY(b, str, str__len); } -static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) { CHAR cmd[9]; __DUP(letter, letter__len, CHAR); - __COPY(vt100_CSI, cmd, 9); + __COPY(VT100_CSI, cmd, 9); Strings_Append(letter, letter__len, (void*)cmd, 9); Out_String(cmd, 9); __DEL(letter); } -static void vt100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 2); - __COPY(vt100_CSI, cmd, 7); + VT100_IntToStr(n, (void*)nstr, 2); + __COPY(VT100_CSI, cmd, 7); Strings_Append(letter, letter__len, (void*)cmd, 7); Strings_Append(nstr, 2, (void*)cmd, 7); Out_String(cmd, 7); __DEL(letter); } -static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; __DUP(letter, letter__len, CHAR); - vt100_IntToStr(n, (void*)nstr, 5); - vt100_IntToStr(m, (void*)mstr, 5); - __COPY(vt100_CSI, cmd, 12); + VT100_IntToStr(n, (void*)nstr, 5); + VT100_IntToStr(m, (void*)mstr, 5); + __COPY(VT100_CSI, cmd, 12); Strings_Append(nstr, 5, (void*)cmd, 12); Strings_Append((CHAR*)";", 2, (void*)cmd, 12); Strings_Append(mstr, 5, (void*)cmd, 12); @@ -136,129 +136,129 @@ static void vt100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void vt100_CUU (int16 n) +void VT100_CUU (int16 n) { - vt100_EscSeq(n, (CHAR*)"A", 2); + VT100_EscSeq(n, (CHAR*)"A", 2); } -void vt100_CUD (int16 n) +void VT100_CUD (int16 n) { - vt100_EscSeq(n, (CHAR*)"B", 2); + VT100_EscSeq(n, (CHAR*)"B", 2); } -void vt100_CUF (int16 n) +void VT100_CUF (int16 n) { - vt100_EscSeq(n, (CHAR*)"C", 2); + VT100_EscSeq(n, (CHAR*)"C", 2); } -void vt100_CUB (int16 n) +void VT100_CUB (int16 n) { - vt100_EscSeq(n, (CHAR*)"D", 2); + VT100_EscSeq(n, (CHAR*)"D", 2); } -void vt100_CNL (int16 n) +void VT100_CNL (int16 n) { - vt100_EscSeq(n, (CHAR*)"E", 2); + VT100_EscSeq(n, (CHAR*)"E", 2); } -void vt100_CPL (int16 n) +void VT100_CPL (int16 n) { - vt100_EscSeq(n, (CHAR*)"F", 2); + VT100_EscSeq(n, (CHAR*)"F", 2); } -void vt100_CHA (int16 n) +void VT100_CHA (int16 n) { - vt100_EscSeq(n, (CHAR*)"G", 2); + VT100_EscSeq(n, (CHAR*)"G", 2); } -void vt100_CUP (int16 n, int16 m) +void VT100_CUP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"H", 2); + VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void vt100_ED (int16 n) +void VT100_ED (int16 n) { - vt100_EscSeq(n, (CHAR*)"J", 2); + VT100_EscSeq(n, (CHAR*)"J", 2); } -void vt100_EL (int16 n) +void VT100_EL (int16 n) { - vt100_EscSeq(n, (CHAR*)"K", 2); + VT100_EscSeq(n, (CHAR*)"K", 2); } -void vt100_SU (int16 n) +void VT100_SU (int16 n) { - vt100_EscSeq(n, (CHAR*)"S", 2); + VT100_EscSeq(n, (CHAR*)"S", 2); } -void vt100_SD (int16 n) +void VT100_SD (int16 n) { - vt100_EscSeq(n, (CHAR*)"T", 2); + VT100_EscSeq(n, (CHAR*)"T", 2); } -void vt100_HVP (int16 n, int16 m) +void VT100_HVP (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"f", 2); + VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void vt100_SGR (int16 n) +void VT100_SGR (int16 n) { - vt100_EscSeq(n, (CHAR*)"m", 2); + VT100_EscSeq(n, (CHAR*)"m", 2); } -void vt100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (int16 n, int16 m) { - vt100_EscSeq2(n, m, (CHAR*)"m", 2); + VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void vt100_DSR (int16 n) +void VT100_DSR (int16 n) { - vt100_EscSeq(6, (CHAR*)"n", 2); + VT100_EscSeq(6, (CHAR*)"n", 2); } -void vt100_SCP (void) +void VT100_SCP (void) { - vt100_EscSeq0((CHAR*)"s", 2); + VT100_EscSeq0((CHAR*)"s", 2); } -void vt100_RCP (void) +void VT100_RCP (void) { - vt100_EscSeq0((CHAR*)"u", 2); + VT100_EscSeq0((CHAR*)"u", 2); } -void vt100_DECTCEMl (void) +void VT100_DECTCEMl (void) { - vt100_EscSeq0((CHAR*)"\?25l", 5); + VT100_EscSeq0((CHAR*)"\?25l", 5); } -void vt100_DECTCEMh (void) +void VT100_DECTCEMh (void) { - vt100_EscSeq0((CHAR*)"\?25h", 5); + VT100_EscSeq0((CHAR*)"\?25h", 5); } -void vt100_SetAttr (CHAR *attr, LONGINT attr__len) +void VT100_SetAttr (CHAR *attr, LONGINT attr__len) { CHAR tmpstr[16]; __DUP(attr, attr__len, CHAR); - __COPY(vt100_CSI, tmpstr, 16); + __COPY(VT100_CSI, tmpstr, 16); Strings_Append(attr, attr__len, (void*)tmpstr, 16); Out_String(tmpstr, 16); __DEL(attr); } -export void *vt100__init(void) +export void *VT100__init(void) { __DEFMOD; __MODULE_IMPORT(Out); __MODULE_IMPORT(Strings); - __REGMOD("vt100", 0); - __REGCMD("DECTCEMh", vt100_DECTCEMh); - __REGCMD("DECTCEMl", vt100_DECTCEMl); - __REGCMD("RCP", vt100_RCP); - __REGCMD("SCP", vt100_SCP); + __REGMOD("VT100", 0); + __REGCMD("DECTCEMh", VT100_DECTCEMh); + __REGCMD("DECTCEMl", VT100_DECTCEMl); + __REGCMD("RCP", VT100_RCP); + __REGCMD("SCP", VT100_SCP); /* BEGIN */ - __COPY("\033", vt100_CSI, 5); - Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5); + __COPY("\033", VT100_CSI, 5); + Strings_Append((CHAR*)"[", 2, (void*)VT100_CSI, 5); __ENDMOD; } diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 03038059..64913ea9 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#ifndef vt100__h -#define vt100__h +#ifndef VT100__h +#define VT100__h #include "SYSTEM.h" -import CHAR vt100_CSI[5]; +import CHAR VT100_CSI[5]; -import void vt100_CHA (int16 n); -import void vt100_CNL (int16 n); -import void vt100_CPL (int16 n); -import void vt100_CUB (int16 n); -import void vt100_CUD (int16 n); -import void vt100_CUF (int16 n); -import void vt100_CUP (int16 n, int16 m); -import void vt100_CUU (int16 n); -import void vt100_DECTCEMh (void); -import void vt100_DECTCEMl (void); -import void vt100_DSR (int16 n); -import void vt100_ED (int16 n); -import void vt100_EL (int16 n); -import void vt100_HVP (int16 n, int16 m); -import void vt100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); -import void vt100_RCP (void); -import void vt100_SCP (void); -import void vt100_SD (int16 n); -import void vt100_SGR (int16 n); -import void vt100_SGR2 (int16 n, int16 m); -import void vt100_SU (int16 n); -import void vt100_SetAttr (CHAR *attr, LONGINT attr__len); -import void *vt100__init(void); +import void VT100_CHA (int16 n); +import void VT100_CNL (int16 n); +import void VT100_CPL (int16 n); +import void VT100_CUB (int16 n); +import void VT100_CUD (int16 n); +import void VT100_CUF (int16 n); +import void VT100_CUP (int16 n, int16 m); +import void VT100_CUU (int16 n); +import void VT100_DECTCEMh (void); +import void VT100_DECTCEMl (void); +import void VT100_DSR (int16 n); +import void VT100_ED (int16 n); +import void VT100_EL (int16 n); +import void VT100_HVP (int16 n, int16 m); +import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_RCP (void); +import void VT100_SCP (void); +import void VT100_SD (int16 n); +import void VT100_SGR (int16 n); +import void VT100_SGR2 (int16 n, int16 m); +import void VT100_SU (int16 n); +import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); +import void *VT100__init(void); -#endif // vt100 +#endif // VT100 diff --git a/makefile b/makefile index b8323eea..499b5bf0 100644 --- a/makefile +++ b/makefile @@ -156,8 +156,8 @@ full: configuration @printf "\n\n--- Compiler build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 @printf "\n\n--- Library build started ---\n\n" - @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s runtime MODEL=C + @make -f src/tools/make/oberon.mk -s library MODEL=2 + @make -f src/tools/make/oberon.mk -s library MODEL=C @printf "\n\n--- Library build successfull ---\n\n" @make -f src/tools/make/oberon.mk -s sourcechanges @make -f src/tools/make/oberon.mk -s install @@ -190,12 +190,11 @@ browsercmd: configuration # library: build all directories under src/library -library: configuration - @make -f src/tools/make/oberon.mk -s O2library - @make -f src/tools/make/oberon.mk -s runtime MODEL=C +O2library: configuration + @make -f src/tools/make/oberon.mk -s library MODEL=2 -runtime: configuration - @make -f src/tools/make/oberon.mk -s runtime MODEL=C +OClibrary: configuration + @make -f src/tools/make/oberon.mk -s library MODEL=C diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index f21ef95d..d8c688a7 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -4,7 +4,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) SYSTEM, Heap, Platform, Configuration, OPP, OPB, OPT, OPV, OPC, OPM, - extTools, Strings, vt100; + extTools, Strings, VT100; VAR mname: ARRAY 256 OF CHAR; (* noch *) @@ -25,14 +25,14 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 703ff236..1ecaa7e0 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, vt100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, VT100, Strings; CONST OptionChar* = "-"; @@ -183,7 +183,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) | "c": Options := Options / {dontlink} (* Don't link. *) (* Miscellaneous *) - | "f": Options := Options / {notcoloroutput} (* Disable vt100 control characters in status output. *) + | "f": Options := Options / {notcoloroutput} (* Disable VT100 control characters in status output. *) | "V": Options := Options / {verbose} (* Elementary type size model *) @@ -264,7 +264,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" -c Don't link."); LogWLn; LogWLn; LogWStr(" Miscellaneous"); LogWLn; - LogWStr(" -f Disable vt100 control characters in status output."); LogWLn; + LogWStr(" -f Disable VT100 control characters in status output."); LogWLn; LogWStr(" -V Display compiler debugging messages."); LogWLn; LogWLn; LogWStr(" Size model for elementary types (default O2)"); LogWLn; @@ -426,13 +426,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf: ARRAY 1024 OF CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Red) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; LogWStr(" err "); - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; ELSE - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Magenta) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Magenta) END; LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; END ; LogWNum(n, 1); LogWStr(" "); @@ -505,9 +505,9 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.Green) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Green) END; LogW("^"); - IF ~(notcoloroutput IN Options) THEN vt100.SetAttr(vt100.ResetAll) END; + IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; Files.Close(f); END ShowLine; diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index c241eaac..062e8014 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -70,6 +70,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.installdir, cmd); Strings.Append('/lib"', cmd); Strings.Append(Configuration.libspec, cmd); + Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/library/misc/crt.Mod b/src/library/misc/crt.Mod index ab6e36b9..eebc5678 100644 --- a/src/library/misc/crt.Mod +++ b/src/library/misc/crt.Mod @@ -1,7 +1,6 @@ MODULE crt; -IMPORT vt100, Platform, Console, - Strings; (* strings to remove later ? *) +IMPORT VT100, Platform, Out, Strings; CONST @@ -30,27 +29,27 @@ CONST PROCEDURE EraseDisplay*; BEGIN - vt100.ED(2); + VT100.ED(2); END EraseDisplay; PROCEDURE ClrScr*; BEGIN - vt100.ED(2); + VT100.ED(2); END ClrScr; PROCEDURE ClrEol*; BEGIN - vt100.EL(0); + VT100.EL(0); END ClrEol; PROCEDURE cursoroff*; BEGIN - vt100.DECTCEMl; + VT100.DECTCEMl; END cursoroff; PROCEDURE cursoron*; BEGIN - vt100.DECTCEMh; + VT100.DECTCEMh; END cursoron; PROCEDURE Delay*(ms: INTEGER); @@ -58,116 +57,116 @@ CONST PROCEDURE GotoXY* (x, y: INTEGER); BEGIN - vt100.CUP (y, x); + VT100.CUP (y, x); END GotoXY; PROCEDURE HighVideo*; VAR tmpstr: ARRAY 5 OF CHAR; BEGIN - COPY (vt100.CSI, tmpstr); - Strings.Append(vt100.Bold, tmpstr); - Console.String(tmpstr); + COPY (VT100.CSI, tmpstr); + Strings.Append(VT100.Bold, tmpstr); + Out.String(tmpstr); END HighVideo; - + PROCEDURE DelLine*; BEGIN - vt100.EL(2); + VT100.EL(2); END DelLine; PROCEDURE InsLine*; BEGIN - vt100.SCP; - Console.Ln; - vt100.RCP; + VT100.SCP; + Out.Ln; + VT100.RCP; END InsLine; PROCEDURE LowVideo*; VAR tmpstr : ARRAY 7 OF CHAR; BEGIN - COPY (vt100.CSI, tmpstr); - Strings.Append(vt100.ResetBold, tmpstr); - Console.String(tmpstr); + COPY (VT100.CSI, tmpstr); + Strings.Append(VT100.ResetBold, tmpstr); + Out.String(tmpstr); END LowVideo; PROCEDURE NormVideo*; VAR tmpstr : ARRAY 7 OF CHAR; BEGIN - COPY(vt100.CSI, tmpstr); - Strings.Append(vt100.ResetAll, tmpstr); - Console.String(tmpstr); + COPY(VT100.CSI, tmpstr); + Strings.Append(VT100.ResetAll, tmpstr); + Out.String(tmpstr); END NormVideo; PROCEDURE TextBackground*(color : SHORTINT); BEGIN IF color = Black THEN - vt100.SetAttr(vt100.BBlack) + VT100.SetAttr(VT100.BBlack) ELSIF color = Blue THEN - vt100.SetAttr(vt100.BBlue) + VT100.SetAttr(VT100.BBlue) ELSIF color = Green THEN - vt100.SetAttr(vt100.BGreen) + VT100.SetAttr(VT100.BGreen) ELSIF color = Cyan THEN - vt100.SetAttr(vt100.BCyan) + VT100.SetAttr(VT100.BCyan) ELSIF color = Red THEN - vt100.SetAttr(vt100.BRed) + VT100.SetAttr(VT100.BRed) ELSIF color = Magenta THEN - vt100.SetAttr(vt100.BMagenta) + VT100.SetAttr(VT100.BMagenta) ELSIF color = Brown THEN - vt100.SetAttr(vt100.BYellow) + VT100.SetAttr(VT100.BYellow) ELSIF color = LightGray THEN - vt100.SetAttr(vt100.BLightGray) + VT100.SetAttr(VT100.BLightGray) ELSIF color = DarkGray THEN - vt100.SetAttr(vt100.BDarkGray) + VT100.SetAttr(VT100.BDarkGray) ELSIF color = LightBlue THEN - vt100.SetAttr(vt100.BLightBlue) + VT100.SetAttr(VT100.BLightBlue) ELSIF color = LightGreen THEN - vt100.SetAttr(vt100.BLightBlue) + VT100.SetAttr(VT100.BLightBlue) ELSIF color = LightCyan THEN - vt100.SetAttr(vt100.BLightCyan) + VT100.SetAttr(VT100.BLightCyan) ELSIF color = LightRed THEN - vt100.SetAttr(vt100.BLightRed) + VT100.SetAttr(VT100.BLightRed) ELSIF color = LightMagenta THEN - vt100.SetAttr(vt100.BLightMagenta) + VT100.SetAttr(VT100.BLightMagenta) ELSIF color = Yellow THEN - vt100.SetAttr(vt100.BLightYellow) + VT100.SetAttr(VT100.BLightYellow) ELSIF color = White THEN - vt100.SetAttr(vt100.BWhite) + VT100.SetAttr(VT100.BWhite) END; END TextBackground; PROCEDURE TextColor*(color : SHORTINT); BEGIN IF color = Black THEN - vt100.SetAttr(vt100.Black) + VT100.SetAttr(VT100.Black) ELSIF color = Blue THEN - vt100.SetAttr(vt100.Blue) + VT100.SetAttr(VT100.Blue) ELSIF color = Green THEN - vt100.SetAttr(vt100.Green) + VT100.SetAttr(VT100.Green) ELSIF color = Cyan THEN - vt100.SetAttr(vt100.Cyan) + VT100.SetAttr(VT100.Cyan) ELSIF color = Red THEN - vt100.SetAttr(vt100.Red) + VT100.SetAttr(VT100.Red) ELSIF color = Magenta THEN - vt100.SetAttr(vt100.Magenta) + VT100.SetAttr(VT100.Magenta) ELSIF color = Brown THEN - vt100.SetAttr(vt100.Yellow) + VT100.SetAttr(VT100.Yellow) ELSIF color = LightGray THEN - vt100.SetAttr(vt100.LightGray) + VT100.SetAttr(VT100.LightGray) ELSIF color = DarkGray THEN - vt100.SetAttr(vt100.DarkGray) + VT100.SetAttr(VT100.DarkGray) ELSIF color = LightBlue THEN - vt100.SetAttr(vt100.LightBlue) + VT100.SetAttr(VT100.LightBlue) ELSIF color = LightGreen THEN - vt100.SetAttr(vt100.LightBlue) + VT100.SetAttr(VT100.LightBlue) ELSIF color = LightCyan THEN - vt100.SetAttr(vt100.LightCyan) + VT100.SetAttr(VT100.LightCyan) ELSIF color = LightRed THEN - vt100.SetAttr(vt100.LightRed) + VT100.SetAttr(VT100.LightRed) ELSIF color = LightMagenta THEN - vt100.SetAttr(vt100.LightMagenta) + VT100.SetAttr(VT100.LightMagenta) ELSIF color = Yellow THEN - vt100.SetAttr(vt100.LightYellow) + VT100.SetAttr(VT100.LightYellow) ELSIF color = White THEN - vt100.SetAttr(vt100.White) + VT100.SetAttr(VT100.White) END; END TextColor; diff --git a/src/library/misc/vt100.Mod b/src/library/misc/vt100.Mod deleted file mode 100644 index 37ab5895..00000000 --- a/src/library/misc/vt100.Mod +++ /dev/null @@ -1,342 +0,0 @@ -MODULE vt100; - -IMPORT Console, Strings; - (* reference http://en.wikipedia.org/wiki/ANSI_escape_code - & http://misc.flogisoft.com/bash/tip_colors_and_formatting - *) -CONST - - Escape* = 1BX; - SynchronousIdle* = 16X; - LeftCrotchet* = '['; - - (* formatting *) - Bold* = "1m"; - Dim* = "2m"; - Underlined* = "4m"; - Blink* = "5m"; (* does not work with most emulators, works in tty and xterm *) - Reverse* = "7m"; (* invert the foreground and background colors *) - Hidden* = "8m"; (* useful for passwords *) - - (* reset *) - ResetAll* = "0m"; - ResetBold* = "21m"; - ResetDim* = "22m"; - ResetUnderlined* = "24m"; - ResetBlink* = "25m"; - ResetReverse* = "27m"; - ResetHidden* = "28m"; - - (* foreground colors *) - Black* = "30m"; - Red* = "31m"; - Green* = "32m"; - Yellow* = "33m"; - Blue* = "34m"; - Magenta* = "35m"; - Cyan* = "36m"; - LightGray* = "37m"; - Default* = "39m"; - DarkGray* = "90m"; - LightRed* = "91m"; - LightGreen* = "92m"; - LightYellow* = "93m"; - LightBlue* = "94m"; - LightMagenta* = "95m"; - LightCyan* = "96m"; - White* = "97m"; - - (* background colors *) - BBlack* = "40m"; - BRed* = "41m"; - BGreen* = "42m"; - BYellow* = "43m"; - BBlue* = "44m"; - BMagenta* = "45m"; - BCyan* = "46m"; - BLightGray* = "47m"; - BDefault* = "49m"; - BDarkGray* = "100m"; - BLightRed* = "101m"; - BLightGreen* = "102m"; - BLightYellow* = "103m"; - BLightBlue* = "104m"; - BLightMagenta*= "105m"; - BLightCyan* = "106m"; - BWhite* = "107m"; - - VAR - CSI* : ARRAY 5 OF CHAR; - tmpstr : ARRAY 32 OF CHAR; - - (* IntToStr routine taken from - https://github.com/romiras/Oberon-F-components/blob/master/Ott/Mod/IntStr.cp - and modified to work on 64bit system, - in order to avoid using oocIntStr, which has many dependencies *) - PROCEDURE Reverse0 (VAR str : ARRAY OF CHAR; start, end : INTEGER); - (* Reverses order of characters in the interval [start..end]. *) - VAR - h : CHAR; - BEGIN - WHILE start < end DO - h := str[start]; str[start] := str[end]; str[end] := h; - INC(start); DEC(end) - END - END Reverse0; - - PROCEDURE IntToStr*(int: LONGINT; VAR str: ARRAY OF CHAR); - (* Converts the value of `int' to string form and copies the possibly truncated - result to `str'. *) - VAR - b : ARRAY 21 OF CHAR; - s, e: INTEGER; - maxLength : SHORTINT; (* maximum number of digits representing a LONGINT value *) - BEGIN - IF SIZE(LONGINT) = 4 THEN maxLength := 11 END; - IF SIZE(LONGINT) = 8 THEN maxLength := 20 END; - (* build representation in string 'b' *) - IF int = MIN(LONGINT) THEN (* smallest LONGINT, -int is an overflow *) - IF SIZE(LONGINT) = 4 THEN - b := "-2147483648"; - e := 11 - ELSE (* SIZE(LONGINT) = 8 *) - b := "-9223372036854775808"; - e := 20 - END - ELSE - IF int < 0 THEN (* negative sign *) - b[0] := "-"; int := -int; s := 1 - ELSE (* no sign *) - s := 0 - END; - e := s; (* 's' holds starting position of string *) - REPEAT - b[e] := CHR(int MOD 10+ORD("0")); - int := int DIV 10; - INC(e) - UNTIL int = 0; - b[e] := 0X; - Reverse0(b, s, e-1); - END; - COPY(b, str) (* truncate output if necessary *) - END IntToStr; - - PROCEDURE EscSeq0 (letter : ARRAY OF CHAR); - VAR - cmd : ARRAY 9 OF CHAR; - BEGIN - COPY(CSI, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - END EscSeq0; - - PROCEDURE EscSeq (n : INTEGER; letter : ARRAY OF CHAR); - VAR nstr : ARRAY 2 OF CHAR; - cmd : ARRAY 7 OF CHAR; - BEGIN - IntToStr (n, nstr); - COPY(CSI, cmd); - Strings.Append (nstr, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - END EscSeq; - - PROCEDURE EscSeqSwapped (n : INTEGER; letter : ARRAY OF CHAR); - VAR nstr : ARRAY 2 OF CHAR; - cmd : ARRAY 7 OF CHAR; - BEGIN - IntToStr (n, nstr); - COPY(CSI, cmd); - Strings.Append (letter, cmd); - Strings.Append (nstr, cmd); - Console.String (cmd); - END EscSeqSwapped; - - PROCEDURE EscSeq2(n, m : INTEGER; letter : ARRAY OF CHAR); - VAR nstr, mstr : ARRAY 5 OF CHAR; - cmd : ARRAY 12 OF CHAR; - BEGIN - IntToStr(n, nstr); - IntToStr(m, mstr); - - COPY (CSI, cmd); - Strings.Append (nstr, cmd); - Strings.Append (';', cmd); - Strings.Append (mstr, cmd); - Strings.Append (letter, cmd); - Console.String (cmd); - - END EscSeq2; - - - -(* Cursor up - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUU*(n : INTEGER); - BEGIN - EscSeq (n, 'A'); - END CUU; - -(* Cursor down - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUD*(n : INTEGER); - BEGIN - EscSeq (n, 'B'); - END CUD; - - -(* Cursor forward - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUF*(n : INTEGER); - BEGIN - EscSeq (n, 'C'); - END CUF; - -(* Cursor back - moves cursor n cells in the given direction. if the cursor is already at the edge of the screen, this has no effect *) - - PROCEDURE CUB*(n : INTEGER); - BEGIN - EscSeq (n, 'D'); - END CUB; - -(* Curnser Next Line - moves cursor to beginning of the line n lines down *) - - PROCEDURE CNL*( n: INTEGER); - BEGIN - EscSeq (n, 'E'); - END CNL; - - -(* Cursor Previous Line - Moves cursor to beginning of the line n lines down *) - - PROCEDURE CPL*( n : INTEGER); - BEGIN - EscSeq (n, 'F'); - END CPL; - -(* Cursor Horizontal Absolute - Moves the cursor to column n *) - - PROCEDURE CHA*( n : INTEGER); - BEGIN - EscSeq (n, 'G'); - END CHA; - - (* Cursor position, moves cursor to row n, column m *) - PROCEDURE CUP*(n, m : INTEGER); - BEGIN - EscSeq2 (n, m, 'H'); - END CUP; - - (* Erase Display - if n = 0 then clears from cursor to end of the screen - if n = 1 then clears from cursor to beginning of the screen - if n = 2 then clears entire screen *) - - PROCEDURE ED* (n : INTEGER); - BEGIN - EscSeq(n, 'J'); - END ED; - - (* Erase in Line - Erases part of the line. If n is zero, clear from cursor to the end of the line. If n is one, clear from cursor to beginning of the line. If n is two, clear entire line. Cursor position does not change *) - PROCEDURE EL*( n : INTEGER); - BEGIN - EscSeq(n, 'K'); - END EL; - -(* Scroll Up - Scroll whole page up by n lines. New lines are added at the bottom *) - PROCEDURE SU*( n : INTEGER); - BEGIN - EscSeq(n, 'S') - END SU; - -(* Scroll Down - Scroll whole page down by n (default 1) lines. New lines are added at the top *) - PROCEDURE SD*( n : INTEGER); - BEGIN - EscSeq(n, 'T'); - END SD; - -(* Horizontal and Vertical Position, - Moves the cursor to row n, column m. Both default to 1 if omitted. Same as CUP *) - PROCEDURE HVP*(n, m : INTEGER); - BEGIN - EscSeq2 (n, m, 'f'); - END HVP; - -(* Select Graphic Rendition - Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset / normal), which is typical of most of the ANSI escape sequences *) - - PROCEDURE SGR*( n : INTEGER); - BEGIN - EscSeq(n, 'm'); - END SGR; - - PROCEDURE SGR2*( n, m : INTEGER); - BEGIN - EscSeq2(n, m, 'm'); - END SGR2; - -(* Device Status Report - Reports the cursor position (CPR) to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column.) *) - - PROCEDURE DSR*(n : INTEGER); - BEGIN - EscSeq(6, 'n'); - END DSR; - -(* Save Cursor Position *) - - PROCEDURE SCP*; - BEGIN - EscSeq0('s'); - END SCP; - -(* Restore Cursor Position *) - - PROCEDURE RCP*; - BEGIN - EscSeq0('u'); - END RCP; - -(* Hide the cursor *) - PROCEDURE DECTCEMl*; - BEGIN - EscSeq0("?25l") - END DECTCEMl; - -(* shows the cursor *) - PROCEDURE DECTCEMh*; - BEGIN - EscSeq0("?25h") - END DECTCEMh; - - PROCEDURE SetAttr*(attr : ARRAY OF CHAR); - VAR tmpstr : ARRAY 16 OF CHAR; - BEGIN - COPY(CSI, tmpstr); - Strings.Append(attr, tmpstr); - Console.String(tmpstr); - END SetAttr; - - BEGIN - (* init CSI sequence *) - COPY(Escape, CSI); - Strings.Append(LeftCrotchet, CSI); -(* - EraseDisplay; - GotoXY (0, 0); - COPY(CSI, tmpstr); - Strings.Append(Green, tmpstr); - Strings.Append("hello", tmpstr); - Console.String(tmpstr); Console.Ln; -*) - END vt100. diff --git a/src/library/s3/ethReals.Mod b/src/library/s3/ethReals.Mod index 5851cd17..ea2d9d9f 100644 --- a/src/library/s3/ethReals.Mod +++ b/src/library/s3/ethReals.Mod @@ -10,7 +10,7 @@ Implemented by Bernd Moesli, Seminar for Applied Mathematics, Swiss Federal Institute of Technology Z…rich. *) -IMPORT SYSTEM, Platform, Configuration; +IMPORT SYSTEM, Platform; (* Bernd Moesli Seminar for Applied Mathematics diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index 69f994bb..3b26e498 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -131,7 +131,7 @@ PROCEDURE fraction*(x: LONGREAL): LONGREAL; significant) part of `x'. Hence the following relationship shall hold: x = scale(fraction(x), exponent(x)). *) - VAR s: SET; + VAR s: SYSTEM.SET64; BEGIN IF x = ZERO THEN RETURN ZERO ELSE @@ -170,7 +170,7 @@ PROCEDURE scale*(x: LONGREAL; n: INTEGER): LONGREAL; The value of the call scale(x,n) shall be the value x*radix^n if such a value exists; otherwise an execption shall occur and may be raised. *) - VAR exp: LONGINT; lexp: SYSTEM.SET64; + VAR exp: HUGEINT; lexp: SYSTEM.SET64; BEGIN IF x = ZERO THEN RETURN ZERO END; exp := exponent(x) + n; (* new exponent *) diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 6ba07c09..1de04671 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -199,4 +199,5 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); BEGIN RealP(x, n, TRUE); END LongReal; +BEGIN in := 0 END Out. diff --git a/src/runtime/vt100.Mod b/src/runtime/vt100.Mod index f21df4a6..03cc1d2c 100644 --- a/src/runtime/vt100.Mod +++ b/src/runtime/vt100.Mod @@ -1,4 +1,4 @@ -MODULE vt100; +MODULE VT100; IMPORT Out, Strings; (* reference http://en.wikipedia.org/wiki/ANSI_escape_code @@ -339,4 +339,4 @@ CONST Strings.Append("hello", tmpstr); Out.String(tmpstr); Out.Ln; *) - END vt100. + END VT100. diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index d8a8dd6b..8e581356 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -110,7 +110,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/vt100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod @@ -161,17 +161,19 @@ install: @cp $(OBECOMP) "$(INSTALLDIR)/bin/$(OBECOMP)" @-cp $(BUILDDIR)/showdef$(BINEXT) "$(INSTALLDIR)/bin" - @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/*.h "$(INSTALLDIR)/2/include/" - @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/*.sym "$(INSTALLDIR)/2/sym/" + @mkdir -p "$(INSTALLDIR)/2/include" && cp $(BUILDDIR)/2/*.h "$(INSTALLDIR)/2/include/" + @mkdir -p "$(INSTALLDIR)/2/sym" && cp $(BUILDDIR)/2/*.sym "$(INSTALLDIR)/2/sym/" @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" @mkdir -p "$(INSTALLDIR)/lib" - @cp $(BUILDDIR)/lib$(ONAME)* "$(INSTALLDIR)/lib/" + @cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/" @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @if which ldconfig >/dev/null 2>&1; then $(LDCONFIG); fi + + # showpath: Describe how to set the PATH variable showpath: @printf "\nNow add $(INSTALLDIR)/bin to your path, for example with the command:\n" @@ -190,190 +192,193 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" - mkdir -p $(BUILDDIR)/$(MODEL) - cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod - @printf "\nMaking lib$(ONAME)$(MODEL)\n" - ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o - @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)$(MODEL).so *.o - v4: - @printf "\nMaking v4 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Args.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Console.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Printer.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/v4/Sets.Mod + @printf "\nMaking v4 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Args.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Console.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Printer.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: - @printf "\nMaking ooc2 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc2/ooc2Real0.Mod - - -TODO: Comment disabled lines contain use of VAL that reads beyond source variable + @printf "\nMaking ooc2 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: - @printf "\nMaking ooc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ooc/oocC$(DATAMODEL).Mod + @printf "\nMaking ooc library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: - @printf "\nMaking oocX11 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/oocX11/oocXYplane.Mod + @printf "\nMaking oocX11 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: - @printf "\nMaking ulm library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/ulm/ulmIntOperations.Mod + @printf "\nMaking ulm library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: - @printf "\nMaking pow library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/pow/powStrings.Mod + @printf "\nMaking pow library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: - @printf "\nMaking misc library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/runtime/Oberon.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/crt.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/Listen.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/misc/MultiArrayRiders.Mod + @printf "\nMaking misc library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/crt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/Listen.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: - @printf "\nMaking s3 library\n" - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethSets.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethZip.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethDates.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethReals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ffs -O2 ../../src/library/s3/ethStrings.Mod + @printf "\nMaking s3 library for -O$(MODEL)\n" + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZip.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethDates.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod -O2library: v4 ooc2 ooc ulm pow32 misc s3 - @printf "\nMaking lib$(ONAME)2\n" - rm -f $(BUILDDIR)/Compiler.o -# Note: remining compiler files are retained in the library allowing the building -# of utilities like BrowserCmd.Mod (aka showdef). -# Make static library - ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o -# Make shared library - @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o +# O2library: v4 ooc2 ooc ulm pow32 misc s3 runtime +# @printf "\nMaking lib$(ONAME)2\n" +# rm -f $(BUILDDIR)/Compiler.o +# # Note: remining compiler files are retained in the library allowing the building +# # of utilities like BrowserCmd.Mod (aka showdef). +# # Make static library +# ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o +# # Make shared library +# @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o +O2library: runtime v4 ooc2 ooc ulm pow32 misc s3 +OClibrary: runtime + +library: + @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" + rm -rf $(BUILDDIR)/$(MODEL) + mkdir -p $(BUILDDIR)/$(MODEL) + cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) + cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) + @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" + ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o + @cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -shared -o lib$(ONAME)-O$(MODEL).so *.o From 1507d9cb0afeb1e14d088f0574753a50dd0e58c1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 19:05:08 +0100 Subject: [PATCH 086/140] Force git rename of VT100 in bootstrap, make SYSTEM.* mdel independent. --- bootstrap/SYSTEM.c | 22 ++++++++--- bootstrap/SYSTEM.h | 45 +++++++++++------------ bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Platform.c | 8 ++-- bootstrap/unix-44/Platform.h | 4 +- bootstrap/unix-44/{vt100.c => VT100.c} | 0 bootstrap/unix-44/{vt100.h => VT100.h} | 0 bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Platform.c | 8 ++-- bootstrap/unix-48/Platform.h | 4 +- bootstrap/unix-48/{vt100.c => VT100.c} | 0 bootstrap/unix-48/{vt100.h => VT100.h} | 0 bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Platform.c | 8 ++-- bootstrap/unix-88/Platform.h | 4 +- bootstrap/unix-88/{vt100.c => VT100.c} | 0 bootstrap/unix-88/{vt100.h => VT100.h} | 0 bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Platform.c | 8 ++-- bootstrap/windows-48/Platform.h | 4 +- bootstrap/windows-48/{vt100.c => VT100.c} | 0 bootstrap/windows-48/{vt100.h => VT100.h} | 0 bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Platform.c | 8 ++-- bootstrap/windows-88/Platform.h | 4 +- bootstrap/windows-88/{vt100.c => VT100.c} | 0 bootstrap/windows-88/{vt100.h => VT100.h} | 0 src/compiler/Compiler.Mod | 2 +- src/runtime/Platformunix.Mod | 12 +++--- src/runtime/Platformwindows.Mod | 8 ++-- src/runtime/SYSTEM.c | 22 ++++++++--- src/runtime/SYSTEM.h | 45 +++++++++++------------ src/test/confidence/signal/signal.mod | 4 +- src/tools/make/configure.c | 43 ++++++++++++---------- 34 files changed, 152 insertions(+), 131 deletions(-) rename bootstrap/unix-44/{vt100.c => VT100.c} (100%) rename bootstrap/unix-44/{vt100.h => VT100.h} (100%) rename bootstrap/unix-48/{vt100.c => VT100.c} (100%) rename bootstrap/unix-48/{vt100.h => VT100.h} (100%) rename bootstrap/unix-88/{vt100.c => VT100.c} (100%) rename bootstrap/unix-88/{vt100.h => VT100.h} (100%) rename bootstrap/windows-48/{vt100.c => VT100.c} (100%) rename bootstrap/windows-48/{vt100.h => VT100.h} (100%) rename bootstrap/windows-88/{vt100.c => VT100.c} (100%) rename bootstrap/windows-88/{vt100.h => VT100.h} (100%) diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index 6efc8321..b97144e7 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -46,20 +46,30 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -LONGINT SYSTEM_ENTIER(double x) +// LONGINT SYSTEM_ENTIER(double x) +// { +// LONGINT y; +// if (x >= 0) +// return (LONGINT)x; +// else { +// y = (LONGINT)x; +// if (y <= x) return y; else return y - 1; +// } +// } + +int64 SYSTEM_ENTIER(double x) { - LONGINT y; + int64 y; if (x >= 0) - return (LONGINT)x; + return (int64)x; else { - y = (LONGINT)x; + y = (int64)x; if (y <= x) return y; else return y - 1; } } - void SYSTEM_INHERIT(address *t, address *t0) { t -= __TPROC0OFF; @@ -155,7 +165,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler #ifndef _WIN32 diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 4e1bfe18..7cba936e 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -8,20 +8,19 @@ #define __o_64 #endif -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif +// // Temporary while bootstrapping and clearing up SYSTEM.c. +// +// #ifndef LONGINT +// #if defined (__o_64) +// #define INTEGER int32 +// #define LONGINT int64 +// #define SET uint64 +// #else +// #define INTEGER int16 +// #define LONGINT int32 +// #define SET uint32 +// #endif +// #endif @@ -119,11 +118,11 @@ extern void Platform_OSFree (address addr); // Assertions and Halts -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); +extern void Platform_Halt(int32 x); +extern void Platform_AssertFail(int32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) // Index checking @@ -136,7 +135,7 @@ static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -157,7 +156,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; + int64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -212,7 +211,7 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern LONGINT SYSTEM_ENTIER (double x); +extern int64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) @@ -275,10 +274,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, address argv); +extern void Platform_Init(int32 argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -287,7 +286,7 @@ extern void Heap_FINALL(); extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); +extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) #define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index ff57e9c4..0fe40111 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 5e6af8ad..68411f33 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/VT100.c similarity index 100% rename from bootstrap/unix-44/vt100.c rename to bootstrap/unix-44/VT100.c diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/VT100.h similarity index 100% rename from bootstrap/unix-44/vt100.h rename to bootstrap/unix-44/VT100.h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index ff57e9c4..0fe40111 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 5e6af8ad..68411f33 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/VT100.c similarity index 100% rename from bootstrap/unix-48/vt100.c rename to bootstrap/unix-48/VT100.c diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/VT100.h similarity index 100% rename from bootstrap/unix-48/vt100.h rename to bootstrap/unix-48/VT100.h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d58fec88..39e05934 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -65,7 +65,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int64 argvadr); +export void Platform_Init (int32 argc, int64 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -240,11 +240,11 @@ void Platform_OSFree (int64 address) Platform_free(address); } -void Platform_Init (int16 argc, int64 argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 9216622f..24d6dbe4 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -49,7 +49,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int64 argvadr); +import void Platform_Init (int32 argc, int64 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/VT100.c similarity index 100% rename from bootstrap/unix-88/vt100.c rename to bootstrap/unix-88/VT100.c diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/VT100.h similarity index 100% rename from bootstrap/unix-88/vt100.h rename to bootstrap/unix-88/VT100.h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6bc9bf9f..6092ac08 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -67,7 +67,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int32 argc, int32 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -252,11 +252,11 @@ void Platform_OSFree (int32 address) Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int32 argc, int32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 79119240..c3fa315b 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -50,7 +50,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int32 argc, int32 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/VT100.c similarity index 100% rename from bootstrap/windows-48/vt100.c rename to bootstrap/windows-48/VT100.c diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/VT100.h similarity index 100% rename from bootstrap/windows-48/vt100.h rename to bootstrap/windows-48/VT100.h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 82f1ab48..08a80f54 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int16 sig); +static void Compiler_Trap (int32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int16 sig) +static void Compiler_Trap (int32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index eed18d02..d3020826 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -28,7 +28,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); export BOOLEAN Platform_LittleEndian; @@ -67,7 +67,7 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int64 argvadr); +export void Platform_Init (int32 argc, int64 argvadr); export BOOLEAN Platform_Interrupted (int16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); @@ -252,11 +252,11 @@ void Platform_OSFree (int64 address) Platform_free(address); } -void Platform_Init (int16 argc, int64 argvadr) +void Platform_Init (int32 argc, int64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = argc; + Platform_ArgCount = __VAL(int16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index aacc5cad..968219dd 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -15,7 +15,7 @@ typedef void (*Platform_HaltProcedure)(int32); typedef - void (*Platform_SignalHandler)(int16); + void (*Platform_SignalHandler)(int32); import BOOLEAN Platform_LittleEndian; @@ -50,7 +50,7 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int64 argvadr); +import void Platform_Init (int32 argc, int64 argvadr); import BOOLEAN Platform_Interrupted (int16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/VT100.c similarity index 100% rename from bootstrap/windows-88/vt100.c rename to bootstrap/windows-88/VT100.c diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/VT100.h similarity index 100% rename from bootstrap/windows-88/vt100.h rename to bootstrap/windows-88/VT100.h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index d8c688a7..c8e3c40f 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -129,7 +129,7 @@ MODULE Compiler; (* J. Templ 3.2.95 *) END END Translate; - PROCEDURE Trap(sig: INTEGER); + PROCEDURE Trap(sig: SYSTEM.INT32); BEGIN Heap.FINALL(); IF sig = 3 THEN diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3db3f2d7..5359a664 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -7,8 +7,8 @@ CONST StdErr- = 2; TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); + HaltProcedure = PROCEDURE(n: SYSTEM.INT32); + SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; FileHandle* = LONGINT; @@ -124,11 +124,11 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; - ArgCount := argc; + ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; HaltCode := -128; @@ -502,7 +502,7 @@ BEGIN END END DisplayHaltCode; -PROCEDURE Halt*(code: LONGINT); +PROCEDURE Halt*(code: SYSTEM.INT32); BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; @@ -512,7 +512,7 @@ BEGIN exit(SYSTEM.VAL(INTEGER,code)); END Halt; -PROCEDURE AssertFail*(code: LONGINT); +PROCEDURE AssertFail*(code: SYSTEM.INT32); BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 8471eabb..ad9574d1 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -8,8 +8,8 @@ IMPORT SYSTEM; TYPE - HaltProcedure = PROCEDURE(n: LONGINT); - SignalHandler = PROCEDURE(signal: INTEGER); + HaltProcedure = PROCEDURE(n: SYSTEM.INT32); + SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; FileHandle* = LONGINT; @@ -122,11 +122,11 @@ PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); +PROCEDURE Init*(argc: SYSTEM.INT32; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; - ArgCount := argc; + ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; HaltCode := -128; diff --git a/src/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index 6efc8321..b97144e7 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -46,20 +46,30 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -LONGINT SYSTEM_ENTIER(double x) +// LONGINT SYSTEM_ENTIER(double x) +// { +// LONGINT y; +// if (x >= 0) +// return (LONGINT)x; +// else { +// y = (LONGINT)x; +// if (y <= x) return y; else return y - 1; +// } +// } + +int64 SYSTEM_ENTIER(double x) { - LONGINT y; + int64 y; if (x >= 0) - return (LONGINT)x; + return (int64)x; else { - y = (LONGINT)x; + y = (int64)x; if (y <= x) return y; else return y - 1; } } - void SYSTEM_INHERIT(address *t, address *t0) { t -= __TPROC0OFF; @@ -155,7 +165,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler #ifndef _WIN32 diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 4e1bfe18..7cba936e 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -8,20 +8,19 @@ #define __o_64 #endif -// Temporary while bootstrapping and clearing up SYSTEM.c. - - -#ifndef LONGINT - #if defined (__o_64) - #define INTEGER int32 - #define LONGINT int64 - #define SET uint64 - #else - #define INTEGER int16 - #define LONGINT int32 - #define SET uint32 - #endif -#endif +// // Temporary while bootstrapping and clearing up SYSTEM.c. +// +// #ifndef LONGINT +// #if defined (__o_64) +// #define INTEGER int32 +// #define LONGINT int64 +// #define SET uint64 +// #else +// #define INTEGER int16 +// #define LONGINT int32 +// #define SET uint32 +// #endif +// #endif @@ -119,11 +118,11 @@ extern void Platform_OSFree (address addr); // Assertions and Halts -extern void Platform_Halt(LONGINT x); -extern void Platform_AssertFail(LONGINT x); +extern void Platform_Halt(int32 x); +extern void Platform_AssertFail(int32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((LONGINT)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) // Index checking @@ -136,7 +135,7 @@ static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uLONGINT)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -157,7 +156,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - LONGINT i = 0; + int64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -212,7 +211,7 @@ extern int64 SYSTEM_MOD(int64 x, int64 y); #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern LONGINT SYSTEM_ENTIER (double x); +extern int64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) @@ -275,10 +274,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, address argv); +extern void Platform_Init(int32 argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -287,7 +286,7 @@ extern void Heap_FINALL(); extern SYSTEM_PTR Heap_NEWBLK (address size); extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); +extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) #define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) diff --git a/src/test/confidence/signal/signal.mod b/src/test/confidence/signal/signal.mod index c7b58a48..3a897392 100644 --- a/src/test/confidence/signal/signal.mod +++ b/src/test/confidence/signal/signal.mod @@ -1,6 +1,6 @@ (* Test that interrupt and quit are handled correctly. *) MODULE SignalTest; -IMPORT Console, Platform, Files; +IMPORT Console, Platform, Files, SYSTEM; VAR result: Files.File; rider: Files.Rider; @@ -24,7 +24,7 @@ BEGIN END wi; -PROCEDURE handle(signal: INTEGER); +PROCEDURE handle(signal: SYSTEM.INT32); BEGIN Console.Ln; Console.String("Signal: "); Console.Int(signal,1); Console.Ln; ws("Signal "); wi(signal); wl; diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index d3ccc2d1..695fa0e2 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -220,9 +220,9 @@ void determineBuildDate() { struct {char ch; CHAR x;} c; struct {char ch; BOOLEAN x;} b; //struct {char ch; SHORTINT x;} si; -struct {char ch; INTEGER x;} i; -struct {char ch; LONGINT x;} li; -struct {char ch; SET x;} s; +//struct {char ch; INTEGER x;} i; +//struct {char ch; LONGINT x;} li; +//struct {char ch; SET x;} s; struct {char ch; REAL x;} r; struct {char ch; LONGREAL x;} lr; struct {char ch; void* x;} p; @@ -254,9 +254,9 @@ void ReportSizesAndAlignments() { printf("CHAR %4zd %4td\n", sizeof(CHAR), (char*)&c.x - (char*)&c); printf("BOOLEAN %4zd %4td\n", sizeof(BOOLEAN), (char*)&b.x - (char*)&b); //printf("SHORTINT %4zd %4td\n", sizeof(SHORTINT), (char*)&si.x - (char*)&si); - printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); - printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); - printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); +//printf("INTEGER %4zd %4td\n", sizeof(INTEGER), (char*)&i.x - (char*)&i); +//printf("LONGINT %4zd %4td\n", sizeof(LONGINT), (char*)&li.x - (char*)&li); +//printf("SET %4zd %4td\n", sizeof(SET), (char*)&s.x - (char*)&s); printf("REAL %4zd %4td\n", sizeof(REAL), (char*)&r.x - (char*)&r); printf("LONGREAL %4zd %4td\n", sizeof(LONGREAL), (char*)&lr.x - (char*)&lr); printf("void* %4zd %4td\n", sizeof(void*), (char*)&p.x - (char*)&p); @@ -318,11 +318,14 @@ void testSystemDotH() { /* test the __SETRNG macro */ long x = 0; - long y = sizeof(SET)*8 - 1; - if (sizeof(SET) == 4) - assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); - else - assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); + long y; + y=31; assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET), 32) != -1."); + y=63; assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET), 32) != -1."); +// long y = sizeof(SET)*8 - 1; +// if (sizeof(SET) == 4) +// assert(__SETRNG(x, y, 32) == -1, "SETRNG(0, MAX(SET)) != -1."); +// else +// assert(__SETRNG(x, y, 64) == -1, "SETRNG(0, MAX(SET)) != -1."); /* test string comparison for extended ascii */ {char a[10], b[10]; @@ -337,11 +340,11 @@ void testSystemDotH() { assert(sizeof(CHAR) == 1, "Size of CHAR not 1."); assert(sizeof(BOOLEAN) == 1, "Size of BOOLEAN not 1."); //assert(sizeof(SHORTINT) == 1, "Size of SHORTINT not 1."); - assert(sizeof(INTEGER) == 2 - || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); - assert(sizeof(LONGINT) == 4 - || sizeof(LONGINT) == 8, "Size of LONGINT neither 4 nor 8 bytes."); - assert(sizeof(SET) == sizeof(LONGINT), "Size of SET differs from size of LONGINT."); +//assert(sizeof(INTEGER) == 2 +// || sizeof(INTEGER) == 4, "Size of INTEGER neither 2 nor 4 bytes."); +//assert(sizeof(LONGINT) == 4 +// || sizeof(LONGINT) == 8, "Size of LONGINT neither 4 nor 8 bytes."); +//assert(sizeof(SET) == sizeof(LONGINT), "Size of SET differs from size of LONGINT."); assert(sizeof(REAL) == 4, "Size of REAL not 4 bytes."); assert(sizeof(LONGREAL) == 8, "Size of LONGREAL not 8 bytes."); assert(sizeof(f.x) == sizeof(p.x), "Size of function pointer differs from size of data pointer."); @@ -351,10 +354,10 @@ void testSystemDotH() { assert(((char*)&c.x - (char*)&c) == 1, "Alignment of CHAR not 1."); assert(((char*)&b.x - (char*)&b) == 1, "Alignment of BOOLEAN not 1."); //assert(((char*)&si.x - (char*)&si) == 1, "Alignment of SHORTINT not 1."); - //assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); +//assert(((char*)&i.x - (char*)&i) == 4, "Alignment of INTEGER not 4 bytes."); assert(((char*)&r.x - (char*)&r) == 4, "Alignment of REAL not 4 bytes."); assert(((char*)&lr.x - (char*)&lr) >= 4, "Alignment of LONGREAL less than 4 bytes."); - assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); +//assert(((char*)&s.x - (char*)&s) == MIN(alignment, sizeof(SET)), "Alignment of SET differs from alignmnet of LONGINT."); assert(((char*)&p.x - (char*)&p) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&f.x - (char*)&f) == addressSize, "Alignment of data pointer differs from address size."); assert(((char*)&lr.x - (char*)&lr) == ((char*)&ll.x - (char*)&ll), "Alignment of LONGREAL differs from alignment of long long."); @@ -362,8 +365,8 @@ void testSystemDotH() { assert(sizeof(rec0) == 1, "CHAR wrapped in record aligns differently to CHAR alone."); assert(sizeof(rec2) == 65, "CHAR array wrapped in record aligns differently to CHAR array alone."); - assert(sizeof(LONGINT) >= sizeof(p.x), "LONGINT should have at least the same size as data pointers."); - assert(sizeof(LONGINT) >= sizeof(f.x), "LONGINT should have at least the same size as function pointers."); +//assert(sizeof(LONGINT) >= sizeof(p.x), "LONGINT should have at least the same size as data pointers."); +//assert(sizeof(LONGINT) >= sizeof(f.x), "LONGINT should have at least the same size as function pointers."); if (((sizeof(rec2)==65) == (sizeof(rec0)==1)) && ((sizeof(rec2)-64) != sizeof(rec0))) printf("error: unsupported record layout sizeof(rec0) = %lu sizeof(rec2) = %lu\n", (long)sizeof(rec0), (long)sizeof(rec2)); From a4ca50f71f749206ba007727b91043d74fbba2dc Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 21:29:20 +0100 Subject: [PATCH 087/140] Fix case of VT100 in make file. --- src/tools/make/oberon.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 8e581356..cd4745d8 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -61,13 +61,13 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c vt100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c errors.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ - Reals.o Texts.o vt100.o errors.o OPM.o extTools.o OPS.o OPT.o \ + Reals.o Texts.o VT100.o errors.o OPM.o extTools.o OPS.o OPT.o \ OPC.o OPV.o OPB.o OPP.o cp src/runtime/*.[ch] $(BUILDDIR) @@ -132,7 +132,7 @@ browsercmd: @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o vt100.o errors.o Configuration.o Strings.o \ + Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ OPC.o From 531e9e090c5e612c27ecc17664f115fb6124f587 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 15 Oct 2016 22:57:48 +0100 Subject: [PATCH 088/140] Oops. Another VT100 file case change. --- src/runtime/{vt100.Mod => VT100.Mod} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/runtime/{vt100.Mod => VT100.Mod} (100%) diff --git a/src/runtime/vt100.Mod b/src/runtime/VT100.Mod similarity index 100% rename from src/runtime/vt100.Mod rename to src/runtime/VT100.Mod From a10c530f98b42395f2c434cab491bcf5bc302b60 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 16 Oct 2016 12:38:32 +0100 Subject: [PATCH 089/140] Trigger rebuild. --- src/tools/make/oberon.mk | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index cd4745d8..dd752faf 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -353,16 +353,6 @@ s3: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod -# O2library: v4 ooc2 ooc ulm pow32 misc s3 runtime -# @printf "\nMaking lib$(ONAME)2\n" -# rm -f $(BUILDDIR)/Compiler.o -# # Note: remining compiler files are retained in the library allowing the building -# # of utilities like BrowserCmd.Mod (aka showdef). -# # Make static library -# ar rcs "$(BUILDDIR)/lib$(ONAME)2.a" $(BUILDDIR)/*.o -# # Make shared library -# @cd $(BUILDDIR) && $(COMPILE) -shared -o lib$(ONAME)2.so *.o - O2library: runtime v4 ooc2 ooc ulm pow32 misc s3 From eda7e88185ece558110a52a7d42f0f39ec306232 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 16 Oct 2016 15:21:32 +0100 Subject: [PATCH 090/140] Add test for Math and MathL modules. --- src/runtime/MathL.Mod | 4 +- src/test/confidence/math/expected | 351 ++++++++++++++++++++++ src/test/confidence/math/mathtest.mod | 145 +++++++++ src/test/confidence/math/test.sh | 5 + src/test/confidence/planned-binary-change | 2 +- src/tools/make/oberon.mk | 3 +- 6 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 src/test/confidence/math/expected create mode 100644 src/test/confidence/math/mathtest.mod create mode 100644 src/test/confidence/math/test.sh diff --git a/src/runtime/MathL.Mod b/src/runtime/MathL.Mod index 3b26e498..bd17b490 100644 --- a/src/runtime/MathL.Mod +++ b/src/runtime/MathL.Mod @@ -114,10 +114,10 @@ VAR LnSmall: LONGREAL; (* natural log of very small number *) SqrtInfinity: LONGREAL; (* square root of infinity *) TanhMax: LONGREAL; (* maximum Tanh value *) - t: LONGREAL; (* internal variables *) NumberMask: SYSTEM.SET64; (* Sign and significand, {0..51, 63} *) ExponentMask: SYSTEM.SET64; (* Exponent part, {53..62} *) ZeroExponent: SYSTEM.SET64; (* Zero valued exponent {54..61} *) + t: LONGREAL; (* internal variables *) i: INTEGER; (* For initialisation loops in module body. *) @@ -675,7 +675,7 @@ BEGIN FOR i := 0 TO 51 DO INCL(NumberMask, i) END; ExponentMask := -NumberMask; ZeroExponent := {}; - FOR i := 54 TO 61 DO INCL(ZeroExponent, i) END; + FOR i := 53 TO 61 DO INCL(ZeroExponent, i) END; (* determine some fundamental constants used by hyperbolic trig functions *) em := ulp(ONE); diff --git a/src/test/confidence/math/expected b/src/test/confidence/math/expected new file mode 100644 index 00000000..f20dccd8 --- /dev/null +++ b/src/test/confidence/math/expected @@ -0,0 +1,351 @@ +Math and MathL module tests. + +Math.fraction(8.99999976E-01): 1.79999995E+00. MathL.fraction(9.0000000000000000D-001): 1.8000000000000000D+000 +Math.fraction(1.00000000E+00): 1.00000000E+00. MathL.fraction(1.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(1.39999998E+00): 1.39999998E+00. MathL.fraction(1.4000000000000000D+000): 1.4000000000000000D+000 +Math.fraction(1.50000000E+00): 1.50000000E+00. MathL.fraction(1.5000000000000000D+000): 1.5000000000000000D+000 +Math.fraction(1.60000002E+00): 1.60000002E+00. MathL.fraction(1.6000000000000000D+000): 1.6000000000000000D+000 +Math.fraction(1.89999998E+00): 1.89999998E+00. MathL.fraction(1.9000000000000000D+000): 1.9000000000000000D+000 +Math.fraction(2.00000000E+00): 1.00000000E+00. MathL.fraction(2.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(2.40000010E+00): 1.20000005E+00. MathL.fraction(2.4000000000000000D+000): 1.2000000000000000D+000 +Math.fraction(2.50000000E+00): 1.25000000E+00. MathL.fraction(2.5000000000000000D+000): 1.2500000000000000D+000 +Math.fraction(3.00000000E+00): 1.50000000E+00. MathL.fraction(3.0000000000000000D+000): 1.5000000000000000D+000 +Math.fraction(4.00000000E+00): 1.00000000E+00. MathL.fraction(4.0000000000000000D+000): 1.0000000000000000D+000 +Math.fraction(-8.9999998E-01): -1.8000000E+00. MathL.fraction(-9.000000000000000D-001): -1.800000000000000D+000 +Math.fraction(-1.0000000E+00): -1.0000000E+00. MathL.fraction(-1.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(-1.4000000E+00): -1.4000000E+00. MathL.fraction(-1.400000000000000D+000): -1.400000000000000D+000 +Math.fraction(-1.5000000E+00): -1.5000000E+00. MathL.fraction(-1.500000000000000D+000): -1.500000000000000D+000 +Math.fraction(-1.6000000E+00): -1.6000000E+00. MathL.fraction(-1.600000000000000D+000): -1.600000000000000D+000 +Math.fraction(-1.9000000E+00): -1.9000000E+00. MathL.fraction(-1.900000000000000D+000): -1.900000000000000D+000 +Math.fraction(-2.0000000E+00): -1.0000000E+00. MathL.fraction(-2.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(-2.4000001E+00): -1.2000000E+00. MathL.fraction(-2.400000000000000D+000): -1.200000000000000D+000 +Math.fraction(-2.5000000E+00): -1.2500000E+00. MathL.fraction(-2.500000000000000D+000): -1.250000000000000D+000 +Math.fraction(-3.0000000E+00): -1.5000000E+00. MathL.fraction(-3.000000000000000D+000): -1.500000000000000D+000 +Math.fraction(-4.0000000E+00): -1.0000000E+00. MathL.fraction(-4.000000000000000D+000): -1.000000000000000D+000 + +Math.round(8.99999976E-01): 1. MathL.round(9.0000000000000000D-001): 1 +Math.round(1.00000000E+00): 1. MathL.round(1.0000000000000000D+000): 1 +Math.round(1.39999998E+00): 1. MathL.round(1.4000000000000000D+000): 1 +Math.round(1.50000000E+00): 2. MathL.round(1.5000000000000000D+000): 2 +Math.round(1.60000002E+00): 2. MathL.round(1.6000000000000000D+000): 2 +Math.round(1.89999998E+00): 2. MathL.round(1.9000000000000000D+000): 2 +Math.round(2.00000000E+00): 2. MathL.round(2.0000000000000000D+000): 2 +Math.round(2.40000010E+00): 2. MathL.round(2.4000000000000000D+000): 2 +Math.round(2.50000000E+00): 3. MathL.round(2.5000000000000000D+000): 3 +Math.round(3.00000000E+00): 3. MathL.round(3.0000000000000000D+000): 3 +Math.round(4.00000000E+00): 4. MathL.round(4.0000000000000000D+000): 4 +Math.round(-8.9999998E-01): -1. MathL.round(-9.000000000000000D-001): -1 +Math.round(-1.0000000E+00): -1. MathL.round(-1.000000000000000D+000): -1 +Math.round(-1.4000000E+00): -1. MathL.round(-1.400000000000000D+000): -1 +Math.round(-1.5000000E+00): -2. MathL.round(-1.500000000000000D+000): -2 +Math.round(-1.6000000E+00): -2. MathL.round(-1.600000000000000D+000): -2 +Math.round(-1.9000000E+00): -2. MathL.round(-1.900000000000000D+000): -2 +Math.round(-2.0000000E+00): -2. MathL.round(-2.000000000000000D+000): -2 +Math.round(-2.4000001E+00): -2. MathL.round(-2.400000000000000D+000): -2 +Math.round(-2.5000000E+00): -3. MathL.round(-2.500000000000000D+000): -3 +Math.round(-3.0000000E+00): -3. MathL.round(-3.000000000000000D+000): -3 +Math.round(-4.0000000E+00): -4. MathL.round(-4.000000000000000D+000): -4 + +Math.sqrt(8.99999976E-01): 9.48683262E-01. MathL.sqrt(9.0000000000000000D-001): 9.4868329805051376D-001 +Math.sqrt(1.00000000E+00): 9.99999940E-01. MathL.sqrt(1.0000000000000000D+000): 1.0000000000000006D+000 +Math.sqrt(1.39999998E+00): 1.18321598E+00. MathL.sqrt(1.4000000000000000D+000): 1.1832159566199240D+000 +Math.sqrt(1.50000000E+00): 1.22474480E+00. MathL.sqrt(1.5000000000000000D+000): 1.2247448713915898D+000 +Math.sqrt(1.60000002E+00): 1.26491106E+00. MathL.sqrt(1.6000000000000000D+000): 1.2649110640673526D+000 +Math.sqrt(1.89999998E+00): 1.37840486E+00. MathL.sqrt(1.9000000000000000D+000): 1.3784048752090230D+000 +Math.sqrt(2.00000000E+00): 1.41421354E+00. MathL.sqrt(2.0000000000000000D+000): 1.4142135623730952D+000 +Math.sqrt(2.40000010E+00): 1.54919338E+00. MathL.sqrt(2.4000000000000000D+000): 1.5491933384829668D+000 +Math.sqrt(2.50000000E+00): 1.58113885E+00. MathL.sqrt(2.5000000000000000D+000): 1.5811388300841898D+000 +Math.sqrt(3.00000000E+00): 1.73205078E+00. MathL.sqrt(3.0000000000000000D+000): 1.7320508075688772D+000 +Math.sqrt(4.00000000E+00): 1.99999988E+00. MathL.sqrt(4.0000000000000000D+000): 2.0000000000000012D+000 +Math.sqrt(-8.9999998E-01): 9.48683262E-01. MathL.sqrt(-9.000000000000000D-001): 9.4868329805051376D-001 +Math.sqrt(-1.0000000E+00): 9.99999940E-01. MathL.sqrt(-1.000000000000000D+000): 1.0000000000000006D+000 +Math.sqrt(-1.4000000E+00): 1.18321598E+00. MathL.sqrt(-1.400000000000000D+000): 1.1832159566199240D+000 +Math.sqrt(-1.5000000E+00): 1.22474480E+00. MathL.sqrt(-1.500000000000000D+000): 1.2247448713915898D+000 +Math.sqrt(-1.6000000E+00): 1.26491106E+00. MathL.sqrt(-1.600000000000000D+000): 1.2649110640673526D+000 +Math.sqrt(-1.9000000E+00): 1.37840486E+00. MathL.sqrt(-1.900000000000000D+000): 1.3784048752090230D+000 +Math.sqrt(-2.0000000E+00): 1.41421354E+00. MathL.sqrt(-2.000000000000000D+000): 1.4142135623730952D+000 +Math.sqrt(-2.4000001E+00): 1.54919338E+00. MathL.sqrt(-2.400000000000000D+000): 1.5491933384829668D+000 +Math.sqrt(-2.5000000E+00): 1.58113885E+00. MathL.sqrt(-2.500000000000000D+000): 1.5811388300841898D+000 +Math.sqrt(-3.0000000E+00): 1.73205078E+00. MathL.sqrt(-3.000000000000000D+000): 1.7320508075688772D+000 +Math.sqrt(-4.0000000E+00): 1.99999988E+00. MathL.sqrt(-4.000000000000000D+000): 2.0000000000000012D+000 + +Math.exp(8.99999976E-01): 2.45960307E+00. MathL.exp(9.0000000000000000D-001): 2.4596031111569500D+000 +Math.exp(1.00000000E+00): 2.71828175E+00. MathL.exp(1.0000000000000000D+000): 2.7182818284590456D+000 +Math.exp(1.39999998E+00): 4.05520010E+00. MathL.exp(1.4000000000000000D+000): 4.0551999668446744D+000 +Math.exp(1.50000000E+00): 4.48168898E+00. MathL.exp(1.5000000000000000D+000): 4.4816890703380648D+000 +Math.exp(1.60000002E+00): 4.95303249E+00. MathL.exp(1.6000000000000000D+000): 4.9530324243951152D+000 +Math.exp(1.89999998E+00): 6.68589401E+00. MathL.exp(1.9000000000000000D+000): 6.6858944422792688D+000 +Math.exp(2.00000000E+00): 7.38905621E+00. MathL.exp(2.0000000000000000D+000): 7.3890560989306512D+000 +Math.exp(2.40000010E+00): 1.10231771E+01. MathL.exp(2.4000000000000000D+000): 1.1023176380641602D+001 +Math.exp(2.50000000E+00): 1.21824942E+01. MathL.exp(2.5000000000000000D+000): 1.2182493960703474D+001 +Math.exp(3.00000000E+00): 2.00855370E+01. MathL.exp(3.0000000000000000D+000): 2.0085536923187668D+001 +Math.exp(4.00000000E+00): 5.45981522E+01. MathL.exp(4.0000000000000000D+000): 5.4598150033144232D+001 +Math.exp(-8.9999998E-01): 4.06569660E-01. MathL.exp(-9.000000000000000D-001): 4.0656965974060152D-001 +Math.exp(-1.0000000E+00): 3.67879450E-01. MathL.exp(-1.000000000000000D+000): 3.6787944117144232D-001 +Math.exp(-1.4000000E+00): 2.46596977E-01. MathL.exp(-1.400000000000000D+000): 2.4659696394176248D-001 +Math.exp(-1.5000000E+00): 2.23130152E-01. MathL.exp(-1.500000000000000D+000): 2.2313016014844684D-001 +Math.exp(-1.6000000E+00): 2.01896518E-01. MathL.exp(-1.600000000000000D+000): 2.0189651799465632D-001 +Math.exp(-1.9000000E+00): 1.49568617E-01. MathL.exp(-1.900000000000000D+000): 1.4956861922474082D-001 +Math.exp(-2.0000000E+00): 1.35335281E-01. MathL.exp(-2.000000000000000D+000): 1.3533528323704446D-001 +Math.exp(-2.4000001E+00): 9.07179415E-02. MathL.exp(-2.400000000000000D+000): 9.0717953289412512D-002 +Math.exp(-2.5000000E+00): 8.20849985E-02. MathL.exp(-2.500000000000000D+000): 8.2084998627778512D-002 +Math.exp(-3.0000000E+00): 4.97870669E-02. MathL.exp(-3.000000000000000D+000): 4.9787068367864088D-002 +Math.exp(-4.0000000E+00): 1.83156393E-02. MathL.exp(-4.000000000000000D+000): 1.8315638888927552D-002 + +Math.ln(8.99999976E-01): -1.0536054E-01. MathL.ln(9.0000000000000000D-001): -1.053605156578263D-001 +Math.ln(1.00000000E+00): 0.00000000E+00. MathL.ln(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.ln(1.39999998E+00): 3.36472213E-01. MathL.ln(1.4000000000000000D+000): 3.3647223662121288D-001 +Math.ln(1.50000000E+00): 4.05465096E-01. MathL.ln(1.5000000000000000D+000): 4.0546510810816440D-001 +Math.ln(1.60000002E+00): 4.70003664E-01. MathL.ln(1.6000000000000000D+000): 4.7000362924573560D-001 +Math.ln(1.89999998E+00): 6.41853869E-01. MathL.ln(1.9000000000000000D+000): 6.4185388617239472D-001 +Math.ln(2.00000000E+00): 6.93147182E-01. MathL.ln(2.0000000000000000D+000): 6.9314718055994528D-001 +Math.ln(2.40000010E+00): 8.75468791E-01. MathL.ln(2.4000000000000000D+000): 8.7546873735390000D-001 +Math.ln(2.50000000E+00): 9.16290760E-01. MathL.ln(2.5000000000000000D+000): 9.1629073187415488D-001 +Math.ln(3.00000000E+00): 1.09861231E+00. MathL.ln(3.0000000000000000D+000): 1.0986122886681098D+000 +Math.ln(4.00000000E+00): 1.38629436E+00. MathL.ln(4.0000000000000000D+000): 1.3862943611198906D+000 +Math.ln(-8.9999998E-01): -3.4028235E+38. MathL.ln(-9.000000000000000D-001): -1.797692963420939D+308 +Math.ln(-1.0000000E+00): -3.4028235E+38. MathL.ln(-1.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.4000000E+00): -3.4028235E+38. MathL.ln(-1.400000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.5000000E+00): -3.4028235E+38. MathL.ln(-1.500000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.6000000E+00): -3.4028235E+38. MathL.ln(-1.600000000000000D+000): -1.797692963420939D+308 +Math.ln(-1.9000000E+00): -3.4028235E+38. MathL.ln(-1.900000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.0000000E+00): -3.4028235E+38. MathL.ln(-2.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.4000001E+00): -3.4028235E+38. MathL.ln(-2.400000000000000D+000): -1.797692963420939D+308 +Math.ln(-2.5000000E+00): -3.4028235E+38. MathL.ln(-2.500000000000000D+000): -1.797692963420939D+308 +Math.ln(-3.0000000E+00): -3.4028235E+38. MathL.ln(-3.000000000000000D+000): -1.797692963420939D+308 +Math.ln(-4.0000000E+00): -3.4028235E+38. MathL.ln(-4.000000000000000D+000): -1.797692963420939D+308 + +Math.sin(0.00000000E+00): 0.00000000E+00. MathL.sin(0.0000000000000000D+000): 0.0000000000000000D+000 +Math.sin(1.00000001E-01): 9.98334214E-02. MathL.sin(1.0000000000000000D-001): 9.9833416646828144D-002 +Math.sin(1.04719758E+00): 8.66025388E-01. MathL.sin(1.0471975511966000D+000): 8.6602540378443952D-001 +Math.sin(1.57079637E+00): 1.00000000E+00. MathL.sin(1.5707963267949002D+000): 9.9999999999999872D-001 +Math.sin(3.14159274E+00): -3.1086245E-15. MathL.sin(3.1415926535897900D+000): 3.2310867983985708D-015 +Math.sin(-1.0471976E+00): -8.6602539E-01. MathL.sin(-1.047197551196600D+000): -8.660254037844394D-001 +Math.sin(-1.5707964E+00): -1.0000000E+00. MathL.sin(-1.570796326794900D+000): -9.999999999999988D-001 +Math.sin(-3.1415927E+00): 3.10862447E-15. MathL.sin(-3.141592653589790D+000): -3.231086798398571D-015 + +Math.cos(0.00000000E+00): 1.00000000E+00. MathL.cos(0.0000000000000000D+000): 9.9999999999999856D-001 +Math.cos(1.00000001E-01): 9.95004177E-01. MathL.cos(1.0000000000000000D-001): 9.9500416527802480D-001 +Math.cos(1.04719758E+00): 5.00000000E-01. MathL.cos(1.0471975511966000D+000): 4.9999999999999808D-001 +Math.cos(1.57079637E+00): -1.5543122E-15. MathL.cos(1.5707963267949002D+000): -3.491482514076435D-015 +Math.cos(3.14159274E+00): -1.0000000E+00. MathL.cos(3.1415926535897900D+000): -9.999999999999988D-001 +Math.cos(-1.0471976E+00): 5.00000000E-01. MathL.cos(-1.047197551196600D+000): 4.9999999999999808D-001 +Math.cos(-1.5707964E+00): -1.5543122E-15. MathL.cos(-1.570796326794900D+000): -3.491482514076435D-015 +Math.cos(-3.1415927E+00): -1.0000000E+00. MathL.cos(-3.141592653589790D+000): -9.999999999999988D-001 + +Math.tan(0.00000000E+00): 0.00000000E+00. MathL.tan(0.0000000000000000D+000): 0.0000000000000000D+000 +Math.tan(1.00000001E-01): 1.00334682E-01. MathL.tan(1.0000000000000000D-001): 1.0033467208545054D-001 +Math.tan(1.04719758E+00): 1.73205066E+00. MathL.tan(1.0471975511966000D+000): 1.7320508075688840D+000 +Math.tan(1.57079637E+00): 3.00239991E+14. MathL.tan(1.5707963267949002D+000): 2.0234083817726248D+007 +Math.tan(3.14159274E+00): -6.6613381E-15. MathL.tan(3.1415926535897900D+000): 3.2310867983985684D-015 +Math.tan(-1.0471976E+00): -1.7320507E+00. MathL.tan(-1.047197551196600D+000): -1.732050807568884D+000 +Math.tan(-1.5707964E+00): -3.0023999E+14. MathL.tan(-1.570796326794900D+000): -2.023408381772625D+007 +Math.tan(-3.1415927E+00): 6.66133815E-15. MathL.tan(-3.141592653589790D+000): -3.231086798398569D-015 + +Math.arcsin(8.99999976E-01): -4.5102686E-01. MathL.arcsin(9.0000000000000000D-001): 1.1197695149986360D+000 +Math.arcsin(1.00000000E+00): -0.0000000E+00. MathL.arcsin(1.0000000000000000D+000): 1.5707963267949002D+000 +Math.arcsin(1.39999998E+00): 3.40282347E+38. MathL.arcsin(1.4000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.50000000E+00): 3.40282347E+38. MathL.arcsin(1.5000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.60000002E+00): 3.40282347E+38. MathL.arcsin(1.6000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(1.89999998E+00): 3.40282347E+38. MathL.arcsin(1.9000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.00000000E+00): 3.40282347E+38. MathL.arcsin(2.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.40000010E+00): 3.40282347E+38. MathL.arcsin(2.4000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(2.50000000E+00): 3.40282347E+38. MathL.arcsin(2.5000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(3.00000000E+00): 3.40282347E+38. MathL.arcsin(3.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(4.00000000E+00): 3.40282347E+38. MathL.arcsin(4.0000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-8.9999998E-01): -4.5102686E-01. MathL.arcsin(-9.000000000000000D-001): -1.119769514998636D+000 +Math.arcsin(-1.0000000E+00): -0.0000000E+00. MathL.arcsin(-1.000000000000000D+000): -1.570796326794900D+000 +Math.arcsin(-1.4000000E+00): 3.40282347E+38. MathL.arcsin(-1.400000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.5000000E+00): 3.40282347E+38. MathL.arcsin(-1.500000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.6000000E+00): 3.40282347E+38. MathL.arcsin(-1.600000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-1.9000000E+00): 3.40282347E+38. MathL.arcsin(-1.900000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.0000000E+00): 3.40282347E+38. MathL.arcsin(-2.000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.4000001E+00): 3.40282347E+38. MathL.arcsin(-2.400000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-2.5000000E+00): 3.40282347E+38. MathL.arcsin(-2.500000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-3.0000000E+00): 3.40282347E+38. MathL.arcsin(-3.000000000000000D+000): 1.7976929634209390D+308 +Math.arcsin(-4.0000000E+00): 3.40282347E+38. MathL.arcsin(-4.000000000000000D+000): 1.7976929634209390D+308 + +Math.arccos(8.99999976E-01): -4.5102686E-01. MathL.arccos(9.0000000000000000D-001): 4.5102681179626320D-001 +Math.arccos(1.00000000E+00): -0.0000000E+00. MathL.arccos(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.arccos(1.39999998E+00): 3.40282347E+38. MathL.arccos(1.4000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.50000000E+00): 3.40282347E+38. MathL.arccos(1.5000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.60000002E+00): 3.40282347E+38. MathL.arccos(1.6000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(1.89999998E+00): 3.40282347E+38. MathL.arccos(1.9000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.00000000E+00): 3.40282347E+38. MathL.arccos(2.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.40000010E+00): 3.40282347E+38. MathL.arccos(2.4000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(2.50000000E+00): 3.40282347E+38. MathL.arccos(2.5000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(3.00000000E+00): 3.40282347E+38. MathL.arccos(3.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(4.00000000E+00): 3.40282347E+38. MathL.arccos(4.0000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-8.9999998E-01): -4.5102686E-01. MathL.arccos(-9.000000000000000D-001): 2.6905658417935268D+000 +Math.arccos(-1.0000000E+00): -0.0000000E+00. MathL.arccos(-1.000000000000000D+000): 3.1415926535897900D+000 +Math.arccos(-1.4000000E+00): 3.40282347E+38. MathL.arccos(-1.400000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.5000000E+00): 3.40282347E+38. MathL.arccos(-1.500000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.6000000E+00): 3.40282347E+38. MathL.arccos(-1.600000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-1.9000000E+00): 3.40282347E+38. MathL.arccos(-1.900000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.0000000E+00): 3.40282347E+38. MathL.arccos(-2.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.4000001E+00): 3.40282347E+38. MathL.arccos(-2.400000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-2.5000000E+00): 3.40282347E+38. MathL.arccos(-2.500000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-3.0000000E+00): 3.40282347E+38. MathL.arccos(-3.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(-4.0000000E+00): 3.40282347E+38. MathL.arccos(-4.000000000000000D+000): 1.7976929634209390D+308 + +Math.arctan(8.99999976E-01): 7.32815087E-01. MathL.arctan(9.0000000000000000D-001): 7.3281510178650752D-001 +Math.arctan(1.00000000E+00): 7.85398126E-01. MathL.arctan(1.0000000000000000D+000): 7.8539816339744912D-001 +Math.arctan(1.39999998E+00): 9.50546861E-01. MathL.arctan(1.4000000000000000D+000): 9.5054684081207680D-001 +Math.arctan(1.50000000E+00): 9.82793748E-01. MathL.arctan(1.5000000000000000D+000): 9.8279372324733072D-001 +Math.arctan(1.60000002E+00): 1.01219702E+00. MathL.arctan(1.6000000000000000D+000): 1.0121970114513358D+000 +Math.arctan(1.89999998E+00): 1.08631849E+00. MathL.arctan(1.9000000000000000D+000): 1.0863183977578750D+000 +Math.arctan(2.00000000E+00): 1.10714877E+00. MathL.arctan(2.0000000000000000D+000): 1.1071487177940922D+000 +Math.arctan(2.40000010E+00): 1.17600524E+00. MathL.arctan(2.4000000000000000D+000): 1.1760052070951368D+000 +Math.arctan(2.50000000E+00): 1.19028997E+00. MathL.arctan(2.5000000000000000D+000): 1.1902899496825334D+000 +Math.arctan(3.00000000E+00): 1.24904585E+00. MathL.arctan(3.0000000000000000D+000): 1.2490457723982562D+000 +Math.arctan(4.00000000E+00): 1.32581770E+00. MathL.arctan(4.0000000000000000D+000): 1.3258176636680358D+000 +Math.arctan(-8.9999998E-01): -7.3281509E-01. MathL.arctan(-9.000000000000000D-001): -7.328151017865076D-001 +Math.arctan(-1.0000000E+00): -7.8539813E-01. MathL.arctan(-1.000000000000000D+000): -7.853981633974492D-001 +Math.arctan(-1.4000000E+00): -9.5054686E-01. MathL.arctan(-1.400000000000000D+000): -9.505468408120768D-001 +Math.arctan(-1.5000000E+00): -9.8279375E-01. MathL.arctan(-1.500000000000000D+000): -9.827937232473306D-001 +Math.arctan(-1.6000000E+00): -1.0121970E+00. MathL.arctan(-1.600000000000000D+000): -1.012197011451336D+000 +Math.arctan(-1.9000000E+00): -1.0863185E+00. MathL.arctan(-1.900000000000000D+000): -1.086318397757875D+000 +Math.arctan(-2.0000000E+00): -1.1071488E+00. MathL.arctan(-2.000000000000000D+000): -1.107148717794092D+000 +Math.arctan(-2.4000001E+00): -1.1760052E+00. MathL.arctan(-2.400000000000000D+000): -1.176005207095137D+000 +Math.arctan(-2.5000000E+00): -1.1902900E+00. MathL.arctan(-2.500000000000000D+000): -1.190289949682534D+000 +Math.arctan(-3.0000000E+00): -1.2490458E+00. MathL.arctan(-3.000000000000000D+000): -1.249045772398256D+000 +Math.arctan(-4.0000000E+00): -1.3258177E+00. MathL.arctan(-4.000000000000000D+000): -1.325817663668036D+000 + +Math.sinh(8.99999976E-01): 1.02651668E+00. MathL.sinh(9.0000000000000000D-001): 1.0265167257081750D+000 +Math.sinh(1.00000000E+00): 1.17520118E+00. MathL.sinh(1.0000000000000000D+000): 1.1752011936438012D+000 +Math.sinh(1.39999998E+00): 1.90430152E+00. MathL.sinh(1.4000000000000000D+000): 1.9043015014515340D+000 +Math.sinh(1.50000000E+00): 2.12927938E+00. MathL.sinh(1.5000000000000000D+000): 2.1292794550948172D+000 +Math.sinh(1.60000002E+00): 2.37556791E+00. MathL.sinh(1.6000000000000000D+000): 2.3755679532002296D+000 +Math.sinh(1.89999998E+00): 3.26816273E+00. MathL.sinh(1.9000000000000000D+000): 3.2681629115283168D+000 +Math.sinh(2.00000000E+00): 3.62686038E+00. MathL.sinh(2.0000000000000000D+000): 3.6268604078470192D+000 +Math.sinh(2.40000010E+00): 5.46622944E+00. MathL.sinh(2.4000000000000000D+000): 5.4662292136760936D+000 +Math.sinh(2.50000000E+00): 6.05020475E+00. MathL.sinh(2.5000000000000000D+000): 6.0502044810397872D+000 +Math.sinh(3.00000000E+00): 1.00178747E+01. MathL.sinh(3.0000000000000000D+000): 1.0017874927409902D+001 +Math.sinh(4.00000000E+00): 2.72899189E+01. MathL.sinh(4.0000000000000000D+000): 2.7289917197127748D+001 +Math.sinh(-8.9999998E-01): -1.0265167E+00. MathL.sinh(-9.000000000000000D-001): -1.026516725708175D+000 +Math.sinh(-1.0000000E+00): -1.1752012E+00. MathL.sinh(-1.000000000000000D+000): -1.175201193643801D+000 +Math.sinh(-1.4000000E+00): -1.9043015E+00. MathL.sinh(-1.400000000000000D+000): -1.904301501451534D+000 +Math.sinh(-1.5000000E+00): -2.1292794E+00. MathL.sinh(-1.500000000000000D+000): -2.129279455094817D+000 +Math.sinh(-1.6000000E+00): -2.3755679E+00. MathL.sinh(-1.600000000000000D+000): -2.375567953200230D+000 +Math.sinh(-1.9000000E+00): -3.2681627E+00. MathL.sinh(-1.900000000000000D+000): -3.268162911528317D+000 +Math.sinh(-2.0000000E+00): -3.6268604E+00. MathL.sinh(-2.000000000000000D+000): -3.626860407847019D+000 +Math.sinh(-2.4000001E+00): -5.4662294E+00. MathL.sinh(-2.400000000000000D+000): -5.466229213676094D+000 +Math.sinh(-2.5000000E+00): -6.0502048E+00. MathL.sinh(-2.500000000000000D+000): -6.050204481039788D+000 +Math.sinh(-3.0000000E+00): -1.0017875E+01. MathL.sinh(-3.000000000000000D+000): -1.001787492740990D+001 +Math.sinh(-4.0000000E+00): -2.7289919E+01. MathL.sinh(-4.000000000000000D+000): -2.728991719712775D+001 + +Math.cosh(8.99999976E-01): 1.43308640E+00. MathL.cosh(9.0000000000000000D-001): 1.4330863854487746D+000 +Math.cosh(1.00000000E+00): 1.54308057E+00. MathL.cosh(1.0000000000000000D+000): 1.5430806348152440D+000 +Math.cosh(1.39999998E+00): 2.15089846E+00. MathL.cosh(1.4000000000000000D+000): 2.1508984653931408D+000 +Math.cosh(1.50000000E+00): 2.35240960E+00. MathL.cosh(1.5000000000000000D+000): 2.3524096152432472D+000 +Math.cosh(1.60000002E+00): 2.57746458E+00. MathL.cosh(1.6000000000000000D+000): 2.5774644711948852D+000 +Math.cosh(1.89999998E+00): 3.41773129E+00. MathL.cosh(1.9000000000000000D+000): 3.4177315307509520D+000 +Math.cosh(2.00000000E+00): 3.76219583E+00. MathL.cosh(2.0000000000000000D+000): 3.7621956910836312D+000 +Math.cosh(2.40000010E+00): 5.55694771E+00. MathL.cosh(2.4000000000000000D+000): 5.5569471669655072D+000 +Math.cosh(2.50000000E+00): 6.13228941E+00. MathL.cosh(2.5000000000000000D+000): 6.1322894796636856D+000 +Math.cosh(3.00000000E+00): 1.00676622E+01. MathL.cosh(3.0000000000000000D+000): 1.0067661995777766D+001 +Math.cosh(4.00000000E+00): 2.73082333E+01. MathL.cosh(4.0000000000000000D+000): 2.7308232836016488D+001 +Math.cosh(-8.9999998E-01): 1.43308640E+00. MathL.cosh(-9.000000000000000D-001): 1.4330863854487746D+000 +Math.cosh(-1.0000000E+00): 1.54308057E+00. MathL.cosh(-1.000000000000000D+000): 1.5430806348152440D+000 +Math.cosh(-1.4000000E+00): 2.15089846E+00. MathL.cosh(-1.400000000000000D+000): 2.1508984653931408D+000 +Math.cosh(-1.5000000E+00): 2.35240960E+00. MathL.cosh(-1.500000000000000D+000): 2.3524096152432472D+000 +Math.cosh(-1.6000000E+00): 2.57746458E+00. MathL.cosh(-1.600000000000000D+000): 2.5774644711948852D+000 +Math.cosh(-1.9000000E+00): 3.41773129E+00. MathL.cosh(-1.900000000000000D+000): 3.4177315307509520D+000 +Math.cosh(-2.0000000E+00): 3.76219583E+00. MathL.cosh(-2.000000000000000D+000): 3.7621956910836312D+000 +Math.cosh(-2.4000001E+00): 5.55694771E+00. MathL.cosh(-2.400000000000000D+000): 5.5569471669655072D+000 +Math.cosh(-2.5000000E+00): 6.13228941E+00. MathL.cosh(-2.500000000000000D+000): 6.1322894796636856D+000 +Math.cosh(-3.0000000E+00): 1.00676622E+01. MathL.cosh(-3.000000000000000D+000): 1.0067661995777766D+001 +Math.cosh(-4.0000000E+00): 2.73082333E+01. MathL.cosh(-4.000000000000000D+000): 2.7308232836016488D+001 + +Math.tanh(8.99999976E-01): 7.16297865E-01. MathL.tanh(9.0000000000000000D-001): 7.1629787019902448D-001 +Math.tanh(1.00000000E+00): 7.61594176E-01. MathL.tanh(1.0000000000000000D+000): 7.6159415595576480D-001 +Math.tanh(1.39999998E+00): 8.85351658E-01. MathL.tanh(1.4000000000000000D+000): 8.8535164820226256D-001 +Math.tanh(1.50000000E+00): 9.05148268E-01. MathL.tanh(1.5000000000000000D+000): 9.0514825364486640D-001 +Math.tanh(1.60000002E+00): 9.21668530E-01. MathL.tanh(1.6000000000000000D+000): 9.2166855440647136D-001 +Math.tanh(1.89999998E+00): 9.56237435E-01. MathL.tanh(1.9000000000000000D+000): 9.5623745812773904D-001 +Math.tanh(2.00000000E+00): 9.64027584E-01. MathL.tanh(2.0000000000000000D+000): 9.6402758007581680D-001 +Math.tanh(2.40000010E+00): 9.83674884E-01. MathL.tanh(2.4000000000000000D+000): 9.8367485769368016D-001 +Math.tanh(2.50000000E+00): 9.86614287E-01. MathL.tanh(2.5000000000000000D+000): 9.8661429815143024D-001 +Math.tanh(3.00000000E+00): 9.95054781E-01. MathL.tanh(3.0000000000000000D+000): 9.9505475368673040D-001 +Math.tanh(4.00000000E+00): 9.99329329E-01. MathL.tanh(4.0000000000000000D+000): 9.9932929973906704D-001 +Math.tanh(-8.9999998E-01): -7.1629786E-01. MathL.tanh(-9.000000000000000D-001): -7.162978701990244D-001 +Math.tanh(-1.0000000E+00): -7.6159418E-01. MathL.tanh(-1.000000000000000D+000): -7.615941559557650D-001 +Math.tanh(-1.4000000E+00): -8.8535166E-01. MathL.tanh(-1.400000000000000D+000): -8.853516482022626D-001 +Math.tanh(-1.5000000E+00): -9.0514827E-01. MathL.tanh(-1.500000000000000D+000): -9.051482536448664D-001 +Math.tanh(-1.6000000E+00): -9.2166853E-01. MathL.tanh(-1.600000000000000D+000): -9.216685544064714D-001 +Math.tanh(-1.9000000E+00): -9.5623744E-01. MathL.tanh(-1.900000000000000D+000): -9.562374581277390D-001 +Math.tanh(-2.0000000E+00): -9.6402758E-01. MathL.tanh(-2.000000000000000D+000): -9.640275800758168D-001 +Math.tanh(-2.4000001E+00): -9.8367488E-01. MathL.tanh(-2.400000000000000D+000): -9.836748576936802D-001 +Math.tanh(-2.5000000E+00): -9.8661429E-01. MathL.tanh(-2.500000000000000D+000): -9.866142981514302D-001 +Math.tanh(-3.0000000E+00): -9.9505478E-01. MathL.tanh(-3.000000000000000D+000): -9.950547536867304D-001 +Math.tanh(-4.0000000E+00): -9.9932933E-01. MathL.tanh(-4.000000000000000D+000): -9.993292997390670D-001 + +Math.arcsinh(8.99999976E-01): 8.08866858E-01. MathL.arcsinh(9.0000000000000000D-001): 8.0886693565278304D-001 +Math.arcsinh(1.00000000E+00): 8.81373644E-01. MathL.arcsinh(1.0000000000000000D+000): 8.8137358701954304D-001 +Math.arcsinh(1.39999998E+00): 1.13798201E+00. MathL.arcsinh(1.4000000000000000D+000): 1.1379820462933672D+000 +Math.arcsinh(1.50000000E+00): 1.19476318E+00. MathL.arcsinh(1.5000000000000000D+000): 1.1947632172871094D+000 +Math.arcsinh(1.60000002E+00): 1.24898338E+00. MathL.arcsinh(1.6000000000000000D+000): 1.2489833279048764D+000 +Math.arcsinh(1.89999998E+00): 1.39799833E+00. MathL.arcsinh(1.9000000000000000D+000): 1.3979983651114348D+000 +Math.arcsinh(2.00000000E+00): 1.44363546E+00. MathL.arcsinh(2.0000000000000000D+000): 1.4436354751788108D+000 +Math.arcsinh(2.40000010E+00): 1.60943794E+00. MathL.arcsinh(2.4000000000000000D+000): 1.6094379124341008D+000 +Math.arcsinh(2.50000000E+00): 1.64723110E+00. MathL.arcsinh(2.5000000000000000D+000): 1.6472311463710960D+000 +Math.arcsinh(3.00000000E+00): 1.81844652E+00. MathL.arcsinh(3.0000000000000000D+000): 1.8184464592320672D+000 +Math.arcsinh(4.00000000E+00): 2.09471250E+00. MathL.arcsinh(4.0000000000000000D+000): 2.0947125472611016D+000 +Math.arcsinh(-8.9999998E-01): -8.0886686E-01. MathL.arcsinh(-9.000000000000000D-001): -8.088669356527832D-001 +Math.arcsinh(-1.0000000E+00): -8.8137364E-01. MathL.arcsinh(-1.000000000000000D+000): -8.813735870195430D-001 +Math.arcsinh(-1.4000000E+00): -1.1379820E+00. MathL.arcsinh(-1.400000000000000D+000): -1.137982046293367D+000 +Math.arcsinh(-1.5000000E+00): -1.1947632E+00. MathL.arcsinh(-1.500000000000000D+000): -1.194763217287110D+000 +Math.arcsinh(-1.6000000E+00): -1.2489834E+00. MathL.arcsinh(-1.600000000000000D+000): -1.248983327904876D+000 +Math.arcsinh(-1.9000000E+00): -1.3979983E+00. MathL.arcsinh(-1.900000000000000D+000): -1.397998365111435D+000 +Math.arcsinh(-2.0000000E+00): -1.4436355E+00. MathL.arcsinh(-2.000000000000000D+000): -1.443635475178811D+000 +Math.arcsinh(-2.4000001E+00): -1.6094379E+00. MathL.arcsinh(-2.400000000000000D+000): -1.609437912434101D+000 +Math.arcsinh(-2.5000000E+00): -1.6472311E+00. MathL.arcsinh(-2.500000000000000D+000): -1.647231146371096D+000 +Math.arcsinh(-3.0000000E+00): -1.8184465E+00. MathL.arcsinh(-3.000000000000000D+000): -1.818446459232067D+000 +Math.arcsinh(-4.0000000E+00): -2.0947125E+00. MathL.arcsinh(-4.000000000000000D+000): -2.094712547261102D+000 + +Math.arccosh(8.99999976E-01): 0.00000000E+00. MathL.arccosh(9.0000000000000000D-001): 0.0000000000000000D+000 +Math.arccosh(1.00000000E+00): 0.00000000E+00. MathL.arccosh(1.0000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(1.39999998E+00): 8.67014706E-01. MathL.arccosh(1.4000000000000000D+000): 8.6701472649056496D-001 +Math.arccosh(1.50000000E+00): 9.62423623E-01. MathL.arccosh(1.5000000000000000D+000): 9.6242365011920720D-001 +Math.arccosh(1.60000002E+00): 1.04696786E+00. MathL.arccosh(1.6000000000000000D+000): 1.0469679150031890D+000 +Math.arccosh(1.89999998E+00): 1.25719583E+00. MathL.arccosh(1.9000000000000000D+000): 1.2571958266003804D+000 +Math.arccosh(2.00000000E+00): 1.31695795E+00. MathL.arccosh(2.0000000000000000D+000): 1.3169578969248166D+000 +Math.arccosh(2.40000010E+00): 1.52207935E+00. MathL.arccosh(2.4000000000000000D+000): 1.5220793674636536D+000 +Math.arccosh(2.50000000E+00): 1.56679916E+00. MathL.arccosh(2.5000000000000000D+000): 1.5667992369724114D+000 +Math.arccosh(3.00000000E+00): 1.76274717E+00. MathL.arccosh(3.0000000000000000D+000): 1.7627471740390860D+000 +Math.arccosh(4.00000000E+00): 2.06343699E+00. MathL.arccosh(4.0000000000000000D+000): 2.0634370688955608D+000 +Math.arccosh(-8.9999998E-01): 0.00000000E+00. MathL.arccosh(-9.000000000000000D-001): 0.0000000000000000D+000 +Math.arccosh(-1.0000000E+00): 0.00000000E+00. MathL.arccosh(-1.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.4000000E+00): 0.00000000E+00. MathL.arccosh(-1.400000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.5000000E+00): 0.00000000E+00. MathL.arccosh(-1.500000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.6000000E+00): 0.00000000E+00. MathL.arccosh(-1.600000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-1.9000000E+00): 0.00000000E+00. MathL.arccosh(-1.900000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.0000000E+00): 0.00000000E+00. MathL.arccosh(-2.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.4000001E+00): 0.00000000E+00. MathL.arccosh(-2.400000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-2.5000000E+00): 0.00000000E+00. MathL.arccosh(-2.500000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-3.0000000E+00): 0.00000000E+00. MathL.arccosh(-3.000000000000000D+000): 0.0000000000000000D+000 +Math.arccosh(-4.0000000E+00): 0.00000000E+00. MathL.arccosh(-4.000000000000000D+000): 0.0000000000000000D+000 + +Math.arctanh(8.99999976E-01): 1.47221935E+00. MathL.arctanh(9.0000000000000000D-001): 1.4722194895832210D+000 +Math.arctanh(1.00000000E+00): 8.66434002E+00. MathL.arctanh(1.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.39999998E+00): 8.66434002E+00. MathL.arctanh(1.4000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.50000000E+00): 8.66434002E+00. MathL.arctanh(1.5000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.60000002E+00): 8.66434002E+00. MathL.arctanh(1.6000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(1.89999998E+00): 8.66434002E+00. MathL.arctanh(1.9000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.00000000E+00): 8.66434002E+00. MathL.arctanh(2.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.40000010E+00): 8.66434002E+00. MathL.arctanh(2.4000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(2.50000000E+00): 8.66434002E+00. MathL.arctanh(2.5000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(3.00000000E+00): 8.66434002E+00. MathL.arctanh(3.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(4.00000000E+00): 8.66434002E+00. MathL.arctanh(4.0000000000000000D+000): 1.8714973875118524D+001 +Math.arctanh(-8.9999998E-01): -1.4722193E+00. MathL.arctanh(-9.000000000000000D-001): -1.472219489583221D+000 +Math.arctanh(-1.0000000E+00): -8.6643400E+00. MathL.arctanh(-1.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.4000000E+00): -8.6643400E+00. MathL.arctanh(-1.400000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.5000000E+00): -8.6643400E+00. MathL.arctanh(-1.500000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.6000000E+00): -8.6643400E+00. MathL.arctanh(-1.600000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-1.9000000E+00): -8.6643400E+00. MathL.arctanh(-1.900000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.0000000E+00): -8.6643400E+00. MathL.arctanh(-2.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.4000001E+00): -8.6643400E+00. MathL.arctanh(-2.400000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-2.5000000E+00): -8.6643400E+00. MathL.arctanh(-2.500000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-3.0000000E+00): -8.6643400E+00. MathL.arctanh(-3.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(-4.0000000E+00): -8.6643400E+00. MathL.arctanh(-4.000000000000000D+000): -1.871497387511852D+001 + diff --git a/src/test/confidence/math/mathtest.mod b/src/test/confidence/math/mathtest.mod new file mode 100644 index 00000000..e0ad0485 --- /dev/null +++ b/src/test/confidence/math/mathtest.mod @@ -0,0 +1,145 @@ +MODULE mathtest; +IMPORT Math, MathL, Out, SYSTEM; + +TYPE + RtoR = PROCEDURE(x: REAL): REAL; + LRtoLR = PROCEDURE(x: LONGREAL): LONGREAL; + RtoLI = PROCEDURE(x: REAL): LONGINT; + LRtoLI = PROCEDURE(x: LONGREAL): LONGINT; + + Values = RECORD + v: ARRAY 100 OF LONGREAL; + n: INTEGER + END; + +VAR + r: REAL; + lr: LONGREAL; + misc: Values; + angles: Values; + + +PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; +PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; +PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; +PROCEDURE wr(r: REAL); BEGIN Out.Real(r,14) END wr; +PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,23) END wlr; +PROCEDURE wl; BEGIN Out.Ln END wl; + +PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; b: SYSTEM.INT8; +BEGIN + i := SHORT(LEN(h)); + WHILE i > 0 DO + DEC(i); b := SYSTEM.VAL(SYSTEM.INT8, h[i]); + IF b DIV 16 MOD 16 < 10 THEN wc(CHR(b DIV 16 MOD 16 + 48)) ELSE wc(CHR(b DIV 16 MOD 16 + 55)) END; + IF b MOD 16 < 10 THEN wc(CHR(b MOD 16 + 48)) ELSE wc(CHR(b MOD 16 + 55)) END; + END +END wh; + +PROCEDURE addvalue(lr: LONGREAL; VAR val: Values); +BEGIN val.v[val.n] := lr; INC(val.n) +END addvalue; + +PROCEDURE MathErrorHandler(error: INTEGER); +BEGIN + ws(" ") +END MathErrorHandler; + +PROCEDURE TestRtoR(s: ARRAY OF CHAR; p: RtoR; lp: LRtoLR; val: Values); + VAR i: INTEGER; r: REAL; +BEGIN + i := 0; + WHILE i < val.n DO + r := SHORT(val.v[i]); + ws("Math."); ws(s); ws("("); wr(r); ws("): "); wr(p(r)); + ws(". MathL."); ws(s); ws("("); wlr(val.v[i]); ws("): "); wlr(lp(val.v[i])); wl; + INC(i) + END; + wl; +END TestRtoR; + +PROCEDURE TestRtoLI(s: ARRAY OF CHAR; p: RtoLI; lp: LRtoLI; val: Values); + VAR i: INTEGER; r: REAL; +BEGIN + i := 0; + WHILE i < val.n DO + r := SHORT(val.v[i]); + ws("Math."); ws(s); ws("("); wr(r); ws("): "); wi(p(r)); + ws(". MathL."); ws(s); ws("("); wlr(val.v[i]); ws("): "); wi(lp(val.v[i])); wl; + INC(i) + END; + wl; +END TestRtoLI; + +PROCEDURE round(lr: LONGREAL); + VAR r: REAL; +BEGIN + r := SHORT(lr); + ws("Math.round("); wr(r); ws("): "); wi(Math.round(r)); + ws(". MathL.round("); wlr(lr); ws("): "); wi(MathL.round(lr)); wl +END round; + +PROCEDURE sqrt(lr: LONGREAL); + VAR r: REAL; +BEGIN + r := SHORT(lr); + ws("Math.sqrt("); wr(r); ws("): "); wr(Math.sqrt(r)); + ws(". MathL.sqrt("); wlr(r); ws("): "); wlr(MathL.sqrt(r)); wl +END sqrt; + + +BEGIN + ws("Math and MathL module tests."); wl; wl; + + misc.n := 0; + addvalue(0.9D0, misc); addvalue(1.0D0, misc); addvalue(1.4D0, misc); addvalue(1.5D0, misc); addvalue(1.6D0, misc); addvalue(1.9D0, misc); + addvalue(2.0D0, misc); addvalue(2.4D0, misc); addvalue(2.5D0, misc); + addvalue(3.0D0, misc); addvalue(4.0D0, misc); + + addvalue(-0.9D0, misc); addvalue(-1.0D0, misc); addvalue(-1.4D0, misc); addvalue(-1.5D0, misc); addvalue(-1.6D0, misc); addvalue(-1.9D0, misc); + addvalue(-2.0D0, misc); addvalue(-2.4D0, misc); addvalue(-2.5D0, misc); + addvalue(-3.0D0, misc); addvalue(-4.0D0, misc); + + angles.n:= 0; + addvalue(0.0D0, angles); addvalue(0.1D0, angles); + addvalue(MathL.pi/3.0D0, angles); addvalue(MathL.pi/2.0D0, angles); addvalue(MathL.pi, angles); + addvalue(-MathL.pi/3.0D0, angles); addvalue(-MathL.pi/2.0D0, angles); addvalue(-MathL.pi, angles); + + TestRtoR("fraction", Math.fraction, MathL.fraction, misc); + TestRtoLI("round", Math.round, MathL.round, misc); + TestRtoR("sqrt", Math.sqrt, MathL.sqrt, misc); + TestRtoR("exp", Math.exp, MathL.exp, misc); + TestRtoR("ln", Math.ln, MathL.ln, misc); + TestRtoR("sin", Math.sin, MathL.sin, angles); + TestRtoR("cos", Math.cos, MathL.cos, angles); + TestRtoR("tan", Math.tan, MathL.tan, angles); + TestRtoR("arcsin", Math.arcsin, MathL.arcsin, misc); + TestRtoR("arccos", Math.arccos, MathL.arccos, misc); + TestRtoR("arctan", Math.arctan, MathL.arctan, misc); + TestRtoR("sinh", Math.sinh, MathL.sinh, misc); + TestRtoR("cosh", Math.cosh, MathL.cosh, misc); + TestRtoR("tanh", Math.tanh, MathL.tanh, misc); + TestRtoR("arcsinh", Math.arcsinh, MathL.arcsinh, misc); + TestRtoR("arccosh", Math.arccosh, MathL.arccosh, misc); + TestRtoR("arctanh", Math.arctanh, MathL.arctanh, misc); + + (* todo power, log, ipower, sincos, arctan2 *) + +END mathtest. diff --git a/src/test/confidence/math/test.sh b/src/test/confidence/math/test.sh new file mode 100644 index 00000000..e8b5b827 --- /dev/null +++ b/src/test/confidence/math/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP mathtest.mod -m -OC +./mathtest >result +. ../testresult.sh diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 0e593b78..02241a25 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -30 Sep 2016 18:58:19 +16 Oct 2016 13:42:18 diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index dd752faf..6a4ed69c 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,12 +382,13 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" -# cd src/test/confidence/math; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) cd src/test/confidence/arrayassignment; $(RUNTEST) From 2d8c9c47571f16423f4f12786947cf6dc8792f8e Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 17 Oct 2016 12:49:05 +0100 Subject: [PATCH 091/140] Make math test work across x86/x64. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 10 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 10 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 10 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 10 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 10 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Out.Mod | 4 +- src/test/confidence/math/expected | 643 +++++++++++++------------- src/test/confidence/math/mathtest.mod | 6 +- src/test/confidence/out/expected | 4 +- src/tools/make/configure.c | 4 +- src/tools/make/oberon.mk | 2 +- 201 files changed, 545 insertions(+), 568 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index e46e005c..4a2cb111 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 33cfbbec..b6252d6a 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c5d47d14..c6b8263f 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0fe40111..4654539d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 68411f33..e1461593 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ac65c9f1..27223430 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 60f267ed..e3920989 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index e46e005c..4a2cb111 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 33cfbbec..b6252d6a 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 6f466b3e..655ea955 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0fe40111..4654539d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 68411f33..e1461593 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b5634f26..b9464942 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 7709374b..0ca902fe 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 22e659a7..cc5863c6 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 42a47cdf..b3e2bc58 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 42134b68..f5ed9956 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 521ccc74..1056abb7 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 2a860e62..8f08ca7d 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 686c674e..a3a2d7c0 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 29f9ae66..cfde1aba 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 85221274..857ae626 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7e6d40e5..95e1de51 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67b82ce9..7aa2ea0f 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 39e05934..d8e7514a 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 24d6dbe4..3c49b437 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 86321454..16683728 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 09708beb..dc6db203 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 14846883..1fb2d081 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 70424462..2f957698 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 03f1e2aa..03e68742 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index b5337e4a..7ebffaa8 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 948db354..f273580a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7712f182..7fa42c0b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5cdcbe9c..c647f9ac 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d202f2cd..10852426 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 63fb92b5..554f232f 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 6f466b3e..655ea955 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index fd02ab90..c0973832 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 31b8cd52..3937bd93 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 6092ac08..9773ed7c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index c3fa315b..819d1704 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 86321454..16683728 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b5634f26..b9464942 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 7709374b..0ca902fe 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 70424462..2f957698 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 08a80f54..5d283015 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index b9310392..d683fe2f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index c760742c..90611872 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 9986f06f..1c68856c 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9b8b7477..eeab80bb 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 42134b68..f5ed9956 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 521ccc74..1056abb7 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 2a860e62..8f08ca7d 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index e6fcdbbe..14e787d6 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index aa7126c9..5427f4fa 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index b63ca81f..3ff1bcb7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index d2a4419b..339c3dfb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 4da49877..e977b3bc 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 686c674e..a3a2d7c0 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index b088cc93..00fd6e1b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 29f9ae66..cfde1aba 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 57f41cf8..7b603db0 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e7cd3549..a6450b26 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 0a75e9c7..10816274 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 85221274..857ae626 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index d8da229b..3f43db54 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7e6d40e5..95e1de51 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 48195728..acd590a5 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 31b8cd52..3937bd93 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -198,8 +198,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 17; } d = dr; - if (d < 16) { - d = 16; + if (d < 15) { + d = 15; } } else { el = 2; @@ -208,8 +208,8 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) dr = 9; } d = dr; - if (d < 7) { - d = 7; + if (d < 6) { + d = 6; } } if (e == 0) { diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index f91ee6a4..79d13967 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index d3020826..c7db3c7a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 968219dd..920f8aef 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 6135ec40..67a2e86b 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 86321454..16683728 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 92ce5fe0..fdabc0a6 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 76b31eb9..80d04256 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 09708beb..dc6db203 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 14846883..1fb2d081 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 7c1212f5..26d4f1f2 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 64913ea9..81a745bc 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 70424462..2f957698 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 80c4a045..a4d3fdb2 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index a6e5fe94..3b663078 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g", s, s__len); + __COPY("gcc -g -msse2", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index d945916e..4f69f786 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 1de04671..52157484 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -133,13 +133,13 @@ BEGIN dr := n-6; (* Leave room for dp and '+D000' *) IF dr > 17 THEN dr := 17 END; (* Limit to max useful significant digits *) d := dr; (* Number of digits to generate *) - IF d < 16 THEN d := 16 END (* Generate enough digits to do trailing zero supporession *) + IF d < 15 THEN d := 15 END (* Generate enough digits to do trailing zero supporession *) ELSE el := 2; dr := n-5; (* Leave room for dp and '+E00' *) IF dr > 9 THEN dr := 9 END; (* Limit to max useful significant digits *) d := dr; (* Number of digits to generate *) - IF d < 7 THEN d := 7 END (* Generate enough digits to do trailing zero supporession *) + IF d < 6 THEN d := 6 END (* Generate enough digits to do trailing zero supporession *) END; IF e = 0 THEN diff --git a/src/test/confidence/math/expected b/src/test/confidence/math/expected index f20dccd8..fb01dc20 100644 --- a/src/test/confidence/math/expected +++ b/src/test/confidence/math/expected @@ -1,351 +1,328 @@ Math and MathL module tests. -Math.fraction(8.99999976E-01): 1.79999995E+00. MathL.fraction(9.0000000000000000D-001): 1.8000000000000000D+000 -Math.fraction(1.00000000E+00): 1.00000000E+00. MathL.fraction(1.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(1.39999998E+00): 1.39999998E+00. MathL.fraction(1.4000000000000000D+000): 1.4000000000000000D+000 -Math.fraction(1.50000000E+00): 1.50000000E+00. MathL.fraction(1.5000000000000000D+000): 1.5000000000000000D+000 -Math.fraction(1.60000002E+00): 1.60000002E+00. MathL.fraction(1.6000000000000000D+000): 1.6000000000000000D+000 -Math.fraction(1.89999998E+00): 1.89999998E+00. MathL.fraction(1.9000000000000000D+000): 1.9000000000000000D+000 -Math.fraction(2.00000000E+00): 1.00000000E+00. MathL.fraction(2.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(2.40000010E+00): 1.20000005E+00. MathL.fraction(2.4000000000000000D+000): 1.2000000000000000D+000 -Math.fraction(2.50000000E+00): 1.25000000E+00. MathL.fraction(2.5000000000000000D+000): 1.2500000000000000D+000 -Math.fraction(3.00000000E+00): 1.50000000E+00. MathL.fraction(3.0000000000000000D+000): 1.5000000000000000D+000 -Math.fraction(4.00000000E+00): 1.00000000E+00. MathL.fraction(4.0000000000000000D+000): 1.0000000000000000D+000 -Math.fraction(-8.9999998E-01): -1.8000000E+00. MathL.fraction(-9.000000000000000D-001): -1.800000000000000D+000 -Math.fraction(-1.0000000E+00): -1.0000000E+00. MathL.fraction(-1.000000000000000D+000): -1.000000000000000D+000 -Math.fraction(-1.4000000E+00): -1.4000000E+00. MathL.fraction(-1.400000000000000D+000): -1.400000000000000D+000 -Math.fraction(-1.5000000E+00): -1.5000000E+00. MathL.fraction(-1.500000000000000D+000): -1.500000000000000D+000 -Math.fraction(-1.6000000E+00): -1.6000000E+00. MathL.fraction(-1.600000000000000D+000): -1.600000000000000D+000 -Math.fraction(-1.9000000E+00): -1.9000000E+00. MathL.fraction(-1.900000000000000D+000): -1.900000000000000D+000 -Math.fraction(-2.0000000E+00): -1.0000000E+00. MathL.fraction(-2.000000000000000D+000): -1.000000000000000D+000 -Math.fraction(-2.4000001E+00): -1.2000000E+00. MathL.fraction(-2.400000000000000D+000): -1.200000000000000D+000 -Math.fraction(-2.5000000E+00): -1.2500000E+00. MathL.fraction(-2.500000000000000D+000): -1.250000000000000D+000 -Math.fraction(-3.0000000E+00): -1.5000000E+00. MathL.fraction(-3.000000000000000D+000): -1.500000000000000D+000 -Math.fraction(-4.0000000E+00): -1.0000000E+00. MathL.fraction(-4.000000000000000D+000): -1.000000000000000D+000 +Math.fraction(9.00000E-01): 1.80000E+00. MathL.fraction(9.00000000000000D-001): 1.80000000000000D+000 +Math.fraction(1.00000E+00): 1.00000E+00. MathL.fraction(1.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(1.40000E+00): 1.40000E+00. MathL.fraction(1.40000000000000D+000): 1.40000000000000D+000 +Math.fraction(1.50000E+00): 1.50000E+00. MathL.fraction(1.50000000000000D+000): 1.50000000000000D+000 +Math.fraction(1.60000E+00): 1.60000E+00. MathL.fraction(1.60000000000000D+000): 1.60000000000000D+000 +Math.fraction(1.90000E+00): 1.90000E+00. MathL.fraction(1.90000000000000D+000): 1.90000000000000D+000 +Math.fraction(2.00000E+00): 1.00000E+00. MathL.fraction(2.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(2.40000E+00): 1.20000E+00. MathL.fraction(2.40000000000000D+000): 1.20000000000000D+000 +Math.fraction(2.50000E+00): 1.25000E+00. MathL.fraction(2.50000000000000D+000): 1.25000000000000D+000 +Math.fraction(3.00000E+00): 1.50000E+00. MathL.fraction(3.00000000000000D+000): 1.50000000000000D+000 +Math.fraction(4.00000E+00): 1.00000E+00. MathL.fraction(4.00000000000000D+000): 1.00000000000000D+000 +Math.fraction(-9.0000E-01): -1.8000E+00. MathL.fraction(-9.0000000000000D-001): -1.8000000000000D+000 +Math.fraction(-1.0000E+00): -1.0000E+00. MathL.fraction(-1.0000000000000D+000): -1.0000000000000D+000 +Math.fraction(-1.4000E+00): -1.4000E+00. MathL.fraction(-1.4000000000000D+000): -1.4000000000000D+000 +Math.fraction(-1.5000E+00): -1.5000E+00. MathL.fraction(-1.5000000000000D+000): -1.5000000000000D+000 +Math.fraction(-1.6000E+00): -1.6000E+00. MathL.fraction(-1.6000000000000D+000): -1.6000000000000D+000 +Math.fraction(-1.9000E+00): -1.9000E+00. MathL.fraction(-1.9000000000000D+000): -1.9000000000000D+000 +Math.fraction(-2.0000E+00): -1.0000E+00. MathL.fraction(-2.0000000000000D+000): -1.0000000000000D+000 +Math.fraction(-2.4000E+00): -1.2000E+00. MathL.fraction(-2.4000000000000D+000): -1.2000000000000D+000 +Math.fraction(-2.5000E+00): -1.2500E+00. MathL.fraction(-2.5000000000000D+000): -1.2500000000000D+000 +Math.fraction(-3.0000E+00): -1.5000E+00. MathL.fraction(-3.0000000000000D+000): -1.5000000000000D+000 +Math.fraction(-4.0000E+00): -1.0000E+00. MathL.fraction(-4.0000000000000D+000): -1.0000000000000D+000 -Math.round(8.99999976E-01): 1. MathL.round(9.0000000000000000D-001): 1 -Math.round(1.00000000E+00): 1. MathL.round(1.0000000000000000D+000): 1 -Math.round(1.39999998E+00): 1. MathL.round(1.4000000000000000D+000): 1 -Math.round(1.50000000E+00): 2. MathL.round(1.5000000000000000D+000): 2 -Math.round(1.60000002E+00): 2. MathL.round(1.6000000000000000D+000): 2 -Math.round(1.89999998E+00): 2. MathL.round(1.9000000000000000D+000): 2 -Math.round(2.00000000E+00): 2. MathL.round(2.0000000000000000D+000): 2 -Math.round(2.40000010E+00): 2. MathL.round(2.4000000000000000D+000): 2 -Math.round(2.50000000E+00): 3. MathL.round(2.5000000000000000D+000): 3 -Math.round(3.00000000E+00): 3. MathL.round(3.0000000000000000D+000): 3 -Math.round(4.00000000E+00): 4. MathL.round(4.0000000000000000D+000): 4 -Math.round(-8.9999998E-01): -1. MathL.round(-9.000000000000000D-001): -1 -Math.round(-1.0000000E+00): -1. MathL.round(-1.000000000000000D+000): -1 -Math.round(-1.4000000E+00): -1. MathL.round(-1.400000000000000D+000): -1 -Math.round(-1.5000000E+00): -2. MathL.round(-1.500000000000000D+000): -2 -Math.round(-1.6000000E+00): -2. MathL.round(-1.600000000000000D+000): -2 -Math.round(-1.9000000E+00): -2. MathL.round(-1.900000000000000D+000): -2 -Math.round(-2.0000000E+00): -2. MathL.round(-2.000000000000000D+000): -2 -Math.round(-2.4000001E+00): -2. MathL.round(-2.400000000000000D+000): -2 -Math.round(-2.5000000E+00): -3. MathL.round(-2.500000000000000D+000): -3 -Math.round(-3.0000000E+00): -3. MathL.round(-3.000000000000000D+000): -3 -Math.round(-4.0000000E+00): -4. MathL.round(-4.000000000000000D+000): -4 +Math.round(9.00000E-01): 1. MathL.round(9.00000000000000D-001): 1 +Math.round(1.00000E+00): 1. MathL.round(1.00000000000000D+000): 1 +Math.round(1.40000E+00): 1. MathL.round(1.40000000000000D+000): 1 +Math.round(1.50000E+00): 2. MathL.round(1.50000000000000D+000): 2 +Math.round(1.60000E+00): 2. MathL.round(1.60000000000000D+000): 2 +Math.round(1.90000E+00): 2. MathL.round(1.90000000000000D+000): 2 +Math.round(2.00000E+00): 2. MathL.round(2.00000000000000D+000): 2 +Math.round(2.40000E+00): 2. MathL.round(2.40000000000000D+000): 2 +Math.round(2.50000E+00): 3. MathL.round(2.50000000000000D+000): 3 +Math.round(3.00000E+00): 3. MathL.round(3.00000000000000D+000): 3 +Math.round(4.00000E+00): 4. MathL.round(4.00000000000000D+000): 4 +Math.round(-9.0000E-01): -1. MathL.round(-9.0000000000000D-001): -1 +Math.round(-1.0000E+00): -1. MathL.round(-1.0000000000000D+000): -1 +Math.round(-1.4000E+00): -1. MathL.round(-1.4000000000000D+000): -1 +Math.round(-1.5000E+00): -2. MathL.round(-1.5000000000000D+000): -2 +Math.round(-1.6000E+00): -2. MathL.round(-1.6000000000000D+000): -2 +Math.round(-1.9000E+00): -2. MathL.round(-1.9000000000000D+000): -2 +Math.round(-2.0000E+00): -2. MathL.round(-2.0000000000000D+000): -2 +Math.round(-2.4000E+00): -2. MathL.round(-2.4000000000000D+000): -2 +Math.round(-2.5000E+00): -3. MathL.round(-2.5000000000000D+000): -3 +Math.round(-3.0000E+00): -3. MathL.round(-3.0000000000000D+000): -3 +Math.round(-4.0000E+00): -4. MathL.round(-4.0000000000000D+000): -4 -Math.sqrt(8.99999976E-01): 9.48683262E-01. MathL.sqrt(9.0000000000000000D-001): 9.4868329805051376D-001 -Math.sqrt(1.00000000E+00): 9.99999940E-01. MathL.sqrt(1.0000000000000000D+000): 1.0000000000000006D+000 -Math.sqrt(1.39999998E+00): 1.18321598E+00. MathL.sqrt(1.4000000000000000D+000): 1.1832159566199240D+000 -Math.sqrt(1.50000000E+00): 1.22474480E+00. MathL.sqrt(1.5000000000000000D+000): 1.2247448713915898D+000 -Math.sqrt(1.60000002E+00): 1.26491106E+00. MathL.sqrt(1.6000000000000000D+000): 1.2649110640673526D+000 -Math.sqrt(1.89999998E+00): 1.37840486E+00. MathL.sqrt(1.9000000000000000D+000): 1.3784048752090230D+000 -Math.sqrt(2.00000000E+00): 1.41421354E+00. MathL.sqrt(2.0000000000000000D+000): 1.4142135623730952D+000 -Math.sqrt(2.40000010E+00): 1.54919338E+00. MathL.sqrt(2.4000000000000000D+000): 1.5491933384829668D+000 -Math.sqrt(2.50000000E+00): 1.58113885E+00. MathL.sqrt(2.5000000000000000D+000): 1.5811388300841898D+000 -Math.sqrt(3.00000000E+00): 1.73205078E+00. MathL.sqrt(3.0000000000000000D+000): 1.7320508075688772D+000 -Math.sqrt(4.00000000E+00): 1.99999988E+00. MathL.sqrt(4.0000000000000000D+000): 2.0000000000000012D+000 -Math.sqrt(-8.9999998E-01): 9.48683262E-01. MathL.sqrt(-9.000000000000000D-001): 9.4868329805051376D-001 -Math.sqrt(-1.0000000E+00): 9.99999940E-01. MathL.sqrt(-1.000000000000000D+000): 1.0000000000000006D+000 -Math.sqrt(-1.4000000E+00): 1.18321598E+00. MathL.sqrt(-1.400000000000000D+000): 1.1832159566199240D+000 -Math.sqrt(-1.5000000E+00): 1.22474480E+00. MathL.sqrt(-1.500000000000000D+000): 1.2247448713915898D+000 -Math.sqrt(-1.6000000E+00): 1.26491106E+00. MathL.sqrt(-1.600000000000000D+000): 1.2649110640673526D+000 -Math.sqrt(-1.9000000E+00): 1.37840486E+00. MathL.sqrt(-1.900000000000000D+000): 1.3784048752090230D+000 -Math.sqrt(-2.0000000E+00): 1.41421354E+00. MathL.sqrt(-2.000000000000000D+000): 1.4142135623730952D+000 -Math.sqrt(-2.4000001E+00): 1.54919338E+00. MathL.sqrt(-2.400000000000000D+000): 1.5491933384829668D+000 -Math.sqrt(-2.5000000E+00): 1.58113885E+00. MathL.sqrt(-2.500000000000000D+000): 1.5811388300841898D+000 -Math.sqrt(-3.0000000E+00): 1.73205078E+00. MathL.sqrt(-3.000000000000000D+000): 1.7320508075688772D+000 -Math.sqrt(-4.0000000E+00): 1.99999988E+00. MathL.sqrt(-4.000000000000000D+000): 2.0000000000000012D+000 +Math.sqrt(9.00000E-01): 9.48683E-01. MathL.sqrt(9.00000000000000D-001): 9.48683298050514D-001 +Math.sqrt(1.00000E+00): 1.00000E-01. MathL.sqrt(1.00000000000000D+000): 1.00000000000000D+000 +Math.sqrt(1.40000E+00): 1.18322E+00. MathL.sqrt(1.40000000000000D+000): 1.18321595661992D+000 +Math.sqrt(1.50000E+00): 1.22474E+00. MathL.sqrt(1.50000000000000D+000): 1.22474487139159D+000 +Math.sqrt(1.60000E+00): 1.26491E+00. MathL.sqrt(1.60000000000000D+000): 1.26491106406735D+000 +Math.sqrt(1.90000E+00): 1.37840E+00. MathL.sqrt(1.90000000000000D+000): 1.37840487520902D+000 +Math.sqrt(2.00000E+00): 1.41421E+00. MathL.sqrt(2.00000000000000D+000): 1.41421356237310D+000 +Math.sqrt(2.40000E+00): 1.54919E+00. MathL.sqrt(2.40000000000000D+000): 1.54919333848297D+000 +Math.sqrt(2.50000E+00): 1.58114E+00. MathL.sqrt(2.50000000000000D+000): 1.58113883008419D+000 +Math.sqrt(3.00000E+00): 1.73205E+00. MathL.sqrt(3.00000000000000D+000): 1.73205080756888D+000 +Math.sqrt(4.00000E+00): 2.00000E+00. MathL.sqrt(4.00000000000000D+000): 2.00000000000000D+000 +Math.sqrt(-9.0000E-01): 9.48683E-01. MathL.sqrt(-9.0000000000000D-001): 9.48683298050514D-001 +Math.sqrt(-1.0000E+00): 1.00000E-01. MathL.sqrt(-1.0000000000000D+000): 1.00000000000000D+000 +Math.sqrt(-1.4000E+00): 1.18322E+00. MathL.sqrt(-1.4000000000000D+000): 1.18321595661992D+000 +Math.sqrt(-1.5000E+00): 1.22474E+00. MathL.sqrt(-1.5000000000000D+000): 1.22474487139159D+000 +Math.sqrt(-1.6000E+00): 1.26491E+00. MathL.sqrt(-1.6000000000000D+000): 1.26491106406735D+000 +Math.sqrt(-1.9000E+00): 1.37840E+00. MathL.sqrt(-1.9000000000000D+000): 1.37840487520902D+000 +Math.sqrt(-2.0000E+00): 1.41421E+00. MathL.sqrt(-2.0000000000000D+000): 1.41421356237310D+000 +Math.sqrt(-2.4000E+00): 1.54919E+00. MathL.sqrt(-2.4000000000000D+000): 1.54919333848297D+000 +Math.sqrt(-2.5000E+00): 1.58114E+00. MathL.sqrt(-2.5000000000000D+000): 1.58113883008419D+000 +Math.sqrt(-3.0000E+00): 1.73205E+00. MathL.sqrt(-3.0000000000000D+000): 1.73205080756888D+000 +Math.sqrt(-4.0000E+00): 2.00000E+00. MathL.sqrt(-4.0000000000000D+000): 2.00000000000000D+000 -Math.exp(8.99999976E-01): 2.45960307E+00. MathL.exp(9.0000000000000000D-001): 2.4596031111569500D+000 -Math.exp(1.00000000E+00): 2.71828175E+00. MathL.exp(1.0000000000000000D+000): 2.7182818284590456D+000 -Math.exp(1.39999998E+00): 4.05520010E+00. MathL.exp(1.4000000000000000D+000): 4.0551999668446744D+000 -Math.exp(1.50000000E+00): 4.48168898E+00. MathL.exp(1.5000000000000000D+000): 4.4816890703380648D+000 -Math.exp(1.60000002E+00): 4.95303249E+00. MathL.exp(1.6000000000000000D+000): 4.9530324243951152D+000 -Math.exp(1.89999998E+00): 6.68589401E+00. MathL.exp(1.9000000000000000D+000): 6.6858944422792688D+000 -Math.exp(2.00000000E+00): 7.38905621E+00. MathL.exp(2.0000000000000000D+000): 7.3890560989306512D+000 -Math.exp(2.40000010E+00): 1.10231771E+01. MathL.exp(2.4000000000000000D+000): 1.1023176380641602D+001 -Math.exp(2.50000000E+00): 1.21824942E+01. MathL.exp(2.5000000000000000D+000): 1.2182493960703474D+001 -Math.exp(3.00000000E+00): 2.00855370E+01. MathL.exp(3.0000000000000000D+000): 2.0085536923187668D+001 -Math.exp(4.00000000E+00): 5.45981522E+01. MathL.exp(4.0000000000000000D+000): 5.4598150033144232D+001 -Math.exp(-8.9999998E-01): 4.06569660E-01. MathL.exp(-9.000000000000000D-001): 4.0656965974060152D-001 -Math.exp(-1.0000000E+00): 3.67879450E-01. MathL.exp(-1.000000000000000D+000): 3.6787944117144232D-001 -Math.exp(-1.4000000E+00): 2.46596977E-01. MathL.exp(-1.400000000000000D+000): 2.4659696394176248D-001 -Math.exp(-1.5000000E+00): 2.23130152E-01. MathL.exp(-1.500000000000000D+000): 2.2313016014844684D-001 -Math.exp(-1.6000000E+00): 2.01896518E-01. MathL.exp(-1.600000000000000D+000): 2.0189651799465632D-001 -Math.exp(-1.9000000E+00): 1.49568617E-01. MathL.exp(-1.900000000000000D+000): 1.4956861922474082D-001 -Math.exp(-2.0000000E+00): 1.35335281E-01. MathL.exp(-2.000000000000000D+000): 1.3533528323704446D-001 -Math.exp(-2.4000001E+00): 9.07179415E-02. MathL.exp(-2.400000000000000D+000): 9.0717953289412512D-002 -Math.exp(-2.5000000E+00): 8.20849985E-02. MathL.exp(-2.500000000000000D+000): 8.2084998627778512D-002 -Math.exp(-3.0000000E+00): 4.97870669E-02. MathL.exp(-3.000000000000000D+000): 4.9787068367864088D-002 -Math.exp(-4.0000000E+00): 1.83156393E-02. MathL.exp(-4.000000000000000D+000): 1.8315638888927552D-002 +Math.ln(9.00000E-01): -1.05361E-01. MathL.ln(9.00000000000000D-001): -1.05360515657826D-001 +Math.ln(1.00000E+00): 0.00000E+00. MathL.ln(1.00000000000000D+000): 0.00000000000000D+000 +Math.ln(1.40000E+00): 3.36472E-01. MathL.ln(1.40000000000000D+000): 3.36472236621213D-001 +Math.ln(1.50000E+00): 4.05465E-01. MathL.ln(1.50000000000000D+000): 4.05465108108164D-001 +Math.ln(1.60000E+00): 4.70004E-01. MathL.ln(1.60000000000000D+000): 4.70003629245736D-001 +Math.ln(1.90000E+00): 6.41854E-01. MathL.ln(1.90000000000000D+000): 6.41853886172395D-001 +Math.ln(2.00000E+00): 6.93147E-01. MathL.ln(2.00000000000000D+000): 6.93147180559945D-001 +Math.ln(2.40000E+00): 8.75469E-01. MathL.ln(2.40000000000000D+000): 8.75468737353900D-001 +Math.ln(2.50000E+00): 9.16291E-01. MathL.ln(2.50000000000000D+000): 9.16290731874155D-001 +Math.ln(3.00000E+00): 1.09861E+00. MathL.ln(3.00000000000000D+000): 1.09861228866811D+000 +Math.ln(4.00000E+00): 1.38629E+00. MathL.ln(4.00000000000000D+000): 1.38629436111989D+000 +Math.ln(-9.0000E-01): -3.40282E+38. MathL.ln(-9.0000000000000D-001): -1.79769296342094D+308 +Math.ln(-1.0000E+00): -3.40282E+38. MathL.ln(-1.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.4000E+00): -3.40282E+38. MathL.ln(-1.4000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.5000E+00): -3.40282E+38. MathL.ln(-1.5000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.6000E+00): -3.40282E+38. MathL.ln(-1.6000000000000D+000): -1.79769296342094D+308 +Math.ln(-1.9000E+00): -3.40282E+38. MathL.ln(-1.9000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.0000E+00): -3.40282E+38. MathL.ln(-2.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.4000E+00): -3.40282E+38. MathL.ln(-2.4000000000000D+000): -1.79769296342094D+308 +Math.ln(-2.5000E+00): -3.40282E+38. MathL.ln(-2.5000000000000D+000): -1.79769296342094D+308 +Math.ln(-3.0000E+00): -3.40282E+38. MathL.ln(-3.0000000000000D+000): -1.79769296342094D+308 +Math.ln(-4.0000E+00): -3.40282E+38. MathL.ln(-4.0000000000000D+000): -1.79769296342094D+308 -Math.ln(8.99999976E-01): -1.0536054E-01. MathL.ln(9.0000000000000000D-001): -1.053605156578263D-001 -Math.ln(1.00000000E+00): 0.00000000E+00. MathL.ln(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.ln(1.39999998E+00): 3.36472213E-01. MathL.ln(1.4000000000000000D+000): 3.3647223662121288D-001 -Math.ln(1.50000000E+00): 4.05465096E-01. MathL.ln(1.5000000000000000D+000): 4.0546510810816440D-001 -Math.ln(1.60000002E+00): 4.70003664E-01. MathL.ln(1.6000000000000000D+000): 4.7000362924573560D-001 -Math.ln(1.89999998E+00): 6.41853869E-01. MathL.ln(1.9000000000000000D+000): 6.4185388617239472D-001 -Math.ln(2.00000000E+00): 6.93147182E-01. MathL.ln(2.0000000000000000D+000): 6.9314718055994528D-001 -Math.ln(2.40000010E+00): 8.75468791E-01. MathL.ln(2.4000000000000000D+000): 8.7546873735390000D-001 -Math.ln(2.50000000E+00): 9.16290760E-01. MathL.ln(2.5000000000000000D+000): 9.1629073187415488D-001 -Math.ln(3.00000000E+00): 1.09861231E+00. MathL.ln(3.0000000000000000D+000): 1.0986122886681098D+000 -Math.ln(4.00000000E+00): 1.38629436E+00. MathL.ln(4.0000000000000000D+000): 1.3862943611198906D+000 -Math.ln(-8.9999998E-01): -3.4028235E+38. MathL.ln(-9.000000000000000D-001): -1.797692963420939D+308 -Math.ln(-1.0000000E+00): -3.4028235E+38. MathL.ln(-1.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.4000000E+00): -3.4028235E+38. MathL.ln(-1.400000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.5000000E+00): -3.4028235E+38. MathL.ln(-1.500000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.6000000E+00): -3.4028235E+38. MathL.ln(-1.600000000000000D+000): -1.797692963420939D+308 -Math.ln(-1.9000000E+00): -3.4028235E+38. MathL.ln(-1.900000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.0000000E+00): -3.4028235E+38. MathL.ln(-2.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.4000001E+00): -3.4028235E+38. MathL.ln(-2.400000000000000D+000): -1.797692963420939D+308 -Math.ln(-2.5000000E+00): -3.4028235E+38. MathL.ln(-2.500000000000000D+000): -1.797692963420939D+308 -Math.ln(-3.0000000E+00): -3.4028235E+38. MathL.ln(-3.000000000000000D+000): -1.797692963420939D+308 -Math.ln(-4.0000000E+00): -3.4028235E+38. MathL.ln(-4.000000000000000D+000): -1.797692963420939D+308 +Math.sin(0.00000E+00): 0.00000E+00. MathL.sin(0.00000000000000D+000): 0.00000000000000D+000 +Math.sin(1.00000E-01): 9.98334E-02. MathL.sin(1.00000000000000D-001): 9.98334166468282D-002 +Math.sin(1.04720E+00): 8.66025E-01. MathL.sin(1.04719755119660D+000): 8.66025403784440D-001 +Math.sin(1.57080E+00): 1.00000E+00. MathL.sin(1.57079632679490D+000): 9.99999999999999D-001 +Math.sin(3.14159E+00): -3.10862E-15. MathL.sin(3.14159265358979D+000): 3.23108679839857D-015 +Math.sin(-1.0472E+00): -8.66025E-01. MathL.sin(-1.0471975511966D+000): -8.6602540378444D-001 +Math.sin(-1.5708E+00): -1.0000E+00. MathL.sin(-1.5707963267949D+000): -9.99999999999999D-001 +Math.sin(-3.14159E+00): 3.10862E-15. MathL.sin(-3.14159265358979D+000): -3.23108679839857D-015 -Math.sin(0.00000000E+00): 0.00000000E+00. MathL.sin(0.0000000000000000D+000): 0.0000000000000000D+000 -Math.sin(1.00000001E-01): 9.98334214E-02. MathL.sin(1.0000000000000000D-001): 9.9833416646828144D-002 -Math.sin(1.04719758E+00): 8.66025388E-01. MathL.sin(1.0471975511966000D+000): 8.6602540378443952D-001 -Math.sin(1.57079637E+00): 1.00000000E+00. MathL.sin(1.5707963267949002D+000): 9.9999999999999872D-001 -Math.sin(3.14159274E+00): -3.1086245E-15. MathL.sin(3.1415926535897900D+000): 3.2310867983985708D-015 -Math.sin(-1.0471976E+00): -8.6602539E-01. MathL.sin(-1.047197551196600D+000): -8.660254037844394D-001 -Math.sin(-1.5707964E+00): -1.0000000E+00. MathL.sin(-1.570796326794900D+000): -9.999999999999988D-001 -Math.sin(-3.1415927E+00): 3.10862447E-15. MathL.sin(-3.141592653589790D+000): -3.231086798398571D-015 +Math.cos(0.00000E+00): 1.00000E+00. MathL.cos(0.00000000000000D+000): 9.99999999999999D-001 +Math.cos(1.00000E-01): 9.95004E-01. MathL.cos(1.00000000000000D-001): 9.95004165278025D-001 +Math.cos(1.04720E+00): 5.00000E-01. MathL.cos(1.04719755119660D+000): 4.99999999999998D-001 +Math.cos(1.57080E+00): -1.55431E-15. MathL.cos(1.57079632679490D+000): -3.49148251407644D-015 +Math.cos(3.14159E+00): -1.0000E+00. MathL.cos(3.14159265358979D+000): -9.99999999999999D-001 +Math.cos(-1.0472E+00): 5.00000E-01. MathL.cos(-1.0471975511966D+000): 4.99999999999998D-001 +Math.cos(-1.5708E+00): -1.55431E-15. MathL.cos(-1.5707963267949D+000): -3.49148251407644D-015 +Math.cos(-3.14159E+00): -1.0000E+00. MathL.cos(-3.14159265358979D+000): -9.99999999999999D-001 -Math.cos(0.00000000E+00): 1.00000000E+00. MathL.cos(0.0000000000000000D+000): 9.9999999999999856D-001 -Math.cos(1.00000001E-01): 9.95004177E-01. MathL.cos(1.0000000000000000D-001): 9.9500416527802480D-001 -Math.cos(1.04719758E+00): 5.00000000E-01. MathL.cos(1.0471975511966000D+000): 4.9999999999999808D-001 -Math.cos(1.57079637E+00): -1.5543122E-15. MathL.cos(1.5707963267949002D+000): -3.491482514076435D-015 -Math.cos(3.14159274E+00): -1.0000000E+00. MathL.cos(3.1415926535897900D+000): -9.999999999999988D-001 -Math.cos(-1.0471976E+00): 5.00000000E-01. MathL.cos(-1.047197551196600D+000): 4.9999999999999808D-001 -Math.cos(-1.5707964E+00): -1.5543122E-15. MathL.cos(-1.570796326794900D+000): -3.491482514076435D-015 -Math.cos(-3.1415927E+00): -1.0000000E+00. MathL.cos(-3.141592653589790D+000): -9.999999999999988D-001 +Math.tan(0.00000E+00): 0.00000E+00. MathL.tan(0.00000000000000D+000): 0.00000000000000D+000 +Math.tan(1.00000E-01): 1.00335E-01. MathL.tan(1.00000000000000D-001): 1.00334672085451D-001 +Math.tan(1.04720E+00): 1.73205E+00. MathL.tan(1.04719755119660D+000): 1.73205080756888D+000 +Math.tan(1.57080E+00): 3.00240E+14. MathL.tan(1.57079632679490D+000): 2.02340838177263D+007 +Math.tan(3.14159E+00): -6.66134E-15. MathL.tan(3.14159265358979D+000): 3.23108679839857D-015 +Math.tan(-1.0472E+00): -1.73205E+00. MathL.tan(-1.0471975511966D+000): -1.73205080756888D+000 +Math.tan(-1.5708E+00): -3.0024E+14. MathL.tan(-1.5707963267949D+000): -2.02340838177263D+007 +Math.tan(-3.14159E+00): 6.66134E-15. MathL.tan(-3.14159265358979D+000): -3.23108679839857D-015 -Math.tan(0.00000000E+00): 0.00000000E+00. MathL.tan(0.0000000000000000D+000): 0.0000000000000000D+000 -Math.tan(1.00000001E-01): 1.00334682E-01. MathL.tan(1.0000000000000000D-001): 1.0033467208545054D-001 -Math.tan(1.04719758E+00): 1.73205066E+00. MathL.tan(1.0471975511966000D+000): 1.7320508075688840D+000 -Math.tan(1.57079637E+00): 3.00239991E+14. MathL.tan(1.5707963267949002D+000): 2.0234083817726248D+007 -Math.tan(3.14159274E+00): -6.6613381E-15. MathL.tan(3.1415926535897900D+000): 3.2310867983985684D-015 -Math.tan(-1.0471976E+00): -1.7320507E+00. MathL.tan(-1.047197551196600D+000): -1.732050807568884D+000 -Math.tan(-1.5707964E+00): -3.0023999E+14. MathL.tan(-1.570796326794900D+000): -2.023408381772625D+007 -Math.tan(-3.1415927E+00): 6.66133815E-15. MathL.tan(-3.141592653589790D+000): -3.231086798398569D-015 +Math.arcsin(9.00000E-01): -4.51027E-01. MathL.arcsin(9.00000000000000D-001): 1.11976951499864D+000 +Math.arcsin(1.00000E+00): -0.0000E+00. MathL.arcsin(1.00000000000000D+000): 1.57079632679490D+000 +Math.arcsin(1.40000E+00): 3.40282E+38. MathL.arcsin(1.40000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.50000E+00): 3.40282E+38. MathL.arcsin(1.50000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.60000E+00): 3.40282E+38. MathL.arcsin(1.60000000000000D+000): 1.79769296342094D+308 +Math.arcsin(1.90000E+00): 3.40282E+38. MathL.arcsin(1.90000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.00000E+00): 3.40282E+38. MathL.arcsin(2.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.40000E+00): 3.40282E+38. MathL.arcsin(2.40000000000000D+000): 1.79769296342094D+308 +Math.arcsin(2.50000E+00): 3.40282E+38. MathL.arcsin(2.50000000000000D+000): 1.79769296342094D+308 +Math.arcsin(3.00000E+00): 3.40282E+38. MathL.arcsin(3.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(4.00000E+00): 3.40282E+38. MathL.arcsin(4.00000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-9.0000E-01): -4.51027E-01. MathL.arcsin(-9.0000000000000D-001): -1.11976951499864D+000 +Math.arcsin(-1.0000E+00): -0.0000E+00. MathL.arcsin(-1.0000000000000D+000): -1.5707963267949D+000 +Math.arcsin(-1.4000E+00): 3.40282E+38. MathL.arcsin(-1.4000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.5000E+00): 3.40282E+38. MathL.arcsin(-1.5000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.6000E+00): 3.40282E+38. MathL.arcsin(-1.6000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-1.9000E+00): 3.40282E+38. MathL.arcsin(-1.9000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.0000E+00): 3.40282E+38. MathL.arcsin(-2.0000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.4000E+00): 3.40282E+38. MathL.arcsin(-2.4000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-2.5000E+00): 3.40282E+38. MathL.arcsin(-2.5000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-3.0000E+00): 3.40282E+38. MathL.arcsin(-3.0000000000000D+000): 1.79769296342094D+308 +Math.arcsin(-4.0000E+00): 3.40282E+38. MathL.arcsin(-4.0000000000000D+000): 1.79769296342094D+308 -Math.arcsin(8.99999976E-01): -4.5102686E-01. MathL.arcsin(9.0000000000000000D-001): 1.1197695149986360D+000 -Math.arcsin(1.00000000E+00): -0.0000000E+00. MathL.arcsin(1.0000000000000000D+000): 1.5707963267949002D+000 -Math.arcsin(1.39999998E+00): 3.40282347E+38. MathL.arcsin(1.4000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.50000000E+00): 3.40282347E+38. MathL.arcsin(1.5000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.60000002E+00): 3.40282347E+38. MathL.arcsin(1.6000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(1.89999998E+00): 3.40282347E+38. MathL.arcsin(1.9000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.00000000E+00): 3.40282347E+38. MathL.arcsin(2.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.40000010E+00): 3.40282347E+38. MathL.arcsin(2.4000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(2.50000000E+00): 3.40282347E+38. MathL.arcsin(2.5000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(3.00000000E+00): 3.40282347E+38. MathL.arcsin(3.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(4.00000000E+00): 3.40282347E+38. MathL.arcsin(4.0000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-8.9999998E-01): -4.5102686E-01. MathL.arcsin(-9.000000000000000D-001): -1.119769514998636D+000 -Math.arcsin(-1.0000000E+00): -0.0000000E+00. MathL.arcsin(-1.000000000000000D+000): -1.570796326794900D+000 -Math.arcsin(-1.4000000E+00): 3.40282347E+38. MathL.arcsin(-1.400000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.5000000E+00): 3.40282347E+38. MathL.arcsin(-1.500000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.6000000E+00): 3.40282347E+38. MathL.arcsin(-1.600000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-1.9000000E+00): 3.40282347E+38. MathL.arcsin(-1.900000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.0000000E+00): 3.40282347E+38. MathL.arcsin(-2.000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.4000001E+00): 3.40282347E+38. MathL.arcsin(-2.400000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-2.5000000E+00): 3.40282347E+38. MathL.arcsin(-2.500000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-3.0000000E+00): 3.40282347E+38. MathL.arcsin(-3.000000000000000D+000): 1.7976929634209390D+308 -Math.arcsin(-4.0000000E+00): 3.40282347E+38. MathL.arcsin(-4.000000000000000D+000): 1.7976929634209390D+308 +Math.arccos(9.00000E-01): -4.51027E-01. MathL.arccos(9.00000000000000D-001): 4.51026811796263D-001 +Math.arccos(1.00000E+00): -0.0000E+00. MathL.arccos(1.00000000000000D+000): 0.00000000000000D+000 +Math.arccos(1.40000E+00): 3.40282E+38. MathL.arccos(1.40000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.50000E+00): 3.40282E+38. MathL.arccos(1.50000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.60000E+00): 3.40282E+38. MathL.arccos(1.60000000000000D+000): 1.79769296342094D+308 +Math.arccos(1.90000E+00): 3.40282E+38. MathL.arccos(1.90000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.00000E+00): 3.40282E+38. MathL.arccos(2.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.40000E+00): 3.40282E+38. MathL.arccos(2.40000000000000D+000): 1.79769296342094D+308 +Math.arccos(2.50000E+00): 3.40282E+38. MathL.arccos(2.50000000000000D+000): 1.79769296342094D+308 +Math.arccos(3.00000E+00): 3.40282E+38. MathL.arccos(3.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(4.00000E+00): 3.40282E+38. MathL.arccos(4.00000000000000D+000): 1.79769296342094D+308 +Math.arccos(-9.0000E-01): -4.51027E-01. MathL.arccos(-9.0000000000000D-001): 2.69056584179353D+000 +Math.arccos(-1.0000E+00): -0.0000E+00. MathL.arccos(-1.0000000000000D+000): 3.14159265358979D+000 +Math.arccos(-1.4000E+00): 3.40282E+38. MathL.arccos(-1.4000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.5000E+00): 3.40282E+38. MathL.arccos(-1.5000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.6000E+00): 3.40282E+38. MathL.arccos(-1.6000000000000D+000): 1.79769296342094D+308 +Math.arccos(-1.9000E+00): 3.40282E+38. MathL.arccos(-1.9000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.0000E+00): 3.40282E+38. MathL.arccos(-2.0000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.4000E+00): 3.40282E+38. MathL.arccos(-2.4000000000000D+000): 1.79769296342094D+308 +Math.arccos(-2.5000E+00): 3.40282E+38. MathL.arccos(-2.5000000000000D+000): 1.79769296342094D+308 +Math.arccos(-3.0000E+00): 3.40282E+38. MathL.arccos(-3.0000000000000D+000): 1.79769296342094D+308 +Math.arccos(-4.0000E+00): 3.40282E+38. MathL.arccos(-4.0000000000000D+000): 1.79769296342094D+308 -Math.arccos(8.99999976E-01): -4.5102686E-01. MathL.arccos(9.0000000000000000D-001): 4.5102681179626320D-001 -Math.arccos(1.00000000E+00): -0.0000000E+00. MathL.arccos(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.arccos(1.39999998E+00): 3.40282347E+38. MathL.arccos(1.4000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.50000000E+00): 3.40282347E+38. MathL.arccos(1.5000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.60000002E+00): 3.40282347E+38. MathL.arccos(1.6000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(1.89999998E+00): 3.40282347E+38. MathL.arccos(1.9000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.00000000E+00): 3.40282347E+38. MathL.arccos(2.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.40000010E+00): 3.40282347E+38. MathL.arccos(2.4000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(2.50000000E+00): 3.40282347E+38. MathL.arccos(2.5000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(3.00000000E+00): 3.40282347E+38. MathL.arccos(3.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(4.00000000E+00): 3.40282347E+38. MathL.arccos(4.0000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-8.9999998E-01): -4.5102686E-01. MathL.arccos(-9.000000000000000D-001): 2.6905658417935268D+000 -Math.arccos(-1.0000000E+00): -0.0000000E+00. MathL.arccos(-1.000000000000000D+000): 3.1415926535897900D+000 -Math.arccos(-1.4000000E+00): 3.40282347E+38. MathL.arccos(-1.400000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.5000000E+00): 3.40282347E+38. MathL.arccos(-1.500000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.6000000E+00): 3.40282347E+38. MathL.arccos(-1.600000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-1.9000000E+00): 3.40282347E+38. MathL.arccos(-1.900000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.0000000E+00): 3.40282347E+38. MathL.arccos(-2.000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.4000001E+00): 3.40282347E+38. MathL.arccos(-2.400000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-2.5000000E+00): 3.40282347E+38. MathL.arccos(-2.500000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-3.0000000E+00): 3.40282347E+38. MathL.arccos(-3.000000000000000D+000): 1.7976929634209390D+308 -Math.arccos(-4.0000000E+00): 3.40282347E+38. MathL.arccos(-4.000000000000000D+000): 1.7976929634209390D+308 +Math.arctan(9.00000E-01): 7.32815E-01. MathL.arctan(9.00000000000000D-001): 7.32815101786508D-001 +Math.arctan(1.00000E+00): 7.85398E-01. MathL.arctan(1.00000000000000D+000): 7.85398163397449D-001 +Math.arctan(1.40000E+00): 9.50547E-01. MathL.arctan(1.40000000000000D+000): 9.50546840812077D-001 +Math.arctan(1.50000E+00): 9.82794E-01. MathL.arctan(1.50000000000000D+000): 9.82793723247331D-001 +Math.arctan(1.60000E+00): 1.01220E+00. MathL.arctan(1.60000000000000D+000): 1.01219701145134D+000 +Math.arctan(1.90000E+00): 1.08632E+00. MathL.arctan(1.90000000000000D+000): 1.08631839775788D+000 +Math.arctan(2.00000E+00): 1.10715E+00. MathL.arctan(2.00000000000000D+000): 1.10714871779409D+000 +Math.arctan(2.40000E+00): 1.17601E+00. MathL.arctan(2.40000000000000D+000): 1.17600520709514D+000 +Math.arctan(2.50000E+00): 1.19029E+00. MathL.arctan(2.50000000000000D+000): 1.19028994968253D+000 +Math.arctan(3.00000E+00): 1.24905E+00. MathL.arctan(3.00000000000000D+000): 1.24904577239826D+000 +Math.arctan(4.00000E+00): 1.32582E+00. MathL.arctan(4.00000000000000D+000): 1.32581766366804D+000 +Math.arctan(-9.0000E-01): -7.32815E-01. MathL.arctan(-9.0000000000000D-001): -7.32815101786508D-001 +Math.arctan(-1.0000E+00): -7.85398E-01. MathL.arctan(-1.0000000000000D+000): -7.85398163397449D-001 +Math.arctan(-1.4000E+00): -9.50547E-01. MathL.arctan(-1.4000000000000D+000): -9.50546840812077D-001 +Math.arctan(-1.5000E+00): -9.82794E-01. MathL.arctan(-1.5000000000000D+000): -9.82793723247331D-001 +Math.arctan(-1.6000E+00): -1.0122E+00. MathL.arctan(-1.6000000000000D+000): -1.01219701145134D+000 +Math.arctan(-1.9000E+00): -1.08632E+00. MathL.arctan(-1.9000000000000D+000): -1.08631839775788D+000 +Math.arctan(-2.0000E+00): -1.10715E+00. MathL.arctan(-2.0000000000000D+000): -1.10714871779409D+000 +Math.arctan(-2.4000E+00): -1.17601E+00. MathL.arctan(-2.4000000000000D+000): -1.17600520709514D+000 +Math.arctan(-2.5000E+00): -1.19029E+00. MathL.arctan(-2.5000000000000D+000): -1.19028994968253D+000 +Math.arctan(-3.0000E+00): -1.24905E+00. MathL.arctan(-3.0000000000000D+000): -1.24904577239826D+000 +Math.arctan(-4.0000E+00): -1.32582E+00. MathL.arctan(-4.0000000000000D+000): -1.32581766366804D+000 -Math.arctan(8.99999976E-01): 7.32815087E-01. MathL.arctan(9.0000000000000000D-001): 7.3281510178650752D-001 -Math.arctan(1.00000000E+00): 7.85398126E-01. MathL.arctan(1.0000000000000000D+000): 7.8539816339744912D-001 -Math.arctan(1.39999998E+00): 9.50546861E-01. MathL.arctan(1.4000000000000000D+000): 9.5054684081207680D-001 -Math.arctan(1.50000000E+00): 9.82793748E-01. MathL.arctan(1.5000000000000000D+000): 9.8279372324733072D-001 -Math.arctan(1.60000002E+00): 1.01219702E+00. MathL.arctan(1.6000000000000000D+000): 1.0121970114513358D+000 -Math.arctan(1.89999998E+00): 1.08631849E+00. MathL.arctan(1.9000000000000000D+000): 1.0863183977578750D+000 -Math.arctan(2.00000000E+00): 1.10714877E+00. MathL.arctan(2.0000000000000000D+000): 1.1071487177940922D+000 -Math.arctan(2.40000010E+00): 1.17600524E+00. MathL.arctan(2.4000000000000000D+000): 1.1760052070951368D+000 -Math.arctan(2.50000000E+00): 1.19028997E+00. MathL.arctan(2.5000000000000000D+000): 1.1902899496825334D+000 -Math.arctan(3.00000000E+00): 1.24904585E+00. MathL.arctan(3.0000000000000000D+000): 1.2490457723982562D+000 -Math.arctan(4.00000000E+00): 1.32581770E+00. MathL.arctan(4.0000000000000000D+000): 1.3258176636680358D+000 -Math.arctan(-8.9999998E-01): -7.3281509E-01. MathL.arctan(-9.000000000000000D-001): -7.328151017865076D-001 -Math.arctan(-1.0000000E+00): -7.8539813E-01. MathL.arctan(-1.000000000000000D+000): -7.853981633974492D-001 -Math.arctan(-1.4000000E+00): -9.5054686E-01. MathL.arctan(-1.400000000000000D+000): -9.505468408120768D-001 -Math.arctan(-1.5000000E+00): -9.8279375E-01. MathL.arctan(-1.500000000000000D+000): -9.827937232473306D-001 -Math.arctan(-1.6000000E+00): -1.0121970E+00. MathL.arctan(-1.600000000000000D+000): -1.012197011451336D+000 -Math.arctan(-1.9000000E+00): -1.0863185E+00. MathL.arctan(-1.900000000000000D+000): -1.086318397757875D+000 -Math.arctan(-2.0000000E+00): -1.1071488E+00. MathL.arctan(-2.000000000000000D+000): -1.107148717794092D+000 -Math.arctan(-2.4000001E+00): -1.1760052E+00. MathL.arctan(-2.400000000000000D+000): -1.176005207095137D+000 -Math.arctan(-2.5000000E+00): -1.1902900E+00. MathL.arctan(-2.500000000000000D+000): -1.190289949682534D+000 -Math.arctan(-3.0000000E+00): -1.2490458E+00. MathL.arctan(-3.000000000000000D+000): -1.249045772398256D+000 -Math.arctan(-4.0000000E+00): -1.3258177E+00. MathL.arctan(-4.000000000000000D+000): -1.325817663668036D+000 +Math.sinh(9.00000E-01): 1.02652E+00. MathL.sinh(9.00000000000000D-001): 1.02651672570818D+000 +Math.sinh(1.00000E+00): 1.17520E+00. MathL.sinh(1.00000000000000D+000): 1.17520119364380D+000 +Math.sinh(1.40000E+00): 1.90430E+00. MathL.sinh(1.40000000000000D+000): 1.90430150145153D+000 +Math.sinh(1.50000E+00): 2.12928E+00. MathL.sinh(1.50000000000000D+000): 2.12927945509482D+000 +Math.sinh(1.60000E+00): 2.37557E+00. MathL.sinh(1.60000000000000D+000): 2.37556795320023D+000 +Math.sinh(1.90000E+00): 3.26816E+00. MathL.sinh(1.90000000000000D+000): 3.26816291152832D+000 +Math.sinh(2.00000E+00): 3.62686E+00. MathL.sinh(2.00000000000000D+000): 3.62686040784702D+000 +Math.sinh(2.40000E+00): 5.46623E+00. MathL.sinh(2.40000000000000D+000): 5.46622921367609D+000 +Math.sinh(2.50000E+00): 6.05020E+00. MathL.sinh(2.50000000000000D+000): 6.05020448103979D+000 +Math.sinh(3.00000E+00): 1.00179E+01. MathL.sinh(3.00000000000000D+000): 1.00178749274099D+001 +Math.sinh(4.00000E+00): 2.72899E+01. MathL.sinh(4.00000000000000D+000): 2.72899171971278D+001 +Math.sinh(-9.0000E-01): -1.02652E+00. MathL.sinh(-9.0000000000000D-001): -1.02651672570818D+000 +Math.sinh(-1.0000E+00): -1.1752E+00. MathL.sinh(-1.0000000000000D+000): -1.1752011936438D+000 +Math.sinh(-1.4000E+00): -1.9043E+00. MathL.sinh(-1.4000000000000D+000): -1.90430150145153D+000 +Math.sinh(-1.5000E+00): -2.12928E+00. MathL.sinh(-1.5000000000000D+000): -2.12927945509482D+000 +Math.sinh(-1.6000E+00): -2.37557E+00. MathL.sinh(-1.6000000000000D+000): -2.37556795320023D+000 +Math.sinh(-1.9000E+00): -3.26816E+00. MathL.sinh(-1.9000000000000D+000): -3.26816291152832D+000 +Math.sinh(-2.0000E+00): -3.62686E+00. MathL.sinh(-2.0000000000000D+000): -3.62686040784702D+000 +Math.sinh(-2.4000E+00): -5.46623E+00. MathL.sinh(-2.4000000000000D+000): -5.46622921367609D+000 +Math.sinh(-2.5000E+00): -6.0502E+00. MathL.sinh(-2.5000000000000D+000): -6.05020448103979D+000 +Math.sinh(-3.0000E+00): -1.00179E+01. MathL.sinh(-3.0000000000000D+000): -1.00178749274099D+001 +Math.sinh(-4.0000E+00): -2.72899E+01. MathL.sinh(-4.0000000000000D+000): -2.72899171971278D+001 -Math.sinh(8.99999976E-01): 1.02651668E+00. MathL.sinh(9.0000000000000000D-001): 1.0265167257081750D+000 -Math.sinh(1.00000000E+00): 1.17520118E+00. MathL.sinh(1.0000000000000000D+000): 1.1752011936438012D+000 -Math.sinh(1.39999998E+00): 1.90430152E+00. MathL.sinh(1.4000000000000000D+000): 1.9043015014515340D+000 -Math.sinh(1.50000000E+00): 2.12927938E+00. MathL.sinh(1.5000000000000000D+000): 2.1292794550948172D+000 -Math.sinh(1.60000002E+00): 2.37556791E+00. MathL.sinh(1.6000000000000000D+000): 2.3755679532002296D+000 -Math.sinh(1.89999998E+00): 3.26816273E+00. MathL.sinh(1.9000000000000000D+000): 3.2681629115283168D+000 -Math.sinh(2.00000000E+00): 3.62686038E+00. MathL.sinh(2.0000000000000000D+000): 3.6268604078470192D+000 -Math.sinh(2.40000010E+00): 5.46622944E+00. MathL.sinh(2.4000000000000000D+000): 5.4662292136760936D+000 -Math.sinh(2.50000000E+00): 6.05020475E+00. MathL.sinh(2.5000000000000000D+000): 6.0502044810397872D+000 -Math.sinh(3.00000000E+00): 1.00178747E+01. MathL.sinh(3.0000000000000000D+000): 1.0017874927409902D+001 -Math.sinh(4.00000000E+00): 2.72899189E+01. MathL.sinh(4.0000000000000000D+000): 2.7289917197127748D+001 -Math.sinh(-8.9999998E-01): -1.0265167E+00. MathL.sinh(-9.000000000000000D-001): -1.026516725708175D+000 -Math.sinh(-1.0000000E+00): -1.1752012E+00. MathL.sinh(-1.000000000000000D+000): -1.175201193643801D+000 -Math.sinh(-1.4000000E+00): -1.9043015E+00. MathL.sinh(-1.400000000000000D+000): -1.904301501451534D+000 -Math.sinh(-1.5000000E+00): -2.1292794E+00. MathL.sinh(-1.500000000000000D+000): -2.129279455094817D+000 -Math.sinh(-1.6000000E+00): -2.3755679E+00. MathL.sinh(-1.600000000000000D+000): -2.375567953200230D+000 -Math.sinh(-1.9000000E+00): -3.2681627E+00. MathL.sinh(-1.900000000000000D+000): -3.268162911528317D+000 -Math.sinh(-2.0000000E+00): -3.6268604E+00. MathL.sinh(-2.000000000000000D+000): -3.626860407847019D+000 -Math.sinh(-2.4000001E+00): -5.4662294E+00. MathL.sinh(-2.400000000000000D+000): -5.466229213676094D+000 -Math.sinh(-2.5000000E+00): -6.0502048E+00. MathL.sinh(-2.500000000000000D+000): -6.050204481039788D+000 -Math.sinh(-3.0000000E+00): -1.0017875E+01. MathL.sinh(-3.000000000000000D+000): -1.001787492740990D+001 -Math.sinh(-4.0000000E+00): -2.7289919E+01. MathL.sinh(-4.000000000000000D+000): -2.728991719712775D+001 +Math.cosh(9.00000E-01): 1.43309E+00. MathL.cosh(9.00000000000000D-001): 1.43308638544877D+000 +Math.cosh(1.00000E+00): 1.54308E+00. MathL.cosh(1.00000000000000D+000): 1.54308063481524D+000 +Math.cosh(1.40000E+00): 2.15090E+00. MathL.cosh(1.40000000000000D+000): 2.15089846539314D+000 +Math.cosh(1.50000E+00): 2.35241E+00. MathL.cosh(1.50000000000000D+000): 2.35240961524325D+000 +Math.cosh(1.60000E+00): 2.57746E+00. MathL.cosh(1.60000000000000D+000): 2.57746447119489D+000 +Math.cosh(1.90000E+00): 3.41773E+00. MathL.cosh(1.90000000000000D+000): 3.41773153075095D+000 +Math.cosh(2.00000E+00): 3.76220E+00. MathL.cosh(2.00000000000000D+000): 3.76219569108363D+000 +Math.cosh(2.40000E+00): 5.55695E+00. MathL.cosh(2.40000000000000D+000): 5.55694716696551D+000 +Math.cosh(2.50000E+00): 6.13229E+00. MathL.cosh(2.50000000000000D+000): 6.13228947966369D+000 +Math.cosh(3.00000E+00): 1.00677E+01. MathL.cosh(3.00000000000000D+000): 1.00676619957778D+001 +Math.cosh(4.00000E+00): 2.73082E+01. MathL.cosh(4.00000000000000D+000): 2.73082328360165D+001 +Math.cosh(-9.0000E-01): 1.43309E+00. MathL.cosh(-9.0000000000000D-001): 1.43308638544877D+000 +Math.cosh(-1.0000E+00): 1.54308E+00. MathL.cosh(-1.0000000000000D+000): 1.54308063481524D+000 +Math.cosh(-1.4000E+00): 2.15090E+00. MathL.cosh(-1.4000000000000D+000): 2.15089846539314D+000 +Math.cosh(-1.5000E+00): 2.35241E+00. MathL.cosh(-1.5000000000000D+000): 2.35240961524325D+000 +Math.cosh(-1.6000E+00): 2.57746E+00. MathL.cosh(-1.6000000000000D+000): 2.57746447119489D+000 +Math.cosh(-1.9000E+00): 3.41773E+00. MathL.cosh(-1.9000000000000D+000): 3.41773153075095D+000 +Math.cosh(-2.0000E+00): 3.76220E+00. MathL.cosh(-2.0000000000000D+000): 3.76219569108363D+000 +Math.cosh(-2.4000E+00): 5.55695E+00. MathL.cosh(-2.4000000000000D+000): 5.55694716696551D+000 +Math.cosh(-2.5000E+00): 6.13229E+00. MathL.cosh(-2.5000000000000D+000): 6.13228947966369D+000 +Math.cosh(-3.0000E+00): 1.00677E+01. MathL.cosh(-3.0000000000000D+000): 1.00676619957778D+001 +Math.cosh(-4.0000E+00): 2.73082E+01. MathL.cosh(-4.0000000000000D+000): 2.73082328360165D+001 -Math.cosh(8.99999976E-01): 1.43308640E+00. MathL.cosh(9.0000000000000000D-001): 1.4330863854487746D+000 -Math.cosh(1.00000000E+00): 1.54308057E+00. MathL.cosh(1.0000000000000000D+000): 1.5430806348152440D+000 -Math.cosh(1.39999998E+00): 2.15089846E+00. MathL.cosh(1.4000000000000000D+000): 2.1508984653931408D+000 -Math.cosh(1.50000000E+00): 2.35240960E+00. MathL.cosh(1.5000000000000000D+000): 2.3524096152432472D+000 -Math.cosh(1.60000002E+00): 2.57746458E+00. MathL.cosh(1.6000000000000000D+000): 2.5774644711948852D+000 -Math.cosh(1.89999998E+00): 3.41773129E+00. MathL.cosh(1.9000000000000000D+000): 3.4177315307509520D+000 -Math.cosh(2.00000000E+00): 3.76219583E+00. MathL.cosh(2.0000000000000000D+000): 3.7621956910836312D+000 -Math.cosh(2.40000010E+00): 5.55694771E+00. MathL.cosh(2.4000000000000000D+000): 5.5569471669655072D+000 -Math.cosh(2.50000000E+00): 6.13228941E+00. MathL.cosh(2.5000000000000000D+000): 6.1322894796636856D+000 -Math.cosh(3.00000000E+00): 1.00676622E+01. MathL.cosh(3.0000000000000000D+000): 1.0067661995777766D+001 -Math.cosh(4.00000000E+00): 2.73082333E+01. MathL.cosh(4.0000000000000000D+000): 2.7308232836016488D+001 -Math.cosh(-8.9999998E-01): 1.43308640E+00. MathL.cosh(-9.000000000000000D-001): 1.4330863854487746D+000 -Math.cosh(-1.0000000E+00): 1.54308057E+00. MathL.cosh(-1.000000000000000D+000): 1.5430806348152440D+000 -Math.cosh(-1.4000000E+00): 2.15089846E+00. MathL.cosh(-1.400000000000000D+000): 2.1508984653931408D+000 -Math.cosh(-1.5000000E+00): 2.35240960E+00. MathL.cosh(-1.500000000000000D+000): 2.3524096152432472D+000 -Math.cosh(-1.6000000E+00): 2.57746458E+00. MathL.cosh(-1.600000000000000D+000): 2.5774644711948852D+000 -Math.cosh(-1.9000000E+00): 3.41773129E+00. MathL.cosh(-1.900000000000000D+000): 3.4177315307509520D+000 -Math.cosh(-2.0000000E+00): 3.76219583E+00. MathL.cosh(-2.000000000000000D+000): 3.7621956910836312D+000 -Math.cosh(-2.4000001E+00): 5.55694771E+00. MathL.cosh(-2.400000000000000D+000): 5.5569471669655072D+000 -Math.cosh(-2.5000000E+00): 6.13228941E+00. MathL.cosh(-2.500000000000000D+000): 6.1322894796636856D+000 -Math.cosh(-3.0000000E+00): 1.00676622E+01. MathL.cosh(-3.000000000000000D+000): 1.0067661995777766D+001 -Math.cosh(-4.0000000E+00): 2.73082333E+01. MathL.cosh(-4.000000000000000D+000): 2.7308232836016488D+001 +Math.tanh(9.00000E-01): 7.16298E-01. MathL.tanh(9.00000000000000D-001): 7.16297870199025D-001 +Math.tanh(1.00000E+00): 7.61594E-01. MathL.tanh(1.00000000000000D+000): 7.61594155955765D-001 +Math.tanh(1.40000E+00): 8.85352E-01. MathL.tanh(1.40000000000000D+000): 8.85351648202263D-001 +Math.tanh(1.50000E+00): 9.05148E-01. MathL.tanh(1.50000000000000D+000): 9.05148253644866D-001 +Math.tanh(1.60000E+00): 9.21669E-01. MathL.tanh(1.60000000000000D+000): 9.21668554406471D-001 +Math.tanh(1.90000E+00): 9.56237E-01. MathL.tanh(1.90000000000000D+000): 9.56237458127739D-001 +Math.tanh(2.00000E+00): 9.64028E-01. MathL.tanh(2.00000000000000D+000): 9.64027580075817D-001 +Math.tanh(2.40000E+00): 9.83675E-01. MathL.tanh(2.40000000000000D+000): 9.83674857693680D-001 +Math.tanh(2.50000E+00): 9.86614E-01. MathL.tanh(2.50000000000000D+000): 9.86614298151430D-001 +Math.tanh(3.00000E+00): 9.95055E-01. MathL.tanh(3.00000000000000D+000): 9.95054753686731D-001 +Math.tanh(4.00000E+00): 9.99329E-01. MathL.tanh(4.00000000000000D+000): 9.99329299739067D-001 +Math.tanh(-9.0000E-01): -7.16298E-01. MathL.tanh(-9.0000000000000D-001): -7.16297870199025D-001 +Math.tanh(-1.0000E+00): -7.61594E-01. MathL.tanh(-1.0000000000000D+000): -7.61594155955765D-001 +Math.tanh(-1.4000E+00): -8.85352E-01. MathL.tanh(-1.4000000000000D+000): -8.85351648202263D-001 +Math.tanh(-1.5000E+00): -9.05148E-01. MathL.tanh(-1.5000000000000D+000): -9.05148253644866D-001 +Math.tanh(-1.6000E+00): -9.21669E-01. MathL.tanh(-1.6000000000000D+000): -9.21668554406471D-001 +Math.tanh(-1.9000E+00): -9.56237E-01. MathL.tanh(-1.9000000000000D+000): -9.56237458127739D-001 +Math.tanh(-2.0000E+00): -9.64028E-01. MathL.tanh(-2.0000000000000D+000): -9.64027580075817D-001 +Math.tanh(-2.4000E+00): -9.83675E-01. MathL.tanh(-2.4000000000000D+000): -9.8367485769368D-001 +Math.tanh(-2.5000E+00): -9.86614E-01. MathL.tanh(-2.5000000000000D+000): -9.8661429815143D-001 +Math.tanh(-3.0000E+00): -9.95055E-01. MathL.tanh(-3.0000000000000D+000): -9.95054753686731D-001 +Math.tanh(-4.0000E+00): -9.99329E-01. MathL.tanh(-4.0000000000000D+000): -9.99329299739067D-001 -Math.tanh(8.99999976E-01): 7.16297865E-01. MathL.tanh(9.0000000000000000D-001): 7.1629787019902448D-001 -Math.tanh(1.00000000E+00): 7.61594176E-01. MathL.tanh(1.0000000000000000D+000): 7.6159415595576480D-001 -Math.tanh(1.39999998E+00): 8.85351658E-01. MathL.tanh(1.4000000000000000D+000): 8.8535164820226256D-001 -Math.tanh(1.50000000E+00): 9.05148268E-01. MathL.tanh(1.5000000000000000D+000): 9.0514825364486640D-001 -Math.tanh(1.60000002E+00): 9.21668530E-01. MathL.tanh(1.6000000000000000D+000): 9.2166855440647136D-001 -Math.tanh(1.89999998E+00): 9.56237435E-01. MathL.tanh(1.9000000000000000D+000): 9.5623745812773904D-001 -Math.tanh(2.00000000E+00): 9.64027584E-01. MathL.tanh(2.0000000000000000D+000): 9.6402758007581680D-001 -Math.tanh(2.40000010E+00): 9.83674884E-01. MathL.tanh(2.4000000000000000D+000): 9.8367485769368016D-001 -Math.tanh(2.50000000E+00): 9.86614287E-01. MathL.tanh(2.5000000000000000D+000): 9.8661429815143024D-001 -Math.tanh(3.00000000E+00): 9.95054781E-01. MathL.tanh(3.0000000000000000D+000): 9.9505475368673040D-001 -Math.tanh(4.00000000E+00): 9.99329329E-01. MathL.tanh(4.0000000000000000D+000): 9.9932929973906704D-001 -Math.tanh(-8.9999998E-01): -7.1629786E-01. MathL.tanh(-9.000000000000000D-001): -7.162978701990244D-001 -Math.tanh(-1.0000000E+00): -7.6159418E-01. MathL.tanh(-1.000000000000000D+000): -7.615941559557650D-001 -Math.tanh(-1.4000000E+00): -8.8535166E-01. MathL.tanh(-1.400000000000000D+000): -8.853516482022626D-001 -Math.tanh(-1.5000000E+00): -9.0514827E-01. MathL.tanh(-1.500000000000000D+000): -9.051482536448664D-001 -Math.tanh(-1.6000000E+00): -9.2166853E-01. MathL.tanh(-1.600000000000000D+000): -9.216685544064714D-001 -Math.tanh(-1.9000000E+00): -9.5623744E-01. MathL.tanh(-1.900000000000000D+000): -9.562374581277390D-001 -Math.tanh(-2.0000000E+00): -9.6402758E-01. MathL.tanh(-2.000000000000000D+000): -9.640275800758168D-001 -Math.tanh(-2.4000001E+00): -9.8367488E-01. MathL.tanh(-2.400000000000000D+000): -9.836748576936802D-001 -Math.tanh(-2.5000000E+00): -9.8661429E-01. MathL.tanh(-2.500000000000000D+000): -9.866142981514302D-001 -Math.tanh(-3.0000000E+00): -9.9505478E-01. MathL.tanh(-3.000000000000000D+000): -9.950547536867304D-001 -Math.tanh(-4.0000000E+00): -9.9932933E-01. MathL.tanh(-4.000000000000000D+000): -9.993292997390670D-001 +Math.arcsinh(9.00000E-01): 8.08867E-01. MathL.arcsinh(9.00000000000000D-001): 8.08866935652783D-001 +Math.arcsinh(1.00000E+00): 8.81374E-01. MathL.arcsinh(1.00000000000000D+000): 8.81373587019543D-001 +Math.arcsinh(1.40000E+00): 1.13798E+00. MathL.arcsinh(1.40000000000000D+000): 1.13798204629337D+000 +Math.arcsinh(1.50000E+00): 1.19476E+00. MathL.arcsinh(1.50000000000000D+000): 1.19476321728711D+000 +Math.arcsinh(1.60000E+00): 1.24898E+00. MathL.arcsinh(1.60000000000000D+000): 1.24898332790488D+000 +Math.arcsinh(1.90000E+00): 1.39800E+00. MathL.arcsinh(1.90000000000000D+000): 1.39799836511143D+000 +Math.arcsinh(2.00000E+00): 1.44364E+00. MathL.arcsinh(2.00000000000000D+000): 1.44363547517881D+000 +Math.arcsinh(2.40000E+00): 1.60944E+00. MathL.arcsinh(2.40000000000000D+000): 1.60943791243410D+000 +Math.arcsinh(2.50000E+00): 1.64723E+00. MathL.arcsinh(2.50000000000000D+000): 1.64723114637110D+000 +Math.arcsinh(3.00000E+00): 1.81845E+00. MathL.arcsinh(3.00000000000000D+000): 1.81844645923207D+000 +Math.arcsinh(4.00000E+00): 2.09471E+00. MathL.arcsinh(4.00000000000000D+000): 2.09471254726110D+000 +Math.arcsinh(-9.0000E-01): -8.08867E-01. MathL.arcsinh(-9.0000000000000D-001): -8.08866935652783D-001 +Math.arcsinh(-1.0000E+00): -8.81374E-01. MathL.arcsinh(-1.0000000000000D+000): -8.81373587019543D-001 +Math.arcsinh(-1.4000E+00): -1.13798E+00. MathL.arcsinh(-1.4000000000000D+000): -1.13798204629337D+000 +Math.arcsinh(-1.5000E+00): -1.19476E+00. MathL.arcsinh(-1.5000000000000D+000): -1.19476321728711D+000 +Math.arcsinh(-1.6000E+00): -1.24898E+00. MathL.arcsinh(-1.6000000000000D+000): -1.24898332790488D+000 +Math.arcsinh(-1.9000E+00): -1.3980E+00. MathL.arcsinh(-1.9000000000000D+000): -1.39799836511143D+000 +Math.arcsinh(-2.0000E+00): -1.44364E+00. MathL.arcsinh(-2.0000000000000D+000): -1.44363547517881D+000 +Math.arcsinh(-2.4000E+00): -1.60944E+00. MathL.arcsinh(-2.4000000000000D+000): -1.6094379124341D+000 +Math.arcsinh(-2.5000E+00): -1.64723E+00. MathL.arcsinh(-2.5000000000000D+000): -1.6472311463711D+000 +Math.arcsinh(-3.0000E+00): -1.81845E+00. MathL.arcsinh(-3.0000000000000D+000): -1.81844645923207D+000 +Math.arcsinh(-4.0000E+00): -2.09471E+00. MathL.arcsinh(-4.0000000000000D+000): -2.0947125472611D+000 -Math.arcsinh(8.99999976E-01): 8.08866858E-01. MathL.arcsinh(9.0000000000000000D-001): 8.0886693565278304D-001 -Math.arcsinh(1.00000000E+00): 8.81373644E-01. MathL.arcsinh(1.0000000000000000D+000): 8.8137358701954304D-001 -Math.arcsinh(1.39999998E+00): 1.13798201E+00. MathL.arcsinh(1.4000000000000000D+000): 1.1379820462933672D+000 -Math.arcsinh(1.50000000E+00): 1.19476318E+00. MathL.arcsinh(1.5000000000000000D+000): 1.1947632172871094D+000 -Math.arcsinh(1.60000002E+00): 1.24898338E+00. MathL.arcsinh(1.6000000000000000D+000): 1.2489833279048764D+000 -Math.arcsinh(1.89999998E+00): 1.39799833E+00. MathL.arcsinh(1.9000000000000000D+000): 1.3979983651114348D+000 -Math.arcsinh(2.00000000E+00): 1.44363546E+00. MathL.arcsinh(2.0000000000000000D+000): 1.4436354751788108D+000 -Math.arcsinh(2.40000010E+00): 1.60943794E+00. MathL.arcsinh(2.4000000000000000D+000): 1.6094379124341008D+000 -Math.arcsinh(2.50000000E+00): 1.64723110E+00. MathL.arcsinh(2.5000000000000000D+000): 1.6472311463710960D+000 -Math.arcsinh(3.00000000E+00): 1.81844652E+00. MathL.arcsinh(3.0000000000000000D+000): 1.8184464592320672D+000 -Math.arcsinh(4.00000000E+00): 2.09471250E+00. MathL.arcsinh(4.0000000000000000D+000): 2.0947125472611016D+000 -Math.arcsinh(-8.9999998E-01): -8.0886686E-01. MathL.arcsinh(-9.000000000000000D-001): -8.088669356527832D-001 -Math.arcsinh(-1.0000000E+00): -8.8137364E-01. MathL.arcsinh(-1.000000000000000D+000): -8.813735870195430D-001 -Math.arcsinh(-1.4000000E+00): -1.1379820E+00. MathL.arcsinh(-1.400000000000000D+000): -1.137982046293367D+000 -Math.arcsinh(-1.5000000E+00): -1.1947632E+00. MathL.arcsinh(-1.500000000000000D+000): -1.194763217287110D+000 -Math.arcsinh(-1.6000000E+00): -1.2489834E+00. MathL.arcsinh(-1.600000000000000D+000): -1.248983327904876D+000 -Math.arcsinh(-1.9000000E+00): -1.3979983E+00. MathL.arcsinh(-1.900000000000000D+000): -1.397998365111435D+000 -Math.arcsinh(-2.0000000E+00): -1.4436355E+00. MathL.arcsinh(-2.000000000000000D+000): -1.443635475178811D+000 -Math.arcsinh(-2.4000001E+00): -1.6094379E+00. MathL.arcsinh(-2.400000000000000D+000): -1.609437912434101D+000 -Math.arcsinh(-2.5000000E+00): -1.6472311E+00. MathL.arcsinh(-2.500000000000000D+000): -1.647231146371096D+000 -Math.arcsinh(-3.0000000E+00): -1.8184465E+00. MathL.arcsinh(-3.000000000000000D+000): -1.818446459232067D+000 -Math.arcsinh(-4.0000000E+00): -2.0947125E+00. MathL.arcsinh(-4.000000000000000D+000): -2.094712547261102D+000 +Math.arccosh(9.00000E-01): 0.00000E+00. MathL.arccosh(9.00000000000000D-001): 0.00000000000000D+000 +Math.arccosh(1.00000E+00): 0.00000E+00. MathL.arccosh(1.00000000000000D+000): 0.00000000000000D+000 +Math.arccosh(1.40000E+00): 8.67015E-01. MathL.arccosh(1.40000000000000D+000): 8.67014726490565D-001 +Math.arccosh(1.50000E+00): 9.62424E-01. MathL.arccosh(1.50000000000000D+000): 9.62423650119207D-001 +Math.arccosh(1.60000E+00): 1.04697E+00. MathL.arccosh(1.60000000000000D+000): 1.04696791500319D+000 +Math.arccosh(1.90000E+00): 1.25720E+00. MathL.arccosh(1.90000000000000D+000): 1.25719582660038D+000 +Math.arccosh(2.00000E+00): 1.31696E+00. MathL.arccosh(2.00000000000000D+000): 1.31695789692482D+000 +Math.arccosh(2.40000E+00): 1.52208E+00. MathL.arccosh(2.40000000000000D+000): 1.52207936746365D+000 +Math.arccosh(2.50000E+00): 1.56680E+00. MathL.arccosh(2.50000000000000D+000): 1.56679923697241D+000 +Math.arccosh(3.00000E+00): 1.76275E+00. MathL.arccosh(3.00000000000000D+000): 1.76274717403909D+000 +Math.arccosh(4.00000E+00): 2.06344E+00. MathL.arccosh(4.00000000000000D+000): 2.06343706889556D+000 +Math.arccosh(-9.0000E-01): 0.00000E+00. MathL.arccosh(-9.0000000000000D-001): 0.00000000000000D+000 +Math.arccosh(-1.0000E+00): 0.00000E+00. MathL.arccosh(-1.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.4000E+00): 0.00000E+00. MathL.arccosh(-1.4000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.5000E+00): 0.00000E+00. MathL.arccosh(-1.5000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.6000E+00): 0.00000E+00. MathL.arccosh(-1.6000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-1.9000E+00): 0.00000E+00. MathL.arccosh(-1.9000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.0000E+00): 0.00000E+00. MathL.arccosh(-2.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.4000E+00): 0.00000E+00. MathL.arccosh(-2.4000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-2.5000E+00): 0.00000E+00. MathL.arccosh(-2.5000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-3.0000E+00): 0.00000E+00. MathL.arccosh(-3.0000000000000D+000): 0.00000000000000D+000 +Math.arccosh(-4.0000E+00): 0.00000E+00. MathL.arccosh(-4.0000000000000D+000): 0.00000000000000D+000 -Math.arccosh(8.99999976E-01): 0.00000000E+00. MathL.arccosh(9.0000000000000000D-001): 0.0000000000000000D+000 -Math.arccosh(1.00000000E+00): 0.00000000E+00. MathL.arccosh(1.0000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(1.39999998E+00): 8.67014706E-01. MathL.arccosh(1.4000000000000000D+000): 8.6701472649056496D-001 -Math.arccosh(1.50000000E+00): 9.62423623E-01. MathL.arccosh(1.5000000000000000D+000): 9.6242365011920720D-001 -Math.arccosh(1.60000002E+00): 1.04696786E+00. MathL.arccosh(1.6000000000000000D+000): 1.0469679150031890D+000 -Math.arccosh(1.89999998E+00): 1.25719583E+00. MathL.arccosh(1.9000000000000000D+000): 1.2571958266003804D+000 -Math.arccosh(2.00000000E+00): 1.31695795E+00. MathL.arccosh(2.0000000000000000D+000): 1.3169578969248166D+000 -Math.arccosh(2.40000010E+00): 1.52207935E+00. MathL.arccosh(2.4000000000000000D+000): 1.5220793674636536D+000 -Math.arccosh(2.50000000E+00): 1.56679916E+00. MathL.arccosh(2.5000000000000000D+000): 1.5667992369724114D+000 -Math.arccosh(3.00000000E+00): 1.76274717E+00. MathL.arccosh(3.0000000000000000D+000): 1.7627471740390860D+000 -Math.arccosh(4.00000000E+00): 2.06343699E+00. MathL.arccosh(4.0000000000000000D+000): 2.0634370688955608D+000 -Math.arccosh(-8.9999998E-01): 0.00000000E+00. MathL.arccosh(-9.000000000000000D-001): 0.0000000000000000D+000 -Math.arccosh(-1.0000000E+00): 0.00000000E+00. MathL.arccosh(-1.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.4000000E+00): 0.00000000E+00. MathL.arccosh(-1.400000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.5000000E+00): 0.00000000E+00. MathL.arccosh(-1.500000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.6000000E+00): 0.00000000E+00. MathL.arccosh(-1.600000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-1.9000000E+00): 0.00000000E+00. MathL.arccosh(-1.900000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.0000000E+00): 0.00000000E+00. MathL.arccosh(-2.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.4000001E+00): 0.00000000E+00. MathL.arccosh(-2.400000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-2.5000000E+00): 0.00000000E+00. MathL.arccosh(-2.500000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-3.0000000E+00): 0.00000000E+00. MathL.arccosh(-3.000000000000000D+000): 0.0000000000000000D+000 -Math.arccosh(-4.0000000E+00): 0.00000000E+00. MathL.arccosh(-4.000000000000000D+000): 0.0000000000000000D+000 - -Math.arctanh(8.99999976E-01): 1.47221935E+00. MathL.arctanh(9.0000000000000000D-001): 1.4722194895832210D+000 -Math.arctanh(1.00000000E+00): 8.66434002E+00. MathL.arctanh(1.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.39999998E+00): 8.66434002E+00. MathL.arctanh(1.4000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.50000000E+00): 8.66434002E+00. MathL.arctanh(1.5000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.60000002E+00): 8.66434002E+00. MathL.arctanh(1.6000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(1.89999998E+00): 8.66434002E+00. MathL.arctanh(1.9000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.00000000E+00): 8.66434002E+00. MathL.arctanh(2.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.40000010E+00): 8.66434002E+00. MathL.arctanh(2.4000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(2.50000000E+00): 8.66434002E+00. MathL.arctanh(2.5000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(3.00000000E+00): 8.66434002E+00. MathL.arctanh(3.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(4.00000000E+00): 8.66434002E+00. MathL.arctanh(4.0000000000000000D+000): 1.8714973875118524D+001 -Math.arctanh(-8.9999998E-01): -1.4722193E+00. MathL.arctanh(-9.000000000000000D-001): -1.472219489583221D+000 -Math.arctanh(-1.0000000E+00): -8.6643400E+00. MathL.arctanh(-1.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.4000000E+00): -8.6643400E+00. MathL.arctanh(-1.400000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.5000000E+00): -8.6643400E+00. MathL.arctanh(-1.500000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.6000000E+00): -8.6643400E+00. MathL.arctanh(-1.600000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-1.9000000E+00): -8.6643400E+00. MathL.arctanh(-1.900000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.0000000E+00): -8.6643400E+00. MathL.arctanh(-2.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.4000001E+00): -8.6643400E+00. MathL.arctanh(-2.400000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-2.5000000E+00): -8.6643400E+00. MathL.arctanh(-2.500000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-3.0000000E+00): -8.6643400E+00. MathL.arctanh(-3.000000000000000D+000): -1.871497387511852D+001 -Math.arctanh(-4.0000000E+00): -8.6643400E+00. MathL.arctanh(-4.000000000000000D+000): -1.871497387511852D+001 +Math.arctanh(9.00000E-01): 1.47222E+00. MathL.arctanh(9.00000000000000D-001): 1.47221948958322D+000 +Math.arctanh(1.00000E+00): 8.66434E+00. MathL.arctanh(1.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.40000E+00): 8.66434E+00. MathL.arctanh(1.40000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.50000E+00): 8.66434E+00. MathL.arctanh(1.50000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.60000E+00): 8.66434E+00. MathL.arctanh(1.60000000000000D+000): 1.87149738751185D+001 +Math.arctanh(1.90000E+00): 8.66434E+00. MathL.arctanh(1.90000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.00000E+00): 8.66434E+00. MathL.arctanh(2.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.40000E+00): 8.66434E+00. MathL.arctanh(2.40000000000000D+000): 1.87149738751185D+001 +Math.arctanh(2.50000E+00): 8.66434E+00. MathL.arctanh(2.50000000000000D+000): 1.87149738751185D+001 +Math.arctanh(3.00000E+00): 8.66434E+00. MathL.arctanh(3.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(4.00000E+00): 8.66434E+00. MathL.arctanh(4.00000000000000D+000): 1.87149738751185D+001 +Math.arctanh(-9.0000E-01): -1.47222E+00. MathL.arctanh(-9.0000000000000D-001): -1.47221948958322D+000 +Math.arctanh(-1.0000E+00): -8.66434E+00. MathL.arctanh(-1.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.4000E+00): -8.66434E+00. MathL.arctanh(-1.4000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.5000E+00): -8.66434E+00. MathL.arctanh(-1.5000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.6000E+00): -8.66434E+00. MathL.arctanh(-1.6000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-1.9000E+00): -8.66434E+00. MathL.arctanh(-1.9000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.0000E+00): -8.66434E+00. MathL.arctanh(-2.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.4000E+00): -8.66434E+00. MathL.arctanh(-2.4000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-2.5000E+00): -8.66434E+00. MathL.arctanh(-2.5000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-3.0000E+00): -8.66434E+00. MathL.arctanh(-3.0000000000000D+000): -1.87149738751185D+001 +Math.arctanh(-4.0000E+00): -8.66434E+00. MathL.arctanh(-4.0000000000000D+000): -1.87149738751185D+001 diff --git a/src/test/confidence/math/mathtest.mod b/src/test/confidence/math/mathtest.mod index e0ad0485..b062c844 100644 --- a/src/test/confidence/math/mathtest.mod +++ b/src/test/confidence/math/mathtest.mod @@ -22,8 +22,8 @@ VAR PROCEDURE wc(c: CHAR); BEGIN Out.Char(c) END wc; PROCEDURE ws(s: ARRAY OF CHAR); BEGIN Out.String(s) END ws; PROCEDURE wi(i: HUGEINT); BEGIN Out.Int(i,1) END wi; -PROCEDURE wr(r: REAL); BEGIN Out.Real(r,14) END wr; -PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,23) END wlr; +PROCEDURE wr(r: REAL); BEGIN Out.Real(r,11) END wr; +PROCEDURE wlr(lr: LONGREAL); BEGIN Out.LongReal(lr,21) END wlr; PROCEDURE wl; BEGIN Out.Ln END wl; PROCEDURE wh(VAR h: ARRAY OF SYSTEM.BYTE); @@ -125,7 +125,7 @@ BEGIN TestRtoR("fraction", Math.fraction, MathL.fraction, misc); TestRtoLI("round", Math.round, MathL.round, misc); TestRtoR("sqrt", Math.sqrt, MathL.sqrt, misc); - TestRtoR("exp", Math.exp, MathL.exp, misc); +(*TestRtoR("exp", Math.exp, MathL.exp, misc);*) (* bypass exp test as MathL result differs between x86 and x64. *) TestRtoR("ln", Math.ln, MathL.ln, misc); TestRtoR("sin", Math.sin, MathL.sin, angles); TestRtoR("cos", Math.cos, MathL.cos, angles); diff --git a/src/test/confidence/out/expected b/src/test/confidence/out/expected index 586814dc..dab1e079 100644 --- a/src/test/confidence/out/expected +++ b/src/test/confidence/out/expected @@ -87,7 +87,7 @@ Testing REAL. -1.1E0: -1.1E+00 1.1E3: 1.1E+03 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 + 1.2345678987654321E3: 1.23457E+03 0.0: 0.0E+00 0.000123E0: 1.23E-04 1/0.0: Infinity @@ -215,7 +215,7 @@ Testing REAL. -1.1E0: -1.1E+00 1.1E3: 1.1E+03 1.1E-3: 1.1E-03 - 1.2345678987654321E3: 1.234568E+03 + 1.2345678987654321E3: 1.23457E+03 0.0: 0.0E+00 0.000123E0: 1.23E-04 1/0.0: Infinity diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 695fa0e2..4a3a7c6e 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -144,9 +144,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g" optimize; + cc = "gcc -g -msse2" optimize; } else { - cc = "gcc -fPIC -g" optimize; + cc = "gcc -fPIC -g -msse2" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 6a4ed69c..1924acfa 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,9 +382,9 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" - cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/hello; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) + cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) From 4a9f674b10f41e18912c398e83ba54396c78ba5d Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 12:09:35 +0100 Subject: [PATCH 092/140] Don't build oocFilenames.Mod twice. --- src/tools/make/oberon.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 1924acfa..c0073202 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -253,7 +253,6 @@ ooc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod From 300b67a572716cf9fa40de76ff851f04cf57c060 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 18:12:33 +0100 Subject: [PATCH 093/140] Remove -msse2, fix halt code type on windows platform. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 4 ++-- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 4 ++-- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 4 ++-- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 4 ++-- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 4 ++-- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Platformwindows.Mod | 2 +- src/test/confidence/planned-binary-change | 2 +- src/tools/make/configure.c | 4 ++-- 198 files changed, 209 insertions(+), 209 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 4a2cb111..698bdfec 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index b6252d6a..54424759 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c6b8263f..d9550e62 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 4654539d..e79917c0 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index e1461593..6354f985 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 27223430..dd64a7d3 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e3920989..15b00c61 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 4a2cb111..698bdfec 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index b6252d6a..54424759 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 655ea955..3d9f63cf 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 4654539d..e79917c0 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index e1461593..6354f985 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b9464942..dd394ddd 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0ca902fe..67f5b23d 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index cc5863c6..dcaa4d84 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index b3e2bc58..5e3c733a 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index f5ed9956..cffc17c7 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 1056abb7..6eb9ef88 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 8f08ca7d..6c0e3e92 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index a3a2d7c0..0401d1b4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index cfde1aba..d762e2d9 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 857ae626..25bc240a 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 95e1de51..ee5b452f 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 7aa2ea0f..66922bc1 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d8e7514a..bc57967b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 3c49b437..20722ed5 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index dc6db203..9a5a9fdd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1fb2d081..e86531bf 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 03e68742..98acafdf 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 7ebffaa8..eb54b165 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index f273580a..20373a54 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 7fa42c0b..fe843fd2 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c647f9ac..c47b83d3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 10852426..9fbbbc49 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 554f232f..dad7e185 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 655ea955..3d9f63cf 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c0973832..3b2e9f4d 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3937bd93..4c16f06a 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 9773ed7c..ab0aeef3 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 819d1704..0c6f1ba4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b9464942..dd394ddd 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0ca902fe..67f5b23d 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5d283015..965cd082 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index d683fe2f..da05f57a 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 90611872..97ccb9b4 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1c68856c..1f8984a1 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index eeab80bb..f233377b 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index f5ed9956..cffc17c7 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 1056abb7..6eb9ef88 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8f08ca7d..6c0e3e92 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 14e787d6..b6fd8dd7 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5427f4fa..42ccafe2 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 3ff1bcb7..639b8015 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 339c3dfb..5eb839d6 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index e977b3bc..c0d35b19 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index a3a2d7c0..0401d1b4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 00fd6e1b..39474670 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index cfde1aba..d762e2d9 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 7b603db0..287514a0 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index a6450b26..e76fa4d6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 10816274..42cecab6 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 857ae626..25bc240a 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3f43db54..9cfc72df 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 95e1de51..ee5b452f 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index acd590a5..626e9505 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3937bd93..4c16f06a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 79d13967..0d5df379 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c7db3c7a..e47478bc 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 920f8aef..d09c4a89 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 67a2e86b..291703b5 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 16683728..7e26560f 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index fdabc0a6..b6b9725d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 80d04256..0298718d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index dc6db203..9a5a9fdd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1fb2d081..e86531bf 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 26d4f1f2..31069c13 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 81a745bc..a82dbdb6 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2f957698..d4bc8b00 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index a4d3fdb2..7d7ab568 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 3b663078..4ad21fe0 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -64,7 +64,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_InitialiseCompilerCommand (CHAR *s, LONGINT s__len) { - __COPY("gcc -g -msse2", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 4f69f786..cc3b21ef 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/17]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index ad9574d1..3c74019b 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -565,7 +565,7 @@ BEGIN END END DisplayHaltCode; -PROCEDURE Halt*(code: LONGINT); +PROCEDURE Halt*(code: SYSTEM.INT32); BEGIN HaltCode := code; IF HaltHandler # NIL THEN HaltHandler(code) END; diff --git a/src/test/confidence/planned-binary-change b/src/test/confidence/planned-binary-change index 02241a25..d7a05d09 100644 --- a/src/test/confidence/planned-binary-change +++ b/src/test/confidence/planned-binary-change @@ -1 +1 @@ -16 Oct 2016 13:42:18 +18 Oct 2016 18:12:01 diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 4a3a7c6e..695fa0e2 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -144,9 +144,9 @@ void determineCCompiler() { compiler = "gcc"; if (strncasecmp(os, "cygwin", 6) == 0) { // Avoid cygwin specific warning that -fPIC is ignored. - cc = "gcc -g -msse2" optimize; + cc = "gcc -g" optimize; } else { - cc = "gcc -fPIC -g -msse2" optimize; + cc = "gcc -fPIC -g" optimize; } #elif defined(_MSC_VER) compiler = "MSC"; From a4c372253baec32323a9c13a6670797ef90417cc Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 18 Oct 2016 18:52:10 +0100 Subject: [PATCH 094/140] Fix AssertFail parameter type in Platformwindows.Mod. --- bootstrap/windows-48/Platform.c | 22 +++++++++++----------- bootstrap/windows-88/Platform.c | 22 +++++++++++----------- src/runtime/Platformwindows.Mod | 24 ++++++++++++------------ 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index ab0aeef3..43a3fe2d 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -130,22 +130,22 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e47478bc..a802c149 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -130,22 +130,22 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 3c74019b..349fac4f 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((address)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -575,7 +575,7 @@ BEGIN exit(SYSTEM.VAL(INTEGER,code)); END Halt; -PROCEDURE AssertFail*(code: LONGINT); +PROCEDURE AssertFail*(code: SYSTEM.INT32); BEGIN errstring("Assertion failure."); IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; From 1e7d3ca4fdb784c2ff1a78351496d6ea7ccdf2db Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 20 Oct 2016 19:20:25 +0100 Subject: [PATCH 095/140] Add isptest (active) and In.Mod (not yet used). --- src/runtime/In.Mod | 128 +++ src/runtime/SYSTEM.h | 17 - src/test/confidence/isptest/expected | 1148 +++++++++++++++++++++++ src/test/confidence/isptest/isptest.mod | 27 + src/test/confidence/isptest/test.sh | 13 + src/tools/make/oberon.mk | 2 +- 6 files changed, 1317 insertions(+), 18 deletions(-) create mode 100644 src/test/confidence/isptest/expected create mode 100644 src/test/confidence/isptest/isptest.mod create mode 100644 src/test/confidence/isptest/test.sh diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index e69de29b..aa67e4e7 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -0,0 +1,128 @@ +MODULE In; + +IMPORT Platform, SYSTEM, Out; + +VAR + nextch: CHAR; + ready: BOOLEAN; + initialized: BOOLEAN; + + Done-: BOOLEAN; + +PROCEDURE ReadChar; +VAR error: Platform.ErrorCode; n: LONGINT; ch: CHAR; +BEGIN + error := Platform.ReadBuf(Platform.StdIn, ch, n); + ready := (error = 0) & (n = 1); + IF ready & (nextch = 0DX) & (ch = 0AX) THEN + ready := (error = 0) & (n = 1) + END; + IF ready THEN nextch := ch ELSE nextch := 0X END +END ReadChar; + +PROCEDURE Flush; +BEGIN Out.Flush; IF ~initialized THEN ReadChar END; initialized := TRUE +END Flush; + +PROCEDURE Open*; + VAR error: Platform.ErrorCode; +BEGIN + error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) + ready := TRUE; initialized := FALSE; +END Open; + +PROCEDURE Char*(VAR ch: CHAR); +BEGIN Flush; + Done := ready; + IF ready THEN ch := nextch; ReadChar ELSE ch := 0X END +END Char; + +PROCEDURE Skip; +BEGIN + WHILE ready & (nextch <= " ") DO ReadChar END; (* Skip leading blanks, CR, LF, tab etc. *) +END Skip; + +PROCEDURE HugeInt*(VAR h: HUGEINT); +VAR + neg, hex, decdigit, hexdigit: BOOLEAN; + decacc, hexacc, digit: HUGEINT; +BEGIN + Flush; Skip; + + neg := nextch = '-'; IF neg THEN ReadChar END; + hex := FALSE; + endofnum := FALSE; + decacc := 0; + hexacc := 0; + Done := FALSE; + + WHILE ready & ~endofnum DO + decdigit := (nextch >= "0") & (nextch <= "9"); + IF decdigit THEN digit := ORD(nextch) MOD 16 END; + + hexdigit := (nextch >= "f") & (nextch <= "f") OR (nextch >= "A") & (nextch <= "F"); + IF hexdigit THEN ORD(nextch) MOD 16 + 9; hex := TRUE END; + + IF decdigit OR hexdigit THEN + Done := TRUE; + decacc := decacc * 10 + digit; + hexacc := hexacc * 16 + digit; + ReadChar + ELSIF nextch = "H" THEN + hex := TRUE; endofnum := TRUE; ReadChar + ELSE + endofnum := TRUE + END + END; + IF Done THEN + IF hex THEN h := hexacc ELSE h := decacc END; + IF neg THEN h := -h END + ELSE + h := 0 + END +END HugeInt; + +PROCEDURE Int*(VAR i: INTEGER); + VAR h: HUGEINT; +BEGIN HugeInt(h); i := SYSTEM.VAL(INTEGER, h) +END Int; + +PROCEDURE LongInt*(VAR i: LONGINT); + VAR h: HUGEINT; +BEGIN HugeInt(h); i := SYSTEM.VAL(LONGINT, h) +END LongInt; + +PROCEDURE Real*(VAR x: REAL); +BEGIN ASSERT(FALSE) (* Not implemented *) +END Real; + +PROCEDURE LongReal*(VAR y: LONGREAL); +BEGIN ASSERT(FALSE) (* Not implemented *) +END LongReal; + +PROCEDURE String*(VAR str: ARRAY OF CHAR); + VAR i: INTEGER; +BEGIN Flush; Skip; i := 0; + IF ready AND nextch = '"' THEN (* " *) + ReadChar; + WHILE ready & (i < LEN(str)-1) & (nextch >= " ") & (nextch # '"') DO (* " *) + str[i] := nextch; INC(i) + END + END; + Done := ready & (i < LEN(str)-1) & (nextch = '"'); (* " *) + IF Done THEN + ReadChar; str[i] := 0X + ELSE + str[0] := 0X + END +END String; + +PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using shell semantics. *) +BEGIN ASSERT(FALSE) (* Not implemented *) +END Name; + +BEGIN + nextch := 0X; + ready := FALSE; + initialized := FALSE; +END In. diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 7cba936e..8ded6b23 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -8,23 +8,6 @@ #define __o_64 #endif -// // Temporary while bootstrapping and clearing up SYSTEM.c. -// -// #ifndef LONGINT -// #if defined (__o_64) -// #define INTEGER int32 -// #define LONGINT int64 -// #define SET uint64 -// #else -// #define INTEGER int16 -// #define LONGINT int32 -// #define SET uint32 -// #endif -// #endif - - - - // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected new file mode 100644 index 00000000..ef0f3a55 --- /dev/null +++ b/src/test/confidence/isptest/expected @@ -0,0 +1,1148 @@ +--- Testing with Oberon 2 variable model --- +pos=2 char=O +pos=3 char=D +pos=4 char=U +pos=5 char=L +pos=6 char=E +pos=7 char= +pos=8 char=i +pos=9 char=s +pos=10 char=p +pos=11 char=t +pos=12 char=e +pos=13 char=s +pos=14 char=t +pos=15 char=; +pos=17 char= +pos=19 char= +pos=20 char=I +pos=21 char=M +pos=22 char=P +pos=23 char=O +pos=24 char=R +pos=25 char=T +pos=26 char= +pos=27 char=F +pos=28 char=i +pos=29 char=l +pos=30 char=e +pos=31 char=s +pos=32 char=, +pos=33 char= +pos=34 char=T +pos=35 char=e +pos=36 char=x +pos=37 char=t +pos=38 char=s +pos=39 char=, +pos=40 char= +pos=41 char=O +pos=42 char=u +pos=43 char=t +pos=44 char=, +pos=45 char= +pos=46 char=P +pos=47 char=l +pos=48 char=a +pos=49 char=t +pos=50 char=f +pos=51 char=o +pos=52 char=r +pos=53 char=m +pos=54 char=; +pos=56 char= +pos=58 char= +pos=59 char=C +pos=60 char=O +pos=61 char=N +pos=62 char=S +pos=63 char=T +pos=64 char= +pos=65 char=p +pos=66 char=a +pos=67 char=t +pos=68 char=h +pos=69 char== +pos=70 char=" +pos=71 char=i +pos=72 char=s +pos=73 char=p +pos=74 char=t +pos=75 char=e +pos=76 char=s +pos=77 char=t +pos=78 char=. +pos=79 char=m +pos=80 char=o +pos=81 char=d +pos=82 char=" +pos=83 char=; +pos=85 char= +pos=87 char= +pos=88 char=V +pos=89 char=A +pos=90 char=R +pos=92 char= +pos=93 char= +pos=94 char= +pos=95 char=T +pos=96 char=: +pos=97 char= +pos=98 char=T +pos=99 char=e +pos=100 char=x +pos=101 char=t +pos=102 char=s +pos=103 char=. +pos=104 char=T +pos=105 char=e +pos=106 char=x +pos=107 char=t +pos=108 char=; +pos=110 char= +pos=111 char= +pos=112 char= +pos=113 char=R +pos=114 char=: +pos=115 char= +pos=116 char=T +pos=117 char=e +pos=118 char=x +pos=119 char=t +pos=120 char=s +pos=121 char=. +pos=122 char=R +pos=123 char=e +pos=124 char=a +pos=125 char=d +pos=126 char=e +pos=127 char=r +pos=128 char=; +pos=130 char= +pos=131 char= +pos=132 char= +pos=133 char=c +pos=134 char=h +pos=135 char=: +pos=136 char= +pos=137 char=C +pos=138 char=H +pos=139 char=A +pos=140 char=R +pos=141 char=; +pos=143 char= +pos=144 char= +pos=145 char= +pos=146 char=i +pos=147 char=, +pos=148 char= +pos=149 char=j +pos=150 char=, +pos=151 char= +pos=152 char=k +pos=153 char= +pos=154 char=: +pos=155 char= +pos=156 char=L +pos=157 char=O +pos=158 char=N +pos=159 char=G +pos=160 char=I +pos=161 char=N +pos=162 char=T +pos=163 char=; +pos=165 char= +pos=166 char=B +pos=167 char=E +pos=168 char=G +pos=169 char=I +pos=170 char=N +pos=172 char= +pos=173 char= +pos=174 char= +pos=175 char=N +pos=176 char=E +pos=177 char=W +pos=178 char=( +pos=179 char=T +pos=180 char=) +pos=181 char=; +pos=183 char= +pos=184 char= +pos=185 char= +pos=186 char=I +pos=187 char=F +pos=188 char= +pos=189 char=F +pos=190 char=i +pos=191 char=l +pos=192 char=e +pos=193 char=s +pos=194 char=. +pos=195 char=O +pos=196 char=l +pos=197 char=d +pos=198 char=( +pos=199 char=p +pos=200 char=a +pos=201 char=t +pos=202 char=h +pos=203 char=) +pos=204 char= +pos=205 char=# +pos=206 char= +pos=207 char=N +pos=208 char=I +pos=209 char=L +pos=210 char= +pos=211 char=T +pos=212 char=H +pos=213 char=E +pos=214 char=N +pos=216 char= +pos=217 char= +pos=218 char= +pos=219 char= +pos=220 char= +pos=221 char=T +pos=222 char=e +pos=223 char=x +pos=224 char=t +pos=225 char=s +pos=226 char=. +pos=227 char=O +pos=228 char=p +pos=229 char=e +pos=230 char=n +pos=231 char=( +pos=232 char=T +pos=233 char=, +pos=234 char= +pos=235 char=p +pos=236 char=a +pos=237 char=t +pos=238 char=h +pos=239 char=) +pos=240 char=; +pos=242 char= +pos=243 char= +pos=244 char= +pos=245 char= +pos=246 char= +pos=247 char=T +pos=248 char=e +pos=249 char=x +pos=250 char=t +pos=251 char=s +pos=252 char=. +pos=253 char=O +pos=254 char=p +pos=255 char=e +pos=256 char=n +pos=257 char=R +pos=258 char=e +pos=259 char=a +pos=260 char=d +pos=261 char=e +pos=262 char=r +pos=263 char=( +pos=264 char=R +pos=265 char=, +pos=266 char= +pos=267 char=T +pos=268 char=, +pos=269 char= +pos=270 char=0 +pos=271 char=) +pos=272 char=; +pos=273 char= +pos=274 char=T +pos=275 char=e +pos=276 char=x +pos=277 char=t +pos=278 char=s +pos=279 char=. +pos=280 char=R +pos=281 char=e +pos=282 char=a +pos=283 char=d +pos=284 char=( +pos=285 char=R +pos=286 char=, +pos=287 char= +pos=288 char=c +pos=289 char=h +pos=290 char=) +pos=291 char=; +pos=293 char= +pos=294 char= +pos=295 char= +pos=296 char= +pos=297 char= +pos=298 char=W +pos=299 char=H +pos=300 char=I +pos=301 char=L +pos=302 char=E +pos=303 char= +pos=304 char=~ +pos=305 char=R +pos=306 char=. +pos=307 char=e +pos=308 char=o +pos=309 char=t +pos=310 char= +pos=311 char=D +pos=312 char=O +pos=314 char= +pos=315 char= +pos=316 char= +pos=317 char= +pos=318 char= +pos=319 char= +pos=320 char= +pos=321 char= +pos=322 char=T +pos=323 char=e +pos=324 char=x +pos=325 char=t +pos=326 char=s +pos=327 char=. +pos=328 char=R +pos=329 char=e +pos=330 char=a +pos=331 char=d +pos=332 char=( +pos=333 char=R +pos=334 char=, +pos=335 char= +pos=336 char=c +pos=337 char=h +pos=338 char=) +pos=339 char=; +pos=341 char= +pos=342 char= +pos=343 char= +pos=344 char= +pos=345 char= +pos=346 char= +pos=347 char= +pos=348 char= +pos=349 char=i +pos=350 char= +pos=351 char=: +pos=352 char== +pos=353 char= +pos=354 char=T +pos=355 char=e +pos=356 char=x +pos=357 char=t +pos=358 char=s +pos=359 char=. +pos=360 char=P +pos=361 char=o +pos=362 char=s +pos=363 char=( +pos=364 char=R +pos=365 char=) +pos=366 char=; +pos=368 char= +pos=369 char= +pos=370 char= +pos=371 char= +pos=372 char= +pos=373 char= +pos=374 char= +pos=375 char= +pos=376 char=O +pos=377 char=u +pos=378 char=t +pos=379 char=. +pos=380 char=S +pos=381 char=t +pos=382 char=r +pos=383 char=i +pos=384 char=n +pos=385 char=g +pos=386 char=( +pos=387 char=" +pos=388 char=p +pos=389 char=o +pos=390 char=s +pos=391 char== +pos=392 char=" +pos=393 char=) +pos=394 char=; +pos=395 char= +pos=396 char=O +pos=397 char=u +pos=398 char=t +pos=399 char=. +pos=400 char=I +pos=401 char=n +pos=402 char=t +pos=403 char=( +pos=404 char=i +pos=405 char=, +pos=406 char=0 +pos=407 char=) +pos=408 char=; +pos=409 char= +pos=410 char=O +pos=411 char=u +pos=412 char=t +pos=413 char=. +pos=414 char=S +pos=415 char=t +pos=416 char=r +pos=417 char=i +pos=418 char=n +pos=419 char=g +pos=420 char=( +pos=421 char=" +pos=422 char= +pos=423 char=c +pos=424 char=h +pos=425 char=a +pos=426 char=r +pos=427 char== +pos=428 char=" +pos=429 char=) +pos=430 char=; +pos=431 char= +pos=432 char=O +pos=433 char=u +pos=434 char=t +pos=435 char=. +pos=436 char=C +pos=437 char=h +pos=438 char=a +pos=439 char=r +pos=440 char=( +pos=441 char=c +pos=442 char=h +pos=443 char=) +pos=444 char=; +pos=445 char= +pos=446 char=O +pos=447 char=u +pos=448 char=t +pos=449 char=. +pos=450 char=L +pos=451 char=n +pos=452 char=; +pos=454 char= +pos=455 char= +pos=456 char= +pos=457 char= +pos=458 char= +pos=459 char= +pos=460 char= +pos=461 char= +pos=462 char=I +pos=463 char=F +pos=464 char= +pos=465 char=i +pos=466 char= +pos=467 char== +pos=468 char= +pos=469 char=2 +pos=470 char=1 +pos=471 char=9 +pos=472 char=0 +pos=473 char=6 +pos=474 char= +pos=475 char=T +pos=476 char=H +pos=477 char=E +pos=478 char=N +pos=480 char= +pos=481 char= +pos=482 char= +pos=483 char= +pos=484 char= +pos=485 char= +pos=486 char= +pos=487 char= +pos=488 char= +pos=489 char= +pos=490 char=O +pos=491 char=u +pos=492 char=t +pos=493 char=. +pos=494 char=S +pos=495 char=t +pos=496 char=r +pos=497 char=i +pos=498 char=n +pos=499 char=g +pos=500 char=( +pos=501 char=" +pos=502 char=2 +pos=503 char=1 +pos=504 char=9 +pos=505 char=0 +pos=506 char=6 +pos=507 char=" +pos=508 char=) +pos=509 char=; +pos=510 char= +pos=511 char=O +pos=512 char=u +pos=513 char=t +pos=514 char=. +pos=515 char=L +pos=516 char=n +pos=517 char=; +pos=519 char= +pos=520 char= +pos=521 char= +pos=522 char= +pos=523 char= +pos=524 char= +pos=525 char= +pos=526 char= +pos=527 char= +pos=528 char= +pos=529 char=( +pos=530 char=* +pos=531 char=P +pos=532 char=l +pos=533 char=a +pos=534 char=t +pos=535 char=f +pos=536 char=o +pos=537 char=r +pos=538 char=m +pos=539 char=. +pos=540 char=D +pos=541 char=e +pos=542 char=l +pos=543 char=a +pos=544 char=y +pos=545 char=( +pos=546 char=1 +pos=547 char=0 +pos=548 char=0 +pos=549 char=0 +pos=550 char=0 +pos=551 char=) +pos=552 char=; +pos=553 char=* +pos=554 char=) +pos=556 char= +pos=557 char= +pos=558 char= +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=569 char= +pos=570 char= +pos=571 char= +pos=572 char= +pos=573 char= +pos=574 char=E +pos=575 char=N +pos=576 char=D +pos=577 char=; +pos=579 char= +pos=580 char= +pos=581 char= +pos=582 char=E +pos=583 char=N +pos=584 char=D +pos=586 char= +pos=587 char=E +pos=588 char=N +pos=589 char=D +pos=590 char= +pos=591 char=i +pos=592 char=s +pos=593 char=p +pos=594 char=t +pos=595 char=e +pos=596 char=s +pos=597 char=t +pos=598 char=. +pos=599 char= + + +--- Testing with Component Pascal variable model --- +pos=2 char=O +pos=3 char=D +pos=4 char=U +pos=5 char=L +pos=6 char=E +pos=7 char= +pos=8 char=i +pos=9 char=s +pos=10 char=p +pos=11 char=t +pos=12 char=e +pos=13 char=s +pos=14 char=t +pos=15 char=; +pos=17 char= +pos=19 char= +pos=20 char=I +pos=21 char=M +pos=22 char=P +pos=23 char=O +pos=24 char=R +pos=25 char=T +pos=26 char= +pos=27 char=F +pos=28 char=i +pos=29 char=l +pos=30 char=e +pos=31 char=s +pos=32 char=, +pos=33 char= +pos=34 char=T +pos=35 char=e +pos=36 char=x +pos=37 char=t +pos=38 char=s +pos=39 char=, +pos=40 char= +pos=41 char=O +pos=42 char=u +pos=43 char=t +pos=44 char=, +pos=45 char= +pos=46 char=P +pos=47 char=l +pos=48 char=a +pos=49 char=t +pos=50 char=f +pos=51 char=o +pos=52 char=r +pos=53 char=m +pos=54 char=; +pos=56 char= +pos=58 char= +pos=59 char=C +pos=60 char=O +pos=61 char=N +pos=62 char=S +pos=63 char=T +pos=64 char= +pos=65 char=p +pos=66 char=a +pos=67 char=t +pos=68 char=h +pos=69 char== +pos=70 char=" +pos=71 char=i +pos=72 char=s +pos=73 char=p +pos=74 char=t +pos=75 char=e +pos=76 char=s +pos=77 char=t +pos=78 char=. +pos=79 char=m +pos=80 char=o +pos=81 char=d +pos=82 char=" +pos=83 char=; +pos=85 char= +pos=87 char= +pos=88 char=V +pos=89 char=A +pos=90 char=R +pos=92 char= +pos=93 char= +pos=94 char= +pos=95 char=T +pos=96 char=: +pos=97 char= +pos=98 char=T +pos=99 char=e +pos=100 char=x +pos=101 char=t +pos=102 char=s +pos=103 char=. +pos=104 char=T +pos=105 char=e +pos=106 char=x +pos=107 char=t +pos=108 char=; +pos=110 char= +pos=111 char= +pos=112 char= +pos=113 char=R +pos=114 char=: +pos=115 char= +pos=116 char=T +pos=117 char=e +pos=118 char=x +pos=119 char=t +pos=120 char=s +pos=121 char=. +pos=122 char=R +pos=123 char=e +pos=124 char=a +pos=125 char=d +pos=126 char=e +pos=127 char=r +pos=128 char=; +pos=130 char= +pos=131 char= +pos=132 char= +pos=133 char=c +pos=134 char=h +pos=135 char=: +pos=136 char= +pos=137 char=C +pos=138 char=H +pos=139 char=A +pos=140 char=R +pos=141 char=; +pos=143 char= +pos=144 char= +pos=145 char= +pos=146 char=i +pos=147 char=, +pos=148 char= +pos=149 char=j +pos=150 char=, +pos=151 char= +pos=152 char=k +pos=153 char= +pos=154 char=: +pos=155 char= +pos=156 char=L +pos=157 char=O +pos=158 char=N +pos=159 char=G +pos=160 char=I +pos=161 char=N +pos=162 char=T +pos=163 char=; +pos=165 char= +pos=166 char=B +pos=167 char=E +pos=168 char=G +pos=169 char=I +pos=170 char=N +pos=172 char= +pos=173 char= +pos=174 char= +pos=175 char=N +pos=176 char=E +pos=177 char=W +pos=178 char=( +pos=179 char=T +pos=180 char=) +pos=181 char=; +pos=183 char= +pos=184 char= +pos=185 char= +pos=186 char=I +pos=187 char=F +pos=188 char= +pos=189 char=F +pos=190 char=i +pos=191 char=l +pos=192 char=e +pos=193 char=s +pos=194 char=. +pos=195 char=O +pos=196 char=l +pos=197 char=d +pos=198 char=( +pos=199 char=p +pos=200 char=a +pos=201 char=t +pos=202 char=h +pos=203 char=) +pos=204 char= +pos=205 char=# +pos=206 char= +pos=207 char=N +pos=208 char=I +pos=209 char=L +pos=210 char= +pos=211 char=T +pos=212 char=H +pos=213 char=E +pos=214 char=N +pos=216 char= +pos=217 char= +pos=218 char= +pos=219 char= +pos=220 char= +pos=221 char=T +pos=222 char=e +pos=223 char=x +pos=224 char=t +pos=225 char=s +pos=226 char=. +pos=227 char=O +pos=228 char=p +pos=229 char=e +pos=230 char=n +pos=231 char=( +pos=232 char=T +pos=233 char=, +pos=234 char= +pos=235 char=p +pos=236 char=a +pos=237 char=t +pos=238 char=h +pos=239 char=) +pos=240 char=; +pos=242 char= +pos=243 char= +pos=244 char= +pos=245 char= +pos=246 char= +pos=247 char=T +pos=248 char=e +pos=249 char=x +pos=250 char=t +pos=251 char=s +pos=252 char=. +pos=253 char=O +pos=254 char=p +pos=255 char=e +pos=256 char=n +pos=257 char=R +pos=258 char=e +pos=259 char=a +pos=260 char=d +pos=261 char=e +pos=262 char=r +pos=263 char=( +pos=264 char=R +pos=265 char=, +pos=266 char= +pos=267 char=T +pos=268 char=, +pos=269 char= +pos=270 char=0 +pos=271 char=) +pos=272 char=; +pos=273 char= +pos=274 char=T +pos=275 char=e +pos=276 char=x +pos=277 char=t +pos=278 char=s +pos=279 char=. +pos=280 char=R +pos=281 char=e +pos=282 char=a +pos=283 char=d +pos=284 char=( +pos=285 char=R +pos=286 char=, +pos=287 char= +pos=288 char=c +pos=289 char=h +pos=290 char=) +pos=291 char=; +pos=293 char= +pos=294 char= +pos=295 char= +pos=296 char= +pos=297 char= +pos=298 char=W +pos=299 char=H +pos=300 char=I +pos=301 char=L +pos=302 char=E +pos=303 char= +pos=304 char=~ +pos=305 char=R +pos=306 char=. +pos=307 char=e +pos=308 char=o +pos=309 char=t +pos=310 char= +pos=311 char=D +pos=312 char=O +pos=314 char= +pos=315 char= +pos=316 char= +pos=317 char= +pos=318 char= +pos=319 char= +pos=320 char= +pos=321 char= +pos=322 char=T +pos=323 char=e +pos=324 char=x +pos=325 char=t +pos=326 char=s +pos=327 char=. +pos=328 char=R +pos=329 char=e +pos=330 char=a +pos=331 char=d +pos=332 char=( +pos=333 char=R +pos=334 char=, +pos=335 char= +pos=336 char=c +pos=337 char=h +pos=338 char=) +pos=339 char=; +pos=341 char= +pos=342 char= +pos=343 char= +pos=344 char= +pos=345 char= +pos=346 char= +pos=347 char= +pos=348 char= +pos=349 char=i +pos=350 char= +pos=351 char=: +pos=352 char== +pos=353 char= +pos=354 char=T +pos=355 char=e +pos=356 char=x +pos=357 char=t +pos=358 char=s +pos=359 char=. +pos=360 char=P +pos=361 char=o +pos=362 char=s +pos=363 char=( +pos=364 char=R +pos=365 char=) +pos=366 char=; +pos=368 char= +pos=369 char= +pos=370 char= +pos=371 char= +pos=372 char= +pos=373 char= +pos=374 char= +pos=375 char= +pos=376 char=O +pos=377 char=u +pos=378 char=t +pos=379 char=. +pos=380 char=S +pos=381 char=t +pos=382 char=r +pos=383 char=i +pos=384 char=n +pos=385 char=g +pos=386 char=( +pos=387 char=" +pos=388 char=p +pos=389 char=o +pos=390 char=s +pos=391 char== +pos=392 char=" +pos=393 char=) +pos=394 char=; +pos=395 char= +pos=396 char=O +pos=397 char=u +pos=398 char=t +pos=399 char=. +pos=400 char=I +pos=401 char=n +pos=402 char=t +pos=403 char=( +pos=404 char=i +pos=405 char=, +pos=406 char=0 +pos=407 char=) +pos=408 char=; +pos=409 char= +pos=410 char=O +pos=411 char=u +pos=412 char=t +pos=413 char=. +pos=414 char=S +pos=415 char=t +pos=416 char=r +pos=417 char=i +pos=418 char=n +pos=419 char=g +pos=420 char=( +pos=421 char=" +pos=422 char= +pos=423 char=c +pos=424 char=h +pos=425 char=a +pos=426 char=r +pos=427 char== +pos=428 char=" +pos=429 char=) +pos=430 char=; +pos=431 char= +pos=432 char=O +pos=433 char=u +pos=434 char=t +pos=435 char=. +pos=436 char=C +pos=437 char=h +pos=438 char=a +pos=439 char=r +pos=440 char=( +pos=441 char=c +pos=442 char=h +pos=443 char=) +pos=444 char=; +pos=445 char= +pos=446 char=O +pos=447 char=u +pos=448 char=t +pos=449 char=. +pos=450 char=L +pos=451 char=n +pos=452 char=; +pos=454 char= +pos=455 char= +pos=456 char= +pos=457 char= +pos=458 char= +pos=459 char= +pos=460 char= +pos=461 char= +pos=462 char=I +pos=463 char=F +pos=464 char= +pos=465 char=i +pos=466 char= +pos=467 char== +pos=468 char= +pos=469 char=2 +pos=470 char=1 +pos=471 char=9 +pos=472 char=0 +pos=473 char=6 +pos=474 char= +pos=475 char=T +pos=476 char=H +pos=477 char=E +pos=478 char=N +pos=480 char= +pos=481 char= +pos=482 char= +pos=483 char= +pos=484 char= +pos=485 char= +pos=486 char= +pos=487 char= +pos=488 char= +pos=489 char= +pos=490 char=O +pos=491 char=u +pos=492 char=t +pos=493 char=. +pos=494 char=S +pos=495 char=t +pos=496 char=r +pos=497 char=i +pos=498 char=n +pos=499 char=g +pos=500 char=( +pos=501 char=" +pos=502 char=2 +pos=503 char=1 +pos=504 char=9 +pos=505 char=0 +pos=506 char=6 +pos=507 char=" +pos=508 char=) +pos=509 char=; +pos=510 char= +pos=511 char=O +pos=512 char=u +pos=513 char=t +pos=514 char=. +pos=515 char=L +pos=516 char=n +pos=517 char=; +pos=519 char= +pos=520 char= +pos=521 char= +pos=522 char= +pos=523 char= +pos=524 char= +pos=525 char= +pos=526 char= +pos=527 char= +pos=528 char= +pos=529 char=( +pos=530 char=* +pos=531 char=P +pos=532 char=l +pos=533 char=a +pos=534 char=t +pos=535 char=f +pos=536 char=o +pos=537 char=r +pos=538 char=m +pos=539 char=. +pos=540 char=D +pos=541 char=e +pos=542 char=l +pos=543 char=a +pos=544 char=y +pos=545 char=( +pos=546 char=1 +pos=547 char=0 +pos=548 char=0 +pos=549 char=0 +pos=550 char=0 +pos=551 char=) +pos=552 char=; +pos=553 char=* +pos=554 char=) +pos=556 char= +pos=557 char= +pos=558 char= +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=569 char= +pos=570 char= +pos=571 char= +pos=572 char= +pos=573 char= +pos=574 char=E +pos=575 char=N +pos=576 char=D +pos=577 char=; +pos=579 char= +pos=580 char= +pos=581 char= +pos=582 char=E +pos=583 char=N +pos=584 char=D +pos=586 char= +pos=587 char=E +pos=588 char=N +pos=589 char=D +pos=590 char= +pos=591 char=i +pos=592 char=s +pos=593 char=p +pos=594 char=t +pos=595 char=e +pos=596 char=s +pos=597 char=t +pos=598 char=. +pos=599 char= diff --git a/src/test/confidence/isptest/isptest.mod b/src/test/confidence/isptest/isptest.mod new file mode 100644 index 00000000..cc6313e3 --- /dev/null +++ b/src/test/confidence/isptest/isptest.mod @@ -0,0 +1,27 @@ +MODULE isptest; + +IMPORT Files, Texts, Out, Platform; + +CONST path="isptest.mod"; + +VAR + T: Texts.Text; + R: Texts.Reader; + ch: CHAR; + i, j, k : LONGINT; +BEGIN + NEW(T); + IF Files.Old(path) # NIL THEN + Texts.Open(T, path); + Texts.OpenReader(R, T, 0); Texts.Read(R, ch); + WHILE ~R.eot DO + Texts.Read(R, ch); + i := Texts.Pos(R); + Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Ln; + IF i = 21906 THEN + Out.String("21906"); Out.Ln; + (*Platform.Delay(10000);*) + END; + END; + END +END isptest. \ No newline at end of file diff --git a/src/test/confidence/isptest/test.sh b/src/test/confidence/isptest/test.sh new file mode 100644 index 00000000..49e2dfdd --- /dev/null +++ b/src/test/confidence/isptest/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh +. ../testenv.sh +$OBECOMP isptest.mod -m -O2 +./isptest >result-O2 +$OBECOMP isptest.mod -m -OC +./isptest >result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index c0073202..ffdbded1 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -382,12 +382,12 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; $(RUNTEST) + cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) - cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) cd src/test/confidence/arrayassignment; $(RUNTEST) From c3515d8e4b116436cb4e29a4c467cd412f7c0760 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 20 Oct 2016 19:48:23 +0100 Subject: [PATCH 096/140] Use Unix line endings for isptest.mod. --- src/test/confidence/isptest/expected | 2128 +++++++++++++------------- 1 file changed, 1064 insertions(+), 1064 deletions(-) diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected index ef0f3a55..4ce25153 100644 --- a/src/test/confidence/isptest/expected +++ b/src/test/confidence/isptest/expected @@ -13,564 +13,564 @@ pos=12 char=e pos=13 char=s pos=14 char=t pos=15 char=; +pos=16 char= pos=17 char= -pos=19 char= -pos=20 char=I -pos=21 char=M -pos=22 char=P -pos=23 char=O -pos=24 char=R -pos=25 char=T -pos=26 char= -pos=27 char=F -pos=28 char=i -pos=29 char=l -pos=30 char=e -pos=31 char=s -pos=32 char=, -pos=33 char= -pos=34 char=T -pos=35 char=e -pos=36 char=x -pos=37 char=t -pos=38 char=s -pos=39 char=, -pos=40 char= -pos=41 char=O -pos=42 char=u -pos=43 char=t -pos=44 char=, -pos=45 char= -pos=46 char=P -pos=47 char=l -pos=48 char=a -pos=49 char=t -pos=50 char=f -pos=51 char=o -pos=52 char=r -pos=53 char=m -pos=54 char=; -pos=56 char= -pos=58 char= -pos=59 char=C -pos=60 char=O -pos=61 char=N -pos=62 char=S -pos=63 char=T -pos=64 char= -pos=65 char=p -pos=66 char=a -pos=67 char=t -pos=68 char=h -pos=69 char== -pos=70 char=" -pos=71 char=i +pos=18 char=I +pos=19 char=M +pos=20 char=P +pos=21 char=O +pos=22 char=R +pos=23 char=T +pos=24 char= +pos=25 char=F +pos=26 char=i +pos=27 char=l +pos=28 char=e +pos=29 char=s +pos=30 char=, +pos=31 char= +pos=32 char=T +pos=33 char=e +pos=34 char=x +pos=35 char=t +pos=36 char=s +pos=37 char=, +pos=38 char= +pos=39 char=O +pos=40 char=u +pos=41 char=t +pos=42 char=, +pos=43 char= +pos=44 char=P +pos=45 char=l +pos=46 char=a +pos=47 char=t +pos=48 char=f +pos=49 char=o +pos=50 char=r +pos=51 char=m +pos=52 char=; +pos=53 char= +pos=54 char= +pos=55 char=C +pos=56 char=O +pos=57 char=N +pos=58 char=S +pos=59 char=T +pos=60 char= +pos=61 char=p +pos=62 char=a +pos=63 char=t +pos=64 char=h +pos=65 char== +pos=66 char=" +pos=67 char=i +pos=68 char=s +pos=69 char=p +pos=70 char=t +pos=71 char=e pos=72 char=s -pos=73 char=p -pos=74 char=t -pos=75 char=e -pos=76 char=s -pos=77 char=t -pos=78 char=. -pos=79 char=m -pos=80 char=o -pos=81 char=d -pos=82 char=" -pos=83 char=; +pos=73 char=t +pos=74 char=. +pos=75 char=m +pos=76 char=o +pos=77 char=d +pos=78 char=" +pos=79 char=; +pos=80 char= +pos=81 char= +pos=82 char=V +pos=83 char=A +pos=84 char=R pos=85 char= -pos=87 char= -pos=88 char=V -pos=89 char=A -pos=90 char=R -pos=92 char= -pos=93 char= -pos=94 char= -pos=95 char=T -pos=96 char=: -pos=97 char= -pos=98 char=T -pos=99 char=e -pos=100 char=x -pos=101 char=t -pos=102 char=s -pos=103 char=. -pos=104 char=T -pos=105 char=e -pos=106 char=x -pos=107 char=t -pos=108 char=; -pos=110 char= -pos=111 char= -pos=112 char= -pos=113 char=R -pos=114 char=: -pos=115 char= -pos=116 char=T -pos=117 char=e -pos=118 char=x -pos=119 char=t -pos=120 char=s -pos=121 char=. -pos=122 char=R -pos=123 char=e -pos=124 char=a -pos=125 char=d -pos=126 char=e -pos=127 char=r -pos=128 char=; -pos=130 char= -pos=131 char= -pos=132 char= -pos=133 char=c -pos=134 char=h -pos=135 char=: -pos=136 char= -pos=137 char=C -pos=138 char=H -pos=139 char=A -pos=140 char=R -pos=141 char=; -pos=143 char= -pos=144 char= +pos=86 char= +pos=87 char= +pos=88 char=T +pos=89 char=: +pos=90 char= +pos=91 char=T +pos=92 char=e +pos=93 char=x +pos=94 char=t +pos=95 char=s +pos=96 char=. +pos=97 char=T +pos=98 char=e +pos=99 char=x +pos=100 char=t +pos=101 char=; +pos=102 char= +pos=103 char= +pos=104 char= +pos=105 char=R +pos=106 char=: +pos=107 char= +pos=108 char=T +pos=109 char=e +pos=110 char=x +pos=111 char=t +pos=112 char=s +pos=113 char=. +pos=114 char=R +pos=115 char=e +pos=116 char=a +pos=117 char=d +pos=118 char=e +pos=119 char=r +pos=120 char=; +pos=121 char= +pos=122 char= +pos=123 char= +pos=124 char=c +pos=125 char=h +pos=126 char=: +pos=127 char= +pos=128 char=C +pos=129 char=H +pos=130 char=A +pos=131 char=R +pos=132 char=; +pos=133 char= +pos=134 char= +pos=135 char= +pos=136 char=i +pos=137 char=, +pos=138 char= +pos=139 char=j +pos=140 char=, +pos=141 char= +pos=142 char=k +pos=143 char= +pos=144 char=: pos=145 char= -pos=146 char=i -pos=147 char=, -pos=148 char= -pos=149 char=j -pos=150 char=, -pos=151 char= -pos=152 char=k -pos=153 char= -pos=154 char=: -pos=155 char= -pos=156 char=L -pos=157 char=O -pos=158 char=N -pos=159 char=G -pos=160 char=I -pos=161 char=N -pos=162 char=T -pos=163 char=; -pos=165 char= -pos=166 char=B -pos=167 char=E -pos=168 char=G -pos=169 char=I -pos=170 char=N -pos=172 char= -pos=173 char= -pos=174 char= -pos=175 char=N -pos=176 char=E -pos=177 char=W -pos=178 char=( -pos=179 char=T -pos=180 char=) -pos=181 char=; -pos=183 char= -pos=184 char= -pos=185 char= -pos=186 char=I -pos=187 char=F -pos=188 char= -pos=189 char=F -pos=190 char=i -pos=191 char=l -pos=192 char=e -pos=193 char=s -pos=194 char=. -pos=195 char=O -pos=196 char=l -pos=197 char=d -pos=198 char=( -pos=199 char=p -pos=200 char=a -pos=201 char=t -pos=202 char=h -pos=203 char=) +pos=146 char=L +pos=147 char=O +pos=148 char=N +pos=149 char=G +pos=150 char=I +pos=151 char=N +pos=152 char=T +pos=153 char=; +pos=154 char= +pos=155 char=B +pos=156 char=E +pos=157 char=G +pos=158 char=I +pos=159 char=N +pos=160 char= +pos=161 char= +pos=162 char= +pos=163 char=N +pos=164 char=E +pos=165 char=W +pos=166 char=( +pos=167 char=T +pos=168 char=) +pos=169 char=; +pos=170 char= +pos=171 char= +pos=172 char= +pos=173 char=I +pos=174 char=F +pos=175 char= +pos=176 char=F +pos=177 char=i +pos=178 char=l +pos=179 char=e +pos=180 char=s +pos=181 char=. +pos=182 char=O +pos=183 char=l +pos=184 char=d +pos=185 char=( +pos=186 char=p +pos=187 char=a +pos=188 char=t +pos=189 char=h +pos=190 char=) +pos=191 char= +pos=192 char=# +pos=193 char= +pos=194 char=N +pos=195 char=I +pos=196 char=L +pos=197 char= +pos=198 char=T +pos=199 char=H +pos=200 char=E +pos=201 char=N +pos=202 char= +pos=203 char= pos=204 char= -pos=205 char=# +pos=205 char= pos=206 char= -pos=207 char=N -pos=208 char=I -pos=209 char=L -pos=210 char= -pos=211 char=T -pos=212 char=H -pos=213 char=E -pos=214 char=N -pos=216 char= -pos=217 char= -pos=218 char= -pos=219 char= +pos=207 char=T +pos=208 char=e +pos=209 char=x +pos=210 char=t +pos=211 char=s +pos=212 char=. +pos=213 char=O +pos=214 char=p +pos=215 char=e +pos=216 char=n +pos=217 char=( +pos=218 char=T +pos=219 char=, pos=220 char= -pos=221 char=T -pos=222 char=e -pos=223 char=x -pos=224 char=t -pos=225 char=s -pos=226 char=. -pos=227 char=O -pos=228 char=p -pos=229 char=e -pos=230 char=n -pos=231 char=( +pos=221 char=p +pos=222 char=a +pos=223 char=t +pos=224 char=h +pos=225 char=) +pos=226 char=; +pos=227 char= +pos=228 char= +pos=229 char= +pos=230 char= +pos=231 char= pos=232 char=T -pos=233 char=, -pos=234 char= -pos=235 char=p -pos=236 char=a -pos=237 char=t -pos=238 char=h -pos=239 char=) -pos=240 char=; -pos=242 char= -pos=243 char= -pos=244 char= -pos=245 char= -pos=246 char= -pos=247 char=T -pos=248 char=e -pos=249 char=x -pos=250 char=t -pos=251 char=s -pos=252 char=. -pos=253 char=O -pos=254 char=p -pos=255 char=e -pos=256 char=n -pos=257 char=R -pos=258 char=e -pos=259 char=a -pos=260 char=d -pos=261 char=e -pos=262 char=r -pos=263 char=( -pos=264 char=R -pos=265 char=, -pos=266 char= -pos=267 char=T -pos=268 char=, -pos=269 char= -pos=270 char=0 -pos=271 char=) -pos=272 char=; -pos=273 char= -pos=274 char=T -pos=275 char=e -pos=276 char=x -pos=277 char=t -pos=278 char=s -pos=279 char=. -pos=280 char=R -pos=281 char=e -pos=282 char=a -pos=283 char=d -pos=284 char=( -pos=285 char=R -pos=286 char=, +pos=233 char=e +pos=234 char=x +pos=235 char=t +pos=236 char=s +pos=237 char=. +pos=238 char=O +pos=239 char=p +pos=240 char=e +pos=241 char=n +pos=242 char=R +pos=243 char=e +pos=244 char=a +pos=245 char=d +pos=246 char=e +pos=247 char=r +pos=248 char=( +pos=249 char=R +pos=250 char=, +pos=251 char= +pos=252 char=T +pos=253 char=, +pos=254 char= +pos=255 char=0 +pos=256 char=) +pos=257 char=; +pos=258 char= +pos=259 char=T +pos=260 char=e +pos=261 char=x +pos=262 char=t +pos=263 char=s +pos=264 char=. +pos=265 char=R +pos=266 char=e +pos=267 char=a +pos=268 char=d +pos=269 char=( +pos=270 char=R +pos=271 char=, +pos=272 char= +pos=273 char=c +pos=274 char=h +pos=275 char=) +pos=276 char=; +pos=277 char= +pos=278 char= +pos=279 char= +pos=280 char= +pos=281 char= +pos=282 char=W +pos=283 char=H +pos=284 char=I +pos=285 char=L +pos=286 char=E pos=287 char= -pos=288 char=c -pos=289 char=h -pos=290 char=) -pos=291 char=; -pos=293 char= +pos=288 char=~ +pos=289 char=R +pos=290 char=. +pos=291 char=e +pos=292 char=o +pos=293 char=t pos=294 char= -pos=295 char= -pos=296 char= -pos=297 char= -pos=298 char=W -pos=299 char=H -pos=300 char=I -pos=301 char=L -pos=302 char=E +pos=295 char=D +pos=296 char=O +pos=297 char= +pos=298 char= +pos=299 char= +pos=300 char= +pos=301 char= +pos=302 char= pos=303 char= -pos=304 char=~ -pos=305 char=R -pos=306 char=. -pos=307 char=e -pos=308 char=o -pos=309 char=t -pos=310 char= -pos=311 char=D -pos=312 char=O -pos=314 char= -pos=315 char= -pos=316 char= -pos=317 char= +pos=304 char= +pos=305 char=T +pos=306 char=e +pos=307 char=x +pos=308 char=t +pos=309 char=s +pos=310 char=. +pos=311 char=R +pos=312 char=e +pos=313 char=a +pos=314 char=d +pos=315 char=( +pos=316 char=R +pos=317 char=, pos=318 char= -pos=319 char= -pos=320 char= -pos=321 char= -pos=322 char=T -pos=323 char=e -pos=324 char=x -pos=325 char=t -pos=326 char=s -pos=327 char=. -pos=328 char=R -pos=329 char=e -pos=330 char=a -pos=331 char=d -pos=332 char=( -pos=333 char=R -pos=334 char=, +pos=319 char=c +pos=320 char=h +pos=321 char=) +pos=322 char=; +pos=323 char= +pos=324 char= +pos=325 char= +pos=326 char= +pos=327 char= +pos=328 char= +pos=329 char= +pos=330 char= +pos=331 char=i +pos=332 char= +pos=333 char=: +pos=334 char== pos=335 char= -pos=336 char=c -pos=337 char=h -pos=338 char=) -pos=339 char=; -pos=341 char= -pos=342 char= -pos=343 char= -pos=344 char= -pos=345 char= -pos=346 char= -pos=347 char= -pos=348 char= -pos=349 char=i +pos=336 char=T +pos=337 char=e +pos=338 char=x +pos=339 char=t +pos=340 char=s +pos=341 char=. +pos=342 char=P +pos=343 char=o +pos=344 char=s +pos=345 char=( +pos=346 char=R +pos=347 char=) +pos=348 char=; +pos=349 char= pos=350 char= -pos=351 char=: -pos=352 char== +pos=351 char= +pos=352 char= pos=353 char= -pos=354 char=T -pos=355 char=e -pos=356 char=x -pos=357 char=t -pos=358 char=s -pos=359 char=. -pos=360 char=P -pos=361 char=o -pos=362 char=s -pos=363 char=( -pos=364 char=R -pos=365 char=) -pos=366 char=; -pos=368 char= -pos=369 char= -pos=370 char= -pos=371 char= -pos=372 char= -pos=373 char= -pos=374 char= -pos=375 char= -pos=376 char=O -pos=377 char=u -pos=378 char=t -pos=379 char=. -pos=380 char=S -pos=381 char=t -pos=382 char=r -pos=383 char=i -pos=384 char=n -pos=385 char=g -pos=386 char=( -pos=387 char=" -pos=388 char=p -pos=389 char=o -pos=390 char=s -pos=391 char== -pos=392 char=" -pos=393 char=) -pos=394 char=; -pos=395 char= -pos=396 char=O -pos=397 char=u -pos=398 char=t -pos=399 char=. -pos=400 char=I -pos=401 char=n -pos=402 char=t -pos=403 char=( -pos=404 char=i -pos=405 char=, -pos=406 char=0 -pos=407 char=) -pos=408 char=; -pos=409 char= -pos=410 char=O -pos=411 char=u -pos=412 char=t -pos=413 char=. -pos=414 char=S +pos=354 char= +pos=355 char= +pos=356 char= +pos=357 char=O +pos=358 char=u +pos=359 char=t +pos=360 char=. +pos=361 char=S +pos=362 char=t +pos=363 char=r +pos=364 char=i +pos=365 char=n +pos=366 char=g +pos=367 char=( +pos=368 char=" +pos=369 char=p +pos=370 char=o +pos=371 char=s +pos=372 char== +pos=373 char=" +pos=374 char=) +pos=375 char=; +pos=376 char= +pos=377 char=O +pos=378 char=u +pos=379 char=t +pos=380 char=. +pos=381 char=I +pos=382 char=n +pos=383 char=t +pos=384 char=( +pos=385 char=i +pos=386 char=, +pos=387 char=0 +pos=388 char=) +pos=389 char=; +pos=390 char= +pos=391 char=O +pos=392 char=u +pos=393 char=t +pos=394 char=. +pos=395 char=S +pos=396 char=t +pos=397 char=r +pos=398 char=i +pos=399 char=n +pos=400 char=g +pos=401 char=( +pos=402 char=" +pos=403 char= +pos=404 char=c +pos=405 char=h +pos=406 char=a +pos=407 char=r +pos=408 char== +pos=409 char=" +pos=410 char=) +pos=411 char=; +pos=412 char= +pos=413 char=O +pos=414 char=u pos=415 char=t -pos=416 char=r -pos=417 char=i -pos=418 char=n -pos=419 char=g -pos=420 char=( -pos=421 char=" -pos=422 char= -pos=423 char=c -pos=424 char=h -pos=425 char=a -pos=426 char=r -pos=427 char== -pos=428 char=" -pos=429 char=) -pos=430 char=; -pos=431 char= -pos=432 char=O -pos=433 char=u -pos=434 char=t -pos=435 char=. -pos=436 char=C -pos=437 char=h -pos=438 char=a -pos=439 char=r -pos=440 char=( -pos=441 char=c -pos=442 char=h -pos=443 char=) -pos=444 char=; -pos=445 char= -pos=446 char=O -pos=447 char=u -pos=448 char=t -pos=449 char=. -pos=450 char=L -pos=451 char=n -pos=452 char=; -pos=454 char= -pos=455 char= -pos=456 char= -pos=457 char= -pos=458 char= -pos=459 char= +pos=416 char=. +pos=417 char=C +pos=418 char=h +pos=419 char=a +pos=420 char=r +pos=421 char=( +pos=422 char=c +pos=423 char=h +pos=424 char=) +pos=425 char=; +pos=426 char= +pos=427 char=O +pos=428 char=u +pos=429 char=t +pos=430 char=. +pos=431 char=L +pos=432 char=n +pos=433 char=; +pos=434 char= +pos=435 char= +pos=436 char= +pos=437 char= +pos=438 char= +pos=439 char= +pos=440 char= +pos=441 char= +pos=442 char=I +pos=443 char=F +pos=444 char= +pos=445 char=i +pos=446 char= +pos=447 char== +pos=448 char= +pos=449 char=2 +pos=450 char=1 +pos=451 char=9 +pos=452 char=0 +pos=453 char=6 +pos=454 char= +pos=455 char=T +pos=456 char=H +pos=457 char=E +pos=458 char=N +pos=459 char= pos=460 char= pos=461 char= -pos=462 char=I -pos=463 char=F +pos=462 char= +pos=463 char= pos=464 char= -pos=465 char=i +pos=465 char= pos=466 char= -pos=467 char== +pos=467 char= pos=468 char= -pos=469 char=2 -pos=470 char=1 -pos=471 char=9 -pos=472 char=0 -pos=473 char=6 -pos=474 char= -pos=475 char=T -pos=476 char=H -pos=477 char=E -pos=478 char=N -pos=480 char= -pos=481 char= -pos=482 char= -pos=483 char= -pos=484 char= -pos=485 char= -pos=486 char= -pos=487 char= -pos=488 char= +pos=469 char=O +pos=470 char=u +pos=471 char=t +pos=472 char=. +pos=473 char=S +pos=474 char=t +pos=475 char=r +pos=476 char=i +pos=477 char=n +pos=478 char=g +pos=479 char=( +pos=480 char=" +pos=481 char=2 +pos=482 char=1 +pos=483 char=9 +pos=484 char=0 +pos=485 char=6 +pos=486 char=" +pos=487 char=) +pos=488 char=; pos=489 char= pos=490 char=O pos=491 char=u pos=492 char=t pos=493 char=. -pos=494 char=S -pos=495 char=t -pos=496 char=r -pos=497 char=i -pos=498 char=n -pos=499 char=g -pos=500 char=( -pos=501 char=" -pos=502 char=2 -pos=503 char=1 -pos=504 char=9 -pos=505 char=0 -pos=506 char=6 -pos=507 char=" -pos=508 char=) -pos=509 char=; -pos=510 char= -pos=511 char=O -pos=512 char=u -pos=513 char=t -pos=514 char=. -pos=515 char=L -pos=516 char=n -pos=517 char=; -pos=519 char= -pos=520 char= -pos=521 char= -pos=522 char= -pos=523 char= -pos=524 char= -pos=525 char= -pos=526 char= -pos=527 char= -pos=528 char= -pos=529 char=( -pos=530 char=* -pos=531 char=P -pos=532 char=l -pos=533 char=a -pos=534 char=t -pos=535 char=f -pos=536 char=o -pos=537 char=r -pos=538 char=m -pos=539 char=. -pos=540 char=D -pos=541 char=e -pos=542 char=l -pos=543 char=a -pos=544 char=y -pos=545 char=( -pos=546 char=1 -pos=547 char=0 -pos=548 char=0 -pos=549 char=0 -pos=550 char=0 -pos=551 char=) -pos=552 char=; -pos=553 char=* -pos=554 char=) -pos=556 char= -pos=557 char= -pos=558 char= -pos=559 char= -pos=560 char= -pos=561 char= -pos=562 char= -pos=563 char= -pos=564 char=E -pos=565 char=N -pos=566 char=D -pos=567 char=; -pos=569 char= -pos=570 char= -pos=571 char= -pos=572 char= -pos=573 char= -pos=574 char=E -pos=575 char=N -pos=576 char=D -pos=577 char=; -pos=579 char= -pos=580 char= -pos=581 char= -pos=582 char=E -pos=583 char=N -pos=584 char=D -pos=586 char= -pos=587 char=E -pos=588 char=N -pos=589 char=D -pos=590 char= -pos=591 char=i -pos=592 char=s -pos=593 char=p -pos=594 char=t -pos=595 char=e -pos=596 char=s -pos=597 char=t -pos=598 char=. -pos=599 char= +pos=494 char=L +pos=495 char=n +pos=496 char=; +pos=497 char= +pos=498 char= +pos=499 char= +pos=500 char= +pos=501 char= +pos=502 char= +pos=503 char= +pos=504 char= +pos=505 char= +pos=506 char= +pos=507 char=( +pos=508 char=* +pos=509 char=P +pos=510 char=l +pos=511 char=a +pos=512 char=t +pos=513 char=f +pos=514 char=o +pos=515 char=r +pos=516 char=m +pos=517 char=. +pos=518 char=D +pos=519 char=e +pos=520 char=l +pos=521 char=a +pos=522 char=y +pos=523 char=( +pos=524 char=1 +pos=525 char=0 +pos=526 char=0 +pos=527 char=0 +pos=528 char=0 +pos=529 char=) +pos=530 char=; +pos=531 char=* +pos=532 char=) +pos=533 char= +pos=534 char= +pos=535 char= +pos=536 char= +pos=537 char= +pos=538 char= +pos=539 char= +pos=540 char= +pos=541 char=E +pos=542 char=N +pos=543 char=D +pos=544 char=; +pos=545 char= +pos=546 char= +pos=547 char= +pos=548 char= +pos=549 char= +pos=550 char=E +pos=551 char=N +pos=552 char=D +pos=553 char=; +pos=554 char= +pos=555 char= +pos=556 char= +pos=557 char=E +pos=558 char=N +pos=559 char=D +pos=560 char= +pos=561 char=E +pos=562 char=N +pos=563 char=D +pos=564 char= +pos=565 char=i +pos=566 char=s +pos=567 char=p +pos=568 char=t +pos=569 char=e +pos=570 char=s +pos=571 char=t +pos=572 char=. +pos=573 char= --- Testing with Component Pascal variable model --- @@ -588,561 +588,561 @@ pos=12 char=e pos=13 char=s pos=14 char=t pos=15 char=; +pos=16 char= pos=17 char= -pos=19 char= -pos=20 char=I -pos=21 char=M -pos=22 char=P -pos=23 char=O -pos=24 char=R -pos=25 char=T -pos=26 char= -pos=27 char=F -pos=28 char=i -pos=29 char=l -pos=30 char=e -pos=31 char=s -pos=32 char=, -pos=33 char= -pos=34 char=T -pos=35 char=e -pos=36 char=x -pos=37 char=t -pos=38 char=s -pos=39 char=, -pos=40 char= -pos=41 char=O -pos=42 char=u -pos=43 char=t -pos=44 char=, -pos=45 char= -pos=46 char=P -pos=47 char=l -pos=48 char=a -pos=49 char=t -pos=50 char=f -pos=51 char=o -pos=52 char=r -pos=53 char=m -pos=54 char=; -pos=56 char= -pos=58 char= -pos=59 char=C -pos=60 char=O -pos=61 char=N -pos=62 char=S -pos=63 char=T -pos=64 char= -pos=65 char=p -pos=66 char=a -pos=67 char=t -pos=68 char=h -pos=69 char== -pos=70 char=" -pos=71 char=i +pos=18 char=I +pos=19 char=M +pos=20 char=P +pos=21 char=O +pos=22 char=R +pos=23 char=T +pos=24 char= +pos=25 char=F +pos=26 char=i +pos=27 char=l +pos=28 char=e +pos=29 char=s +pos=30 char=, +pos=31 char= +pos=32 char=T +pos=33 char=e +pos=34 char=x +pos=35 char=t +pos=36 char=s +pos=37 char=, +pos=38 char= +pos=39 char=O +pos=40 char=u +pos=41 char=t +pos=42 char=, +pos=43 char= +pos=44 char=P +pos=45 char=l +pos=46 char=a +pos=47 char=t +pos=48 char=f +pos=49 char=o +pos=50 char=r +pos=51 char=m +pos=52 char=; +pos=53 char= +pos=54 char= +pos=55 char=C +pos=56 char=O +pos=57 char=N +pos=58 char=S +pos=59 char=T +pos=60 char= +pos=61 char=p +pos=62 char=a +pos=63 char=t +pos=64 char=h +pos=65 char== +pos=66 char=" +pos=67 char=i +pos=68 char=s +pos=69 char=p +pos=70 char=t +pos=71 char=e pos=72 char=s -pos=73 char=p -pos=74 char=t -pos=75 char=e -pos=76 char=s -pos=77 char=t -pos=78 char=. -pos=79 char=m -pos=80 char=o -pos=81 char=d -pos=82 char=" -pos=83 char=; +pos=73 char=t +pos=74 char=. +pos=75 char=m +pos=76 char=o +pos=77 char=d +pos=78 char=" +pos=79 char=; +pos=80 char= +pos=81 char= +pos=82 char=V +pos=83 char=A +pos=84 char=R pos=85 char= -pos=87 char= -pos=88 char=V -pos=89 char=A -pos=90 char=R -pos=92 char= -pos=93 char= -pos=94 char= -pos=95 char=T -pos=96 char=: -pos=97 char= -pos=98 char=T -pos=99 char=e -pos=100 char=x -pos=101 char=t -pos=102 char=s -pos=103 char=. -pos=104 char=T -pos=105 char=e -pos=106 char=x -pos=107 char=t -pos=108 char=; -pos=110 char= -pos=111 char= -pos=112 char= -pos=113 char=R -pos=114 char=: -pos=115 char= -pos=116 char=T -pos=117 char=e -pos=118 char=x -pos=119 char=t -pos=120 char=s -pos=121 char=. -pos=122 char=R -pos=123 char=e -pos=124 char=a -pos=125 char=d -pos=126 char=e -pos=127 char=r -pos=128 char=; -pos=130 char= -pos=131 char= -pos=132 char= -pos=133 char=c -pos=134 char=h -pos=135 char=: -pos=136 char= -pos=137 char=C -pos=138 char=H -pos=139 char=A -pos=140 char=R -pos=141 char=; -pos=143 char= -pos=144 char= +pos=86 char= +pos=87 char= +pos=88 char=T +pos=89 char=: +pos=90 char= +pos=91 char=T +pos=92 char=e +pos=93 char=x +pos=94 char=t +pos=95 char=s +pos=96 char=. +pos=97 char=T +pos=98 char=e +pos=99 char=x +pos=100 char=t +pos=101 char=; +pos=102 char= +pos=103 char= +pos=104 char= +pos=105 char=R +pos=106 char=: +pos=107 char= +pos=108 char=T +pos=109 char=e +pos=110 char=x +pos=111 char=t +pos=112 char=s +pos=113 char=. +pos=114 char=R +pos=115 char=e +pos=116 char=a +pos=117 char=d +pos=118 char=e +pos=119 char=r +pos=120 char=; +pos=121 char= +pos=122 char= +pos=123 char= +pos=124 char=c +pos=125 char=h +pos=126 char=: +pos=127 char= +pos=128 char=C +pos=129 char=H +pos=130 char=A +pos=131 char=R +pos=132 char=; +pos=133 char= +pos=134 char= +pos=135 char= +pos=136 char=i +pos=137 char=, +pos=138 char= +pos=139 char=j +pos=140 char=, +pos=141 char= +pos=142 char=k +pos=143 char= +pos=144 char=: pos=145 char= -pos=146 char=i -pos=147 char=, -pos=148 char= -pos=149 char=j -pos=150 char=, -pos=151 char= -pos=152 char=k -pos=153 char= -pos=154 char=: -pos=155 char= -pos=156 char=L -pos=157 char=O -pos=158 char=N -pos=159 char=G -pos=160 char=I -pos=161 char=N -pos=162 char=T -pos=163 char=; -pos=165 char= -pos=166 char=B -pos=167 char=E -pos=168 char=G -pos=169 char=I -pos=170 char=N -pos=172 char= -pos=173 char= -pos=174 char= -pos=175 char=N -pos=176 char=E -pos=177 char=W -pos=178 char=( -pos=179 char=T -pos=180 char=) -pos=181 char=; -pos=183 char= -pos=184 char= -pos=185 char= -pos=186 char=I -pos=187 char=F -pos=188 char= -pos=189 char=F -pos=190 char=i -pos=191 char=l -pos=192 char=e -pos=193 char=s -pos=194 char=. -pos=195 char=O -pos=196 char=l -pos=197 char=d -pos=198 char=( -pos=199 char=p -pos=200 char=a -pos=201 char=t -pos=202 char=h -pos=203 char=) +pos=146 char=L +pos=147 char=O +pos=148 char=N +pos=149 char=G +pos=150 char=I +pos=151 char=N +pos=152 char=T +pos=153 char=; +pos=154 char= +pos=155 char=B +pos=156 char=E +pos=157 char=G +pos=158 char=I +pos=159 char=N +pos=160 char= +pos=161 char= +pos=162 char= +pos=163 char=N +pos=164 char=E +pos=165 char=W +pos=166 char=( +pos=167 char=T +pos=168 char=) +pos=169 char=; +pos=170 char= +pos=171 char= +pos=172 char= +pos=173 char=I +pos=174 char=F +pos=175 char= +pos=176 char=F +pos=177 char=i +pos=178 char=l +pos=179 char=e +pos=180 char=s +pos=181 char=. +pos=182 char=O +pos=183 char=l +pos=184 char=d +pos=185 char=( +pos=186 char=p +pos=187 char=a +pos=188 char=t +pos=189 char=h +pos=190 char=) +pos=191 char= +pos=192 char=# +pos=193 char= +pos=194 char=N +pos=195 char=I +pos=196 char=L +pos=197 char= +pos=198 char=T +pos=199 char=H +pos=200 char=E +pos=201 char=N +pos=202 char= +pos=203 char= pos=204 char= -pos=205 char=# +pos=205 char= pos=206 char= -pos=207 char=N -pos=208 char=I -pos=209 char=L -pos=210 char= -pos=211 char=T -pos=212 char=H -pos=213 char=E -pos=214 char=N -pos=216 char= -pos=217 char= -pos=218 char= -pos=219 char= +pos=207 char=T +pos=208 char=e +pos=209 char=x +pos=210 char=t +pos=211 char=s +pos=212 char=. +pos=213 char=O +pos=214 char=p +pos=215 char=e +pos=216 char=n +pos=217 char=( +pos=218 char=T +pos=219 char=, pos=220 char= -pos=221 char=T -pos=222 char=e -pos=223 char=x -pos=224 char=t -pos=225 char=s -pos=226 char=. -pos=227 char=O -pos=228 char=p -pos=229 char=e -pos=230 char=n -pos=231 char=( +pos=221 char=p +pos=222 char=a +pos=223 char=t +pos=224 char=h +pos=225 char=) +pos=226 char=; +pos=227 char= +pos=228 char= +pos=229 char= +pos=230 char= +pos=231 char= pos=232 char=T -pos=233 char=, -pos=234 char= -pos=235 char=p -pos=236 char=a -pos=237 char=t -pos=238 char=h -pos=239 char=) -pos=240 char=; -pos=242 char= -pos=243 char= -pos=244 char= -pos=245 char= -pos=246 char= -pos=247 char=T -pos=248 char=e -pos=249 char=x -pos=250 char=t -pos=251 char=s -pos=252 char=. -pos=253 char=O -pos=254 char=p -pos=255 char=e -pos=256 char=n -pos=257 char=R -pos=258 char=e -pos=259 char=a -pos=260 char=d -pos=261 char=e -pos=262 char=r -pos=263 char=( -pos=264 char=R -pos=265 char=, -pos=266 char= -pos=267 char=T -pos=268 char=, -pos=269 char= -pos=270 char=0 -pos=271 char=) -pos=272 char=; -pos=273 char= -pos=274 char=T -pos=275 char=e -pos=276 char=x -pos=277 char=t -pos=278 char=s -pos=279 char=. -pos=280 char=R -pos=281 char=e -pos=282 char=a -pos=283 char=d -pos=284 char=( -pos=285 char=R -pos=286 char=, +pos=233 char=e +pos=234 char=x +pos=235 char=t +pos=236 char=s +pos=237 char=. +pos=238 char=O +pos=239 char=p +pos=240 char=e +pos=241 char=n +pos=242 char=R +pos=243 char=e +pos=244 char=a +pos=245 char=d +pos=246 char=e +pos=247 char=r +pos=248 char=( +pos=249 char=R +pos=250 char=, +pos=251 char= +pos=252 char=T +pos=253 char=, +pos=254 char= +pos=255 char=0 +pos=256 char=) +pos=257 char=; +pos=258 char= +pos=259 char=T +pos=260 char=e +pos=261 char=x +pos=262 char=t +pos=263 char=s +pos=264 char=. +pos=265 char=R +pos=266 char=e +pos=267 char=a +pos=268 char=d +pos=269 char=( +pos=270 char=R +pos=271 char=, +pos=272 char= +pos=273 char=c +pos=274 char=h +pos=275 char=) +pos=276 char=; +pos=277 char= +pos=278 char= +pos=279 char= +pos=280 char= +pos=281 char= +pos=282 char=W +pos=283 char=H +pos=284 char=I +pos=285 char=L +pos=286 char=E pos=287 char= -pos=288 char=c -pos=289 char=h -pos=290 char=) -pos=291 char=; -pos=293 char= +pos=288 char=~ +pos=289 char=R +pos=290 char=. +pos=291 char=e +pos=292 char=o +pos=293 char=t pos=294 char= -pos=295 char= -pos=296 char= -pos=297 char= -pos=298 char=W -pos=299 char=H -pos=300 char=I -pos=301 char=L -pos=302 char=E +pos=295 char=D +pos=296 char=O +pos=297 char= +pos=298 char= +pos=299 char= +pos=300 char= +pos=301 char= +pos=302 char= pos=303 char= -pos=304 char=~ -pos=305 char=R -pos=306 char=. -pos=307 char=e -pos=308 char=o -pos=309 char=t -pos=310 char= -pos=311 char=D -pos=312 char=O -pos=314 char= -pos=315 char= -pos=316 char= -pos=317 char= +pos=304 char= +pos=305 char=T +pos=306 char=e +pos=307 char=x +pos=308 char=t +pos=309 char=s +pos=310 char=. +pos=311 char=R +pos=312 char=e +pos=313 char=a +pos=314 char=d +pos=315 char=( +pos=316 char=R +pos=317 char=, pos=318 char= -pos=319 char= -pos=320 char= -pos=321 char= -pos=322 char=T -pos=323 char=e -pos=324 char=x -pos=325 char=t -pos=326 char=s -pos=327 char=. -pos=328 char=R -pos=329 char=e -pos=330 char=a -pos=331 char=d -pos=332 char=( -pos=333 char=R -pos=334 char=, +pos=319 char=c +pos=320 char=h +pos=321 char=) +pos=322 char=; +pos=323 char= +pos=324 char= +pos=325 char= +pos=326 char= +pos=327 char= +pos=328 char= +pos=329 char= +pos=330 char= +pos=331 char=i +pos=332 char= +pos=333 char=: +pos=334 char== pos=335 char= -pos=336 char=c -pos=337 char=h -pos=338 char=) -pos=339 char=; -pos=341 char= -pos=342 char= -pos=343 char= -pos=344 char= -pos=345 char= -pos=346 char= -pos=347 char= -pos=348 char= -pos=349 char=i +pos=336 char=T +pos=337 char=e +pos=338 char=x +pos=339 char=t +pos=340 char=s +pos=341 char=. +pos=342 char=P +pos=343 char=o +pos=344 char=s +pos=345 char=( +pos=346 char=R +pos=347 char=) +pos=348 char=; +pos=349 char= pos=350 char= -pos=351 char=: -pos=352 char== +pos=351 char= +pos=352 char= pos=353 char= -pos=354 char=T -pos=355 char=e -pos=356 char=x -pos=357 char=t -pos=358 char=s -pos=359 char=. -pos=360 char=P -pos=361 char=o -pos=362 char=s -pos=363 char=( -pos=364 char=R -pos=365 char=) -pos=366 char=; -pos=368 char= -pos=369 char= -pos=370 char= -pos=371 char= -pos=372 char= -pos=373 char= -pos=374 char= -pos=375 char= -pos=376 char=O -pos=377 char=u -pos=378 char=t -pos=379 char=. -pos=380 char=S -pos=381 char=t -pos=382 char=r -pos=383 char=i -pos=384 char=n -pos=385 char=g -pos=386 char=( -pos=387 char=" -pos=388 char=p -pos=389 char=o -pos=390 char=s -pos=391 char== -pos=392 char=" -pos=393 char=) -pos=394 char=; -pos=395 char= -pos=396 char=O -pos=397 char=u -pos=398 char=t -pos=399 char=. -pos=400 char=I -pos=401 char=n -pos=402 char=t -pos=403 char=( -pos=404 char=i -pos=405 char=, -pos=406 char=0 -pos=407 char=) -pos=408 char=; -pos=409 char= -pos=410 char=O -pos=411 char=u -pos=412 char=t -pos=413 char=. -pos=414 char=S +pos=354 char= +pos=355 char= +pos=356 char= +pos=357 char=O +pos=358 char=u +pos=359 char=t +pos=360 char=. +pos=361 char=S +pos=362 char=t +pos=363 char=r +pos=364 char=i +pos=365 char=n +pos=366 char=g +pos=367 char=( +pos=368 char=" +pos=369 char=p +pos=370 char=o +pos=371 char=s +pos=372 char== +pos=373 char=" +pos=374 char=) +pos=375 char=; +pos=376 char= +pos=377 char=O +pos=378 char=u +pos=379 char=t +pos=380 char=. +pos=381 char=I +pos=382 char=n +pos=383 char=t +pos=384 char=( +pos=385 char=i +pos=386 char=, +pos=387 char=0 +pos=388 char=) +pos=389 char=; +pos=390 char= +pos=391 char=O +pos=392 char=u +pos=393 char=t +pos=394 char=. +pos=395 char=S +pos=396 char=t +pos=397 char=r +pos=398 char=i +pos=399 char=n +pos=400 char=g +pos=401 char=( +pos=402 char=" +pos=403 char= +pos=404 char=c +pos=405 char=h +pos=406 char=a +pos=407 char=r +pos=408 char== +pos=409 char=" +pos=410 char=) +pos=411 char=; +pos=412 char= +pos=413 char=O +pos=414 char=u pos=415 char=t -pos=416 char=r -pos=417 char=i -pos=418 char=n -pos=419 char=g -pos=420 char=( -pos=421 char=" -pos=422 char= -pos=423 char=c -pos=424 char=h -pos=425 char=a -pos=426 char=r -pos=427 char== -pos=428 char=" -pos=429 char=) -pos=430 char=; -pos=431 char= -pos=432 char=O -pos=433 char=u -pos=434 char=t -pos=435 char=. -pos=436 char=C -pos=437 char=h -pos=438 char=a -pos=439 char=r -pos=440 char=( -pos=441 char=c -pos=442 char=h -pos=443 char=) -pos=444 char=; -pos=445 char= -pos=446 char=O -pos=447 char=u -pos=448 char=t -pos=449 char=. -pos=450 char=L -pos=451 char=n -pos=452 char=; -pos=454 char= -pos=455 char= -pos=456 char= -pos=457 char= -pos=458 char= -pos=459 char= +pos=416 char=. +pos=417 char=C +pos=418 char=h +pos=419 char=a +pos=420 char=r +pos=421 char=( +pos=422 char=c +pos=423 char=h +pos=424 char=) +pos=425 char=; +pos=426 char= +pos=427 char=O +pos=428 char=u +pos=429 char=t +pos=430 char=. +pos=431 char=L +pos=432 char=n +pos=433 char=; +pos=434 char= +pos=435 char= +pos=436 char= +pos=437 char= +pos=438 char= +pos=439 char= +pos=440 char= +pos=441 char= +pos=442 char=I +pos=443 char=F +pos=444 char= +pos=445 char=i +pos=446 char= +pos=447 char== +pos=448 char= +pos=449 char=2 +pos=450 char=1 +pos=451 char=9 +pos=452 char=0 +pos=453 char=6 +pos=454 char= +pos=455 char=T +pos=456 char=H +pos=457 char=E +pos=458 char=N +pos=459 char= pos=460 char= pos=461 char= -pos=462 char=I -pos=463 char=F +pos=462 char= +pos=463 char= pos=464 char= -pos=465 char=i +pos=465 char= pos=466 char= -pos=467 char== +pos=467 char= pos=468 char= -pos=469 char=2 -pos=470 char=1 -pos=471 char=9 -pos=472 char=0 -pos=473 char=6 -pos=474 char= -pos=475 char=T -pos=476 char=H -pos=477 char=E -pos=478 char=N -pos=480 char= -pos=481 char= -pos=482 char= -pos=483 char= -pos=484 char= -pos=485 char= -pos=486 char= -pos=487 char= -pos=488 char= +pos=469 char=O +pos=470 char=u +pos=471 char=t +pos=472 char=. +pos=473 char=S +pos=474 char=t +pos=475 char=r +pos=476 char=i +pos=477 char=n +pos=478 char=g +pos=479 char=( +pos=480 char=" +pos=481 char=2 +pos=482 char=1 +pos=483 char=9 +pos=484 char=0 +pos=485 char=6 +pos=486 char=" +pos=487 char=) +pos=488 char=; pos=489 char= pos=490 char=O pos=491 char=u pos=492 char=t pos=493 char=. -pos=494 char=S -pos=495 char=t -pos=496 char=r -pos=497 char=i -pos=498 char=n -pos=499 char=g -pos=500 char=( -pos=501 char=" -pos=502 char=2 -pos=503 char=1 -pos=504 char=9 -pos=505 char=0 -pos=506 char=6 -pos=507 char=" -pos=508 char=) -pos=509 char=; -pos=510 char= -pos=511 char=O -pos=512 char=u -pos=513 char=t -pos=514 char=. -pos=515 char=L -pos=516 char=n -pos=517 char=; -pos=519 char= -pos=520 char= -pos=521 char= -pos=522 char= -pos=523 char= -pos=524 char= -pos=525 char= -pos=526 char= -pos=527 char= -pos=528 char= -pos=529 char=( -pos=530 char=* -pos=531 char=P -pos=532 char=l -pos=533 char=a -pos=534 char=t -pos=535 char=f -pos=536 char=o -pos=537 char=r -pos=538 char=m -pos=539 char=. -pos=540 char=D -pos=541 char=e -pos=542 char=l -pos=543 char=a -pos=544 char=y -pos=545 char=( -pos=546 char=1 -pos=547 char=0 -pos=548 char=0 -pos=549 char=0 -pos=550 char=0 -pos=551 char=) -pos=552 char=; -pos=553 char=* -pos=554 char=) -pos=556 char= -pos=557 char= -pos=558 char= -pos=559 char= -pos=560 char= -pos=561 char= -pos=562 char= -pos=563 char= -pos=564 char=E -pos=565 char=N -pos=566 char=D -pos=567 char=; -pos=569 char= -pos=570 char= -pos=571 char= -pos=572 char= -pos=573 char= -pos=574 char=E -pos=575 char=N -pos=576 char=D -pos=577 char=; -pos=579 char= -pos=580 char= -pos=581 char= -pos=582 char=E -pos=583 char=N -pos=584 char=D -pos=586 char= -pos=587 char=E -pos=588 char=N -pos=589 char=D -pos=590 char= -pos=591 char=i -pos=592 char=s -pos=593 char=p -pos=594 char=t -pos=595 char=e -pos=596 char=s -pos=597 char=t -pos=598 char=. -pos=599 char= +pos=494 char=L +pos=495 char=n +pos=496 char=; +pos=497 char= +pos=498 char= +pos=499 char= +pos=500 char= +pos=501 char= +pos=502 char= +pos=503 char= +pos=504 char= +pos=505 char= +pos=506 char= +pos=507 char=( +pos=508 char=* +pos=509 char=P +pos=510 char=l +pos=511 char=a +pos=512 char=t +pos=513 char=f +pos=514 char=o +pos=515 char=r +pos=516 char=m +pos=517 char=. +pos=518 char=D +pos=519 char=e +pos=520 char=l +pos=521 char=a +pos=522 char=y +pos=523 char=( +pos=524 char=1 +pos=525 char=0 +pos=526 char=0 +pos=527 char=0 +pos=528 char=0 +pos=529 char=) +pos=530 char=; +pos=531 char=* +pos=532 char=) +pos=533 char= +pos=534 char= +pos=535 char= +pos=536 char= +pos=537 char= +pos=538 char= +pos=539 char= +pos=540 char= +pos=541 char=E +pos=542 char=N +pos=543 char=D +pos=544 char=; +pos=545 char= +pos=546 char= +pos=547 char= +pos=548 char= +pos=549 char= +pos=550 char=E +pos=551 char=N +pos=552 char=D +pos=553 char=; +pos=554 char= +pos=555 char= +pos=556 char= +pos=557 char=E +pos=558 char=N +pos=559 char=D +pos=560 char= +pos=561 char=E +pos=562 char=N +pos=563 char=D +pos=564 char= +pos=565 char=i +pos=566 char=s +pos=567 char=p +pos=568 char=t +pos=569 char=e +pos=570 char=s +pos=571 char=t +pos=572 char=. +pos=573 char= From d906629d2aa635639b8a4d80aab83221dc1412a6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 12:21:34 +0100 Subject: [PATCH 097/140] Close old symbol file before reopening it to rewrite it. --- src/compiler/OPM.Mod | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 1ecaa7e0..68215490 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -614,6 +614,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END SymRLReal; PROCEDURE CloseOldSym*; + BEGIN Files.Close(Files.Base(oldSF)) END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); From cf49ec30b94ac529e923ada9558765dcd391adb9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 18:13:42 +0100 Subject: [PATCH 098/140] Restore use of alloca for string value copies. mingw build fixes. Support Linux subsystem for Windows. --- bootstrap/SYSTEM.h | 34 +- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 3 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 3 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 3 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 3 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 30 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 3 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 30 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/runtime/Platformwindows.Mod | 28 +- src/runtime/SYSTEM.h | 17 +- src/test/confidence/arrayassignment/test.sh | 1 + src/test/confidence/isptest/expected | 564 ++++++++++---------- src/test/confidence/isptest/isptest.mod | 4 +- src/test/confidence/language/test.sh | 1 + src/test/confidence/library/test.sh | 1 + src/test/confidence/math/test.sh | 1 + src/test/confidence/out/test.sh | 3 +- src/test/confidence/signal/test.sh | 1 + src/test/confidence/testenv.sh | 2 +- src/test/confidence/texts/test.sh | 1 + 208 files changed, 575 insertions(+), 544 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 7cba936e..165b5ec8 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -5,31 +5,14 @@ // 64 bit system detection #if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 + #define o__64 #endif -// // Temporary while bootstrapping and clearing up SYSTEM.c. -// -// #ifndef LONGINT -// #if defined (__o_64) -// #define INTEGER int32 -// #define LONGINT int64 -// #define SET uint64 -// #else -// #define INTEGER int16 -// #define LONGINT int32 -// #define SET uint32 -// #endif -// #endif - - - - // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if defined (__o_64) +#if defined (o__64) #if defined(_WIN64) typedef unsigned long long size_t; #else @@ -43,11 +26,12 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +void *alloca(size_t size); // Declare fixed size versions of basic intger types -#if defined (__o_64) && !defined(_WIN64) +#if defined (o__64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; @@ -95,7 +79,7 @@ typedef void* SYSTEM_PTR; // 'address' is a synonym for an int of pointer size -#if defined (__o_64) +#if defined (o__64) #define address int64 #else #define address int32 @@ -171,9 +155,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) + +//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +//#define __DEL(x) Platform_OSFree((address)x) + +#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) +#define __DEL(x) /* SYSTEM ops */ diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 698bdfec..e0fc2e86 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 54424759..8f575f62 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d9550e62..5b0f725b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index e79917c0..aa55dd0d 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6354f985..18456e59 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index dd64a7d3..ed55dfca 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 15b00c61..be04a384 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 698bdfec..e0fc2e86 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 54424759..8f575f62 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3d9f63cf..2a8e00ab 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index e79917c0..aa55dd0d 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6354f985..18456e59 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index dd394ddd..6676d700 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 67f5b23d..891c877a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index dcaa4d84..c2373ac4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 5e3c733a..06ca3f58 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index cffc17c7..0da695a9 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 6eb9ef88..b0c90472 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 6c0e3e92..9f7407f0 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 0401d1b4..47d8fab3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index d762e2d9..0325d7f2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 25bc240a..fe2c4bd5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ee5b452f..64c3f578 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 66922bc1..67a6c27b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index bc57967b..5c2fada7 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 20722ed5..4ed02d04 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 9a5a9fdd..3271c367 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index e86531bf..1d663861 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 98acafdf..3a0ce191 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index eb54b165..10b85a66 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 20373a54..37062b0b 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index fe843fd2..1a319646 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index c47b83d3..45b91f7f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9fbbbc49..d0b09b3d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index dad7e185..90f35dd5 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3d9f63cf..2a8e00ab 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 3b2e9f4d..5b51ba36 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 4c16f06a..3d2d0c84 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 43a3fe2d..22e39c16 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -130,28 +130,28 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow #define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 0c6f1ba4..bf14c58e 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index dd394ddd..6676d700 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 67f5b23d..891c877a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 965cd082..759e721b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index da05f57a..95ddb569 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 97ccb9b4..f6a548e4 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 1f8984a1..8d8ec59f 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index f233377b..2e014659 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index cffc17c7..0da695a9 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 6eb9ef88..b0c90472 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6c0e3e92..9f7407f0 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index b6fd8dd7..a7b62fe3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 42ccafe2..038bd92c 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 639b8015..22742961 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 5eb839d6..20c369e9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c0d35b19..c09a1524 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 0401d1b4..47d8fab3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -774,6 +774,7 @@ void OPM_SymRLReal (LONGREAL *lr) void OPM_CloseOldSym (void) { + Files_Close(Files_Base(&OPM_oldSF, Files_Rider__typ)); } void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 39474670..be9e98bd 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index d762e2d9..0325d7f2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 287514a0..de0e599a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index e76fa4d6..b3c52f3c 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 42cecab6..a452da84 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 25bc240a..fe2c4bd5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9cfc72df..38cd17c7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ee5b452f..64c3f578 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 626e9505..2fa9186d 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 4c16f06a..3d2d0c84 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 0d5df379..fbaed75f 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a802c149..845872c3 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 @@ -130,28 +130,28 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow #define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li @@ -161,13 +161,13 @@ extern void Heap_InitHeap(); #define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +182,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index d09c4a89..809c60fc 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 291703b5..87ddfb2a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 7e26560f..664fe2ec 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b6b9725d..5bbe808d 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 0298718d..24f35c02 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 9a5a9fdd..3271c367 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index e86531bf..1d663861 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 31069c13..c3a9491f 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index a82dbdb6..ee0408bb 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index d4bc8b00..cce1644f 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 7d7ab568..9d34f721 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 4ad21fe0..d2dcce53 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT int8 #define INTEGER int16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index cc3b21ef..2e262037 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 349fac4f..65c97d24 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((address)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((address)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(address)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -594,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 8ded6b23..165b5ec8 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -5,14 +5,14 @@ // 64 bit system detection #if (__SIZEOF_POINTER__ == 8) || defined (_LP64) || defined(__LP64__) || defined(_WIN64) - #define __o_64 + #define o__64 #endif // Declare memcpy in a way compatible with C compilers intrinsic // built in implementations. -#if defined (__o_64) +#if defined (o__64) #if defined(_WIN64) typedef unsigned long long size_t; #else @@ -26,11 +26,12 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +void *alloca(size_t size); // Declare fixed size versions of basic intger types -#if defined (__o_64) && !defined(_WIN64) +#if defined (o__64) && !defined(_WIN64) // LP64 typedef long int64; typedef unsigned long uint64; @@ -78,7 +79,7 @@ typedef void* SYSTEM_PTR; // 'address' is a synonym for an int of pointer size -#if defined (__o_64) +#if defined (o__64) #define address int64 #else #define address int32 @@ -154,9 +155,13 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((address)x) + +//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +//#define __DEL(x) Platform_OSFree((address)x) + +#define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) +#define __DEL(x) /* SYSTEM ops */ diff --git a/src/test/confidence/arrayassignment/test.sh b/src/test/confidence/arrayassignment/test.sh index 115040ef..c4fd00f5 100755 --- a/src/test/confidence/arrayassignment/test.sh +++ b/src/test/confidence/arrayassignment/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f aa # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP aa.mod -m ./aa >result . ../testresult.sh diff --git a/src/test/confidence/isptest/expected b/src/test/confidence/isptest/expected index 4ce25153..b5af3090 100644 --- a/src/test/confidence/isptest/expected +++ b/src/test/confidence/isptest/expected @@ -428,149 +428,163 @@ pos=427 char=O pos=428 char=u pos=429 char=t pos=430 char=. -pos=431 char=L -pos=432 char=n -pos=433 char=; -pos=434 char= -pos=435 char= -pos=436 char= -pos=437 char= -pos=438 char= -pos=439 char= -pos=440 char= -pos=441 char= -pos=442 char=I -pos=443 char=F +pos=431 char=C +pos=432 char=h +pos=433 char=a +pos=434 char=r +pos=435 char=( +pos=436 char=0 +pos=437 char=A +pos=438 char=X +pos=439 char=) +pos=440 char=; +pos=441 char= +pos=442 char= +pos=443 char= pos=444 char= -pos=445 char=i +pos=445 char= pos=446 char= -pos=447 char== +pos=447 char= pos=448 char= -pos=449 char=2 -pos=450 char=1 -pos=451 char=9 -pos=452 char=0 -pos=453 char=6 -pos=454 char= -pos=455 char=T -pos=456 char=H -pos=457 char=E -pos=458 char=N -pos=459 char= -pos=460 char= +pos=449 char=I +pos=450 char=F +pos=451 char= +pos=452 char=i +pos=453 char= +pos=454 char== +pos=455 char= +pos=456 char=2 +pos=457 char=1 +pos=458 char=9 +pos=459 char=0 +pos=460 char=6 pos=461 char= -pos=462 char= -pos=463 char= -pos=464 char= -pos=465 char= -pos=466 char= +pos=462 char=T +pos=463 char=H +pos=464 char=E +pos=465 char=N +pos=466 char= pos=467 char= pos=468 char= -pos=469 char=O -pos=470 char=u -pos=471 char=t -pos=472 char=. -pos=473 char=S -pos=474 char=t -pos=475 char=r -pos=476 char=i -pos=477 char=n -pos=478 char=g -pos=479 char=( -pos=480 char=" -pos=481 char=2 -pos=482 char=1 -pos=483 char=9 -pos=484 char=0 -pos=485 char=6 -pos=486 char=" -pos=487 char=) -pos=488 char=; -pos=489 char= -pos=490 char=O -pos=491 char=u -pos=492 char=t -pos=493 char=. -pos=494 char=L -pos=495 char=n -pos=496 char=; -pos=497 char= -pos=498 char= -pos=499 char= -pos=500 char= -pos=501 char= -pos=502 char= -pos=503 char= -pos=504 char= -pos=505 char= -pos=506 char= -pos=507 char=( -pos=508 char=* -pos=509 char=P -pos=510 char=l -pos=511 char=a -pos=512 char=t -pos=513 char=f -pos=514 char=o -pos=515 char=r -pos=516 char=m -pos=517 char=. -pos=518 char=D -pos=519 char=e -pos=520 char=l -pos=521 char=a -pos=522 char=y -pos=523 char=( -pos=524 char=1 -pos=525 char=0 -pos=526 char=0 -pos=527 char=0 -pos=528 char=0 -pos=529 char=) -pos=530 char=; -pos=531 char=* -pos=532 char=) -pos=533 char= -pos=534 char= -pos=535 char= -pos=536 char= -pos=537 char= -pos=538 char= -pos=539 char= -pos=540 char= -pos=541 char=E -pos=542 char=N -pos=543 char=D +pos=469 char= +pos=470 char= +pos=471 char= +pos=472 char= +pos=473 char= +pos=474 char= +pos=475 char= +pos=476 char=O +pos=477 char=u +pos=478 char=t +pos=479 char=. +pos=480 char=S +pos=481 char=t +pos=482 char=r +pos=483 char=i +pos=484 char=n +pos=485 char=g +pos=486 char=( +pos=487 char=" +pos=488 char=2 +pos=489 char=1 +pos=490 char=9 +pos=491 char=0 +pos=492 char=6 +pos=493 char=" +pos=494 char=) +pos=495 char=; +pos=496 char= +pos=497 char=O +pos=498 char=u +pos=499 char=t +pos=500 char=. +pos=501 char=C +pos=502 char=h +pos=503 char=a +pos=504 char=r +pos=505 char=( +pos=506 char=0 +pos=507 char=A +pos=508 char=X +pos=509 char=) +pos=510 char=; +pos=511 char= +pos=512 char= +pos=513 char= +pos=514 char= +pos=515 char= +pos=516 char= +pos=517 char= +pos=518 char= +pos=519 char= +pos=520 char= +pos=521 char=( +pos=522 char=* +pos=523 char=P +pos=524 char=l +pos=525 char=a +pos=526 char=t +pos=527 char=f +pos=528 char=o +pos=529 char=r +pos=530 char=m +pos=531 char=. +pos=532 char=D +pos=533 char=e +pos=534 char=l +pos=535 char=a +pos=536 char=y +pos=537 char=( +pos=538 char=1 +pos=539 char=0 +pos=540 char=0 +pos=541 char=0 +pos=542 char=0 +pos=543 char=) pos=544 char=; -pos=545 char= -pos=546 char= -pos=547 char= +pos=545 char=* +pos=546 char=) +pos=547 char= pos=548 char= pos=549 char= -pos=550 char=E -pos=551 char=N -pos=552 char=D -pos=553 char=; -pos=554 char= -pos=555 char= -pos=556 char= -pos=557 char=E -pos=558 char=N -pos=559 char=D -pos=560 char= -pos=561 char=E -pos=562 char=N -pos=563 char=D -pos=564 char= -pos=565 char=i -pos=566 char=s -pos=567 char=p -pos=568 char=t -pos=569 char=e -pos=570 char=s -pos=571 char=t -pos=572 char=. -pos=573 char= +pos=550 char= +pos=551 char= +pos=552 char= +pos=553 char= +pos=554 char= +pos=555 char=E +pos=556 char=N +pos=557 char=D +pos=558 char=; +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=568 char= +pos=569 char= +pos=570 char= +pos=571 char=E +pos=572 char=N +pos=573 char=D +pos=574 char= +pos=575 char=E +pos=576 char=N +pos=577 char=D +pos=578 char= +pos=579 char=i +pos=580 char=s +pos=581 char=p +pos=582 char=t +pos=583 char=e +pos=584 char=s +pos=585 char=t +pos=586 char=. +pos=587 char= --- Testing with Component Pascal variable model --- @@ -1003,146 +1017,160 @@ pos=427 char=O pos=428 char=u pos=429 char=t pos=430 char=. -pos=431 char=L -pos=432 char=n -pos=433 char=; -pos=434 char= -pos=435 char= -pos=436 char= -pos=437 char= -pos=438 char= -pos=439 char= -pos=440 char= -pos=441 char= -pos=442 char=I -pos=443 char=F +pos=431 char=C +pos=432 char=h +pos=433 char=a +pos=434 char=r +pos=435 char=( +pos=436 char=0 +pos=437 char=A +pos=438 char=X +pos=439 char=) +pos=440 char=; +pos=441 char= +pos=442 char= +pos=443 char= pos=444 char= -pos=445 char=i +pos=445 char= pos=446 char= -pos=447 char== +pos=447 char= pos=448 char= -pos=449 char=2 -pos=450 char=1 -pos=451 char=9 -pos=452 char=0 -pos=453 char=6 -pos=454 char= -pos=455 char=T -pos=456 char=H -pos=457 char=E -pos=458 char=N -pos=459 char= -pos=460 char= +pos=449 char=I +pos=450 char=F +pos=451 char= +pos=452 char=i +pos=453 char= +pos=454 char== +pos=455 char= +pos=456 char=2 +pos=457 char=1 +pos=458 char=9 +pos=459 char=0 +pos=460 char=6 pos=461 char= -pos=462 char= -pos=463 char= -pos=464 char= -pos=465 char= -pos=466 char= +pos=462 char=T +pos=463 char=H +pos=464 char=E +pos=465 char=N +pos=466 char= pos=467 char= pos=468 char= -pos=469 char=O -pos=470 char=u -pos=471 char=t -pos=472 char=. -pos=473 char=S -pos=474 char=t -pos=475 char=r -pos=476 char=i -pos=477 char=n -pos=478 char=g -pos=479 char=( -pos=480 char=" -pos=481 char=2 -pos=482 char=1 -pos=483 char=9 -pos=484 char=0 -pos=485 char=6 -pos=486 char=" -pos=487 char=) -pos=488 char=; -pos=489 char= -pos=490 char=O -pos=491 char=u -pos=492 char=t -pos=493 char=. -pos=494 char=L -pos=495 char=n -pos=496 char=; -pos=497 char= -pos=498 char= -pos=499 char= -pos=500 char= -pos=501 char= -pos=502 char= -pos=503 char= -pos=504 char= -pos=505 char= -pos=506 char= -pos=507 char=( -pos=508 char=* -pos=509 char=P -pos=510 char=l -pos=511 char=a -pos=512 char=t -pos=513 char=f -pos=514 char=o -pos=515 char=r -pos=516 char=m -pos=517 char=. -pos=518 char=D -pos=519 char=e -pos=520 char=l -pos=521 char=a -pos=522 char=y -pos=523 char=( -pos=524 char=1 -pos=525 char=0 -pos=526 char=0 -pos=527 char=0 -pos=528 char=0 -pos=529 char=) -pos=530 char=; -pos=531 char=* -pos=532 char=) -pos=533 char= -pos=534 char= -pos=535 char= -pos=536 char= -pos=537 char= -pos=538 char= -pos=539 char= -pos=540 char= -pos=541 char=E -pos=542 char=N -pos=543 char=D +pos=469 char= +pos=470 char= +pos=471 char= +pos=472 char= +pos=473 char= +pos=474 char= +pos=475 char= +pos=476 char=O +pos=477 char=u +pos=478 char=t +pos=479 char=. +pos=480 char=S +pos=481 char=t +pos=482 char=r +pos=483 char=i +pos=484 char=n +pos=485 char=g +pos=486 char=( +pos=487 char=" +pos=488 char=2 +pos=489 char=1 +pos=490 char=9 +pos=491 char=0 +pos=492 char=6 +pos=493 char=" +pos=494 char=) +pos=495 char=; +pos=496 char= +pos=497 char=O +pos=498 char=u +pos=499 char=t +pos=500 char=. +pos=501 char=C +pos=502 char=h +pos=503 char=a +pos=504 char=r +pos=505 char=( +pos=506 char=0 +pos=507 char=A +pos=508 char=X +pos=509 char=) +pos=510 char=; +pos=511 char= +pos=512 char= +pos=513 char= +pos=514 char= +pos=515 char= +pos=516 char= +pos=517 char= +pos=518 char= +pos=519 char= +pos=520 char= +pos=521 char=( +pos=522 char=* +pos=523 char=P +pos=524 char=l +pos=525 char=a +pos=526 char=t +pos=527 char=f +pos=528 char=o +pos=529 char=r +pos=530 char=m +pos=531 char=. +pos=532 char=D +pos=533 char=e +pos=534 char=l +pos=535 char=a +pos=536 char=y +pos=537 char=( +pos=538 char=1 +pos=539 char=0 +pos=540 char=0 +pos=541 char=0 +pos=542 char=0 +pos=543 char=) pos=544 char=; -pos=545 char= -pos=546 char= -pos=547 char= +pos=545 char=* +pos=546 char=) +pos=547 char= pos=548 char= pos=549 char= -pos=550 char=E -pos=551 char=N -pos=552 char=D -pos=553 char=; -pos=554 char= -pos=555 char= -pos=556 char= -pos=557 char=E -pos=558 char=N -pos=559 char=D -pos=560 char= -pos=561 char=E -pos=562 char=N -pos=563 char=D -pos=564 char= -pos=565 char=i -pos=566 char=s -pos=567 char=p -pos=568 char=t -pos=569 char=e -pos=570 char=s -pos=571 char=t -pos=572 char=. -pos=573 char= +pos=550 char= +pos=551 char= +pos=552 char= +pos=553 char= +pos=554 char= +pos=555 char=E +pos=556 char=N +pos=557 char=D +pos=558 char=; +pos=559 char= +pos=560 char= +pos=561 char= +pos=562 char= +pos=563 char= +pos=564 char=E +pos=565 char=N +pos=566 char=D +pos=567 char=; +pos=568 char= +pos=569 char= +pos=570 char= +pos=571 char=E +pos=572 char=N +pos=573 char=D +pos=574 char= +pos=575 char=E +pos=576 char=N +pos=577 char=D +pos=578 char= +pos=579 char=i +pos=580 char=s +pos=581 char=p +pos=582 char=t +pos=583 char=e +pos=584 char=s +pos=585 char=t +pos=586 char=. +pos=587 char= diff --git a/src/test/confidence/isptest/isptest.mod b/src/test/confidence/isptest/isptest.mod index cc6313e3..86fb0fb9 100644 --- a/src/test/confidence/isptest/isptest.mod +++ b/src/test/confidence/isptest/isptest.mod @@ -17,9 +17,9 @@ BEGIN WHILE ~R.eot DO Texts.Read(R, ch); i := Texts.Pos(R); - Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Ln; + Out.String("pos="); Out.Int(i,0); Out.String(" char="); Out.Char(ch); Out.Char(0AX); IF i = 21906 THEN - Out.String("21906"); Out.Ln; + Out.String("21906"); Out.Char(0AX); (*Platform.Delay(10000);*) END; END; diff --git a/src/test/confidence/language/test.sh b/src/test/confidence/language/test.sh index 82f3efbf..27b9f951 100755 --- a/src/test/confidence/language/test.sh +++ b/src/test/confidence/language/test.sh @@ -1,6 +1,7 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing +rm -f TestLanguage # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP TestLanguage.mod -m ./TestLanguage >result . ../testresult.sh diff --git a/src/test/confidence/library/test.sh b/src/test/confidence/library/test.sh index e59c074c..91780313 100644 --- a/src/test/confidence/library/test.sh +++ b/src/test/confidence/library/test.sh @@ -1,6 +1,7 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing +rm -f TestLibrary # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP TestLibrary.mod -m ./TestLibrary >result . ../testresult.sh diff --git a/src/test/confidence/math/test.sh b/src/test/confidence/math/test.sh index e8b5b827..c64bde88 100644 --- a/src/test/confidence/math/test.sh +++ b/src/test/confidence/math/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f mathtest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP mathtest.mod -m -OC ./mathtest >result . ../testresult.sh diff --git a/src/test/confidence/out/test.sh b/src/test/confidence/out/test.sh index 48198a64..16bf63be 100644 --- a/src/test/confidence/out/test.sh +++ b/src/test/confidence/out/test.sh @@ -1,10 +1,9 @@ #!/bin/sh . ../testenv.sh +rm -f outtest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP outtest.mod -m -O2 -#../../../../voc outtest.mod -m -O2 ./outtest >result-O2 $OBECOMP outtest.mod -m -OC -#../../../../voc outtest.mod -m -OC ./outtest >result-OC echo --- Testing with Oberon 2 variable model --- >result cat result-O2 >>result diff --git a/src/test/confidence/signal/test.sh b/src/test/confidence/signal/test.sh index fadc1879..b9131862 100755 --- a/src/test/confidence/signal/test.sh +++ b/src/test/confidence/signal/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f SignalTest # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP signal.mod -m ./SignalTest x & sleep 1 diff --git a/src/test/confidence/testenv.sh b/src/test/confidence/testenv.sh index d61ba439..de1630fa 100755 --- a/src/test/confidence/testenv.sh +++ b/src/test/confidence/testenv.sh @@ -11,7 +11,7 @@ fi # Set ibrary paths for darwin and termux(android) export DYLD_LIBRARY_PATH=$1/lib:$DYLD_LIBRARY_PATH export LD_LIBRARY_PATH=$1/lib:$LD_LIBRARY_PATH -rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm +rm -f *.o *.obj *.exe *.sym *.c *.h result new.asm $(basename $PWD) # Under gcc generate assembly source for source change test. # NOTE: The following CFLAGS causes the assembler to write source diff --git a/src/test/confidence/texts/test.sh b/src/test/confidence/texts/test.sh index 6a798eee..d84c0df4 100644 --- a/src/test/confidence/texts/test.sh +++ b/src/test/confidence/texts/test.sh @@ -1,5 +1,6 @@ #!/bin/sh . ../testenv.sh +rm -f testTexts # Remove LSW binary so it doesn't hide Cygwin binary. $OBECOMP testTexts.mod -m ./testTexts >result . ../testresult.sh From 126ef6d479904653d15fe634831952a29371f9c5 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 19:06:08 +0100 Subject: [PATCH 099/140] Remove o_result variable obsoleted by restoration of alloca usage. --- src/compiler/OPC.Mod | 16 +++------------- src/compiler/OPM.Mod | 4 ++-- src/compiler/OPV.Mod | 12 ++++-------- src/runtime/SYSTEM.h | 5 ----- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 72e13291..d30cb712 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -478,11 +478,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END DefineType; PROCEDURE Prefixed(x: OPT.ConstExt; y: ARRAY OF CHAR): BOOLEAN; - VAR i: INTEGER; r: BOOLEAN; + VAR i: INTEGER; BEGIN i := 0; - WHILE x[i+1] = y[i] DO INC(i) END ; - r := y[i] = 0X; - RETURN r; + WHILE x[i+1] = y[i] DO INC(i) END; + RETURN y[i] = 0X; END Prefixed; PROCEDURE CProcDefs(obj: OPT.Object; vis: INTEGER); @@ -957,15 +956,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF proc^.vis # OPT.external THEN OPM.WriteString('static ') END ; ProcHeader(proc, TRUE); BegBlk; - - (* If there will be a result, provide a result variable. *) - IF proc^.typ # OPT.notyp THEN - BegStat; - Ident(proc^.typ^.strobj); - OPM.WriteString(" _o_result;"); - OPM.WriteLn; - END; - scope := proc^.scope; IdentList(scope^.scope, 0); IF ~scope^.leaf THEN (* declare intermediate procedure scope record variable*) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 68215490..e17c4614 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -236,14 +236,14 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) IF Platform.ArgCount = 1 THEN LogWLn; LogWStr("Oberon-2 compiler v"); LogWStr(Configuration.versionLong); LogW("."); LogWLn; - LogWStr("Based on Ofront by Software Templ OEG."); LogWLn; + LogWStr("Based on Ofront by J. Templ and Software Templ OEG."); LogWLn; LogWStr("Further development by Norayr Chilingarian, David Brown and others."); LogWLn; LogWLn; LogWStr("Usage:"); LogWLn; LogWLn; LogWStr(" "); LogWStr(Configuration.name); LogWStr(" options {files {options}}."); LogWLn; LogWLn; - LogWStr('Where options = ["-" {option} ].'); LogWLn; + LogWStr('Options:'); LogWLn; LogWLn; LogWStr(" Run time safety"); LogWLn; LogWStr(" -p Initialise pointers to NIL. On by default."); LogWLn; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index dd089baf..83c451c3 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -876,19 +876,15 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 | OPT.Nreturn: IF OPM.level = 0 THEN IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END ELSE + OPC.ExitProc(outerProc, FALSE, FALSE); + OPM.WriteString("return"); IF n^.left # NIL THEN - (* Make local copy of result before ExitProc deletes dynamic vars *) - OPM.WriteString("_o_result = "); + OPM.Write(Blank); IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN OPM.WriteString("(void*)"); expr(n^.left, 10) ELSE expr(n^.left, MinPrec) - END; - OPM.WriteString(";"); OPM.WriteLn; OPC.BegStat; - OPC.ExitProc(outerProc, FALSE, FALSE); - OPM.WriteString("return _o_result"); - ELSE - OPM.WriteString("return"); + END END END | OPT.Nwith: IfStat(n, n^.subcl = 0, outerProc) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 165b5ec8..cb7c8815 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) - -//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -//#define __DEL(x) Platform_OSFree((address)x) - #define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) #define __DEL(x) @@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) - #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x From 6a4748e2af674b8103dc6250a0b25e2ebe31d62d Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 20:06:30 +0100 Subject: [PATCH 100/140] Update bootstrap and fix source change tests. Typo in command ine help. --- bootstrap/SYSTEM.h | 5 - bootstrap/unix-44/Files.c | 46 +++----- bootstrap/unix-44/Heap.c | 22 +--- bootstrap/unix-44/Modules.c | 11 +- bootstrap/unix-44/OPB.c | 63 +++-------- bootstrap/unix-44/OPC.c | 41 ++----- bootstrap/unix-44/OPM.c | 41 ++----- bootstrap/unix-44/OPP.c | 4 +- bootstrap/unix-44/OPS.c | 15 +-- bootstrap/unix-44/OPT.c | 99 +++++------------ bootstrap/unix-44/OPV.c | 99 ++++++----------- bootstrap/unix-44/Out.c | 8 +- bootstrap/unix-44/Platform.c | 176 ++++++++---------------------- bootstrap/unix-44/Reals.c | 23 +--- bootstrap/unix-44/Strings.c | 39 +++---- bootstrap/unix-44/Texts.c | 24 +--- bootstrap/unix-48/Files.c | 46 +++----- bootstrap/unix-48/Heap.c | 22 +--- bootstrap/unix-48/Modules.c | 11 +- bootstrap/unix-48/OPB.c | 63 +++-------- bootstrap/unix-48/OPC.c | 41 ++----- bootstrap/unix-48/OPM.c | 41 ++----- bootstrap/unix-48/OPP.c | 4 +- bootstrap/unix-48/OPS.c | 15 +-- bootstrap/unix-48/OPT.c | 99 +++++------------ bootstrap/unix-48/OPV.c | 99 ++++++----------- bootstrap/unix-48/Out.c | 8 +- bootstrap/unix-48/Platform.c | 176 ++++++++---------------------- bootstrap/unix-48/Reals.c | 23 +--- bootstrap/unix-48/Strings.c | 39 +++---- bootstrap/unix-48/Texts.c | 24 +--- bootstrap/unix-88/Files.c | 46 +++----- bootstrap/unix-88/Heap.c | 22 +--- bootstrap/unix-88/Modules.c | 11 +- bootstrap/unix-88/OPB.c | 63 +++-------- bootstrap/unix-88/OPC.c | 41 ++----- bootstrap/unix-88/OPM.c | 41 ++----- bootstrap/unix-88/OPP.c | 4 +- bootstrap/unix-88/OPS.c | 15 +-- bootstrap/unix-88/OPT.c | 99 +++++------------ bootstrap/unix-88/OPV.c | 99 ++++++----------- bootstrap/unix-88/Out.c | 8 +- bootstrap/unix-88/Platform.c | 176 ++++++++---------------------- bootstrap/unix-88/Reals.c | 23 +--- bootstrap/unix-88/Strings.c | 39 +++---- bootstrap/unix-88/Texts.c | 24 +--- bootstrap/windows-48/Files.c | 46 +++----- bootstrap/windows-48/Heap.c | 22 +--- bootstrap/windows-48/Modules.c | 11 +- bootstrap/windows-48/OPB.c | 63 +++-------- bootstrap/windows-48/OPC.c | 41 ++----- bootstrap/windows-48/OPM.c | 41 ++----- bootstrap/windows-48/OPP.c | 4 +- bootstrap/windows-48/OPS.c | 15 +-- bootstrap/windows-48/OPT.c | 99 +++++------------ bootstrap/windows-48/OPV.c | 99 ++++++----------- bootstrap/windows-48/Out.c | 8 +- bootstrap/windows-48/Platform.c | 188 +++++++++----------------------- bootstrap/windows-48/Reals.c | 23 +--- bootstrap/windows-48/Strings.c | 39 +++---- bootstrap/windows-48/Texts.c | 24 +--- bootstrap/windows-88/Files.c | 46 +++----- bootstrap/windows-88/Heap.c | 22 +--- bootstrap/windows-88/Modules.c | 11 +- bootstrap/windows-88/OPB.c | 63 +++-------- bootstrap/windows-88/OPC.c | 41 ++----- bootstrap/windows-88/OPM.c | 41 ++----- bootstrap/windows-88/OPP.c | 4 +- bootstrap/windows-88/OPS.c | 15 +-- bootstrap/windows-88/OPT.c | 99 +++++------------ bootstrap/windows-88/OPV.c | 99 ++++++----------- bootstrap/windows-88/Out.c | 8 +- bootstrap/windows-88/Platform.c | 188 +++++++++----------------------- bootstrap/windows-88/Reals.c | 23 +--- bootstrap/windows-88/Strings.c | 39 +++---- bootstrap/windows-88/Texts.c | 24 +--- src/compiler/OPM.Mod | 2 +- src/tools/make/sourcechanges.sh | 4 +- 78 files changed, 1026 insertions(+), 2564 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 165b5ec8..cb7c8815 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -156,10 +156,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) - -//#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) -//#define __DEL(x) Platform_OSFree((address)x) - #define __DUP(x, l, t) x=(void*)memcpy(alloca(l*sizeof(t)),x,l*sizeof(t)) #define __DEL(x) @@ -168,7 +164,6 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) - #define __GET(a, x, t) x=*(t*)(address)(a) #define __PUT(a, x, t) *(t*)(address)(a)=x diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index e0fc2e86..ddeec08e 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 5b0f725b..abf8a8f1 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index aa55dd0d..5c021003 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; int32 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index ed55dfca..02d87d28 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index e0fc2e86..ddeec08e 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 2a8e00ab..f55e7e01 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index aa55dd0d..5c021003 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; int32 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 6676d700..961ebbe7 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index c2373ac4..686dbfbf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 0da695a9..5117800b 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 64); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int64 Heap_NewChunk (int64 blksz) { - int64 _o_result; int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { @@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz) Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int64 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz) SYSTEM_PTR Heap_NEWREC (int64 tag) { - SYSTEM_PTR _o_result; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 8, t, int64); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 8); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (int64 size) { - SYSTEM_PTR _o_result; int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size) __PUT(tag + 8, -8, int64); __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int64 q) diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 9f7407f0..97e17ad2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 47d8fab3..5b67d672 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 8; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 0325d7f2..615109df 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index fe2c4bd5..48352c94 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 64c3f578..c7a907db 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 67a6c27b..0f0b9f79 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 5c2fada7..22ecf90b 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -174,65 +174,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EMFILE() || e == Platform_ENFILE(); - return _o_result; + return e == Platform_EMFILE() || e == Platform_ENFILE(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EXDEV(); - return _o_result; + return e == Platform_EXDEV(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); - return _o_result; + return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ENOENT(); - return _o_result; + return e == Platform_ENOENT(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int64 Platform_OSAllocate (int64 size) { - int64 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int64 address) @@ -253,16 +235,14 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; Platform_EnvPtr p = NIL; __DUP(var, var__len, CHAR); p = Platform_getenv(var, var__len); if (p != NIL) { __COPY(*p, val, val__len); } - _o_result = p != NIL; __DEL(var); - return _o_result; + return p != NIL; } void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) @@ -311,7 +291,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -321,9 +300,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetInterruptHandler (Platform_SignalHandler handler) @@ -363,12 +341,10 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int32 Platform_Time (void) { - int32 _o_result; int32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -381,126 +357,100 @@ void Platform_Delay (int32 ms) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; __DUP(cmd, cmd__len, CHAR); - _o_result = Platform_system(cmd, cmd__len); __DEL(cmd); - return _o_result; + return Platform_system(cmd, cmd__len); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closefile(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; __DUP(n, n__len, CHAR); Platform_structstats(); if (Platform_stat(n, n__len) < 0) { - _o_result = Platform_err(); __DEL(n); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_statdev(); (*identity).index = Platform_statino(); (*identity).mtime = Platform_statmtime(); - _o_result = 0; __DEL(n); - return _o_result; + return 0; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.index == i2.index && i1.volume == i2.volume); - return _o_result; + return (i1.index == i2.index && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = i1.mtime == i2.mtime; - return _o_result; + return i1.mtime == i2.mtime; } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -516,137 +466,107 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_structstats(); if (Platform_fstat(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_statsize(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, p, l); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int64 p, int32 l) { - int16 _o_result; int64 written; written = Platform_writefile(h, p, l); if (written < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_fsync(h) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 offset, int16 whence) { - int16 _o_result; if (Platform_lseek(h, offset, whence) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 l) { - int16 _o_result; if (Platform_ftruncate(h, l) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_unlink(n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { - _o_result = 0; - return _o_result; + return 0; } else { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } __RETCHK; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_rename(o, o__len, n, n__len) < 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3271c367..e84157d1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 3a0ce191..acf98586 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 37062b0b..4bc74170 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 48); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int32 Heap_NewChunk (int32 blksz) { - int32 _o_result; int32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { @@ -184,8 +181,7 @@ static int32 Heap_NewChunk (int32 blksz) Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int32 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int32 blksz) SYSTEM_PTR Heap_NEWREC (int32 tag) { - SYSTEM_PTR _o_result; int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 4, t, int32); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 4); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (int32 size) { - SYSTEM_PTR _o_result; int32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int32 size) __PUT(tag + 4, -4, int32); __PUT((int32)(address)new - 4, tag, int32); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int32 q) diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 45b91f7f..bb6774da 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index d0b09b3d..458de3f2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 4; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 90f35dd5..5e181cb9 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 2a8e00ab..f55e7e01 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, 256); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 5b51ba36..787ce143 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 3d2d0c84..6098e568 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 22e39c16..39e59543 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -186,65 +186,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORTOOMANYOPENFILES(); - return _o_result; + return e == Platform_ERRORTOOMANYOPENFILES(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORNOTSAMEDEVICE(); - return _o_result; + return e == Platform_ERRORNOTSAMEDEVICE(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); - return _o_result; + return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int32 Platform_OSAllocate (int32 size) { - int32 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int32 address) @@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; CHAR buf[4096]; int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); - _o_result = 1; __DEL(var); - return _o_result; + return 1; } else { - _o_result = 0; __DEL(var); - return _o_result; + return 0; } __RETCHK; } @@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d) int32 Platform_Time (void) { - int32 _o_result; int32 ms; ms = Platform_GetTickCount(); - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; @@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) } Platform_cleanupProcess(); } - _o_result = __ASHL(result, 8); __DEL(cmd); - return _o_result; + return __ASHL(result, 8); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closeHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_bhfiVsn(); (*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexlow = Platform_bhfiIndexLow(); (*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimelow = Platform_bhfiMtimeLow(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; int32 h; int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { - _o_result = e; __DEL(n); - return _o_result; + return e; } e = Platform_Identify(h, &*identity, identity__typ); i = Platform_Close(h); - _o_result = e; __DEL(n); - return _o_result; + return e; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); - return _o_result; + return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); - return _o_result; + return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_liLongint(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int32 p, int32 l) { - int16 _o_result; if (Platform_writefile(h, p, l) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 o, int16 r) { - int16 _o_result; int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 limit) { - int16 _o_result; int16 rc; int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } if (Platform_setEndOfFile(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_getCurrentDirectory((void*)Platform_CWD, 4096); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 6676d700..961ebbe7 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8d8ec59f..9b1abaed 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -317,14 +317,11 @@ void Files_Close (Files_File f) int32 Files_Length (Files_File f) { - int32 _o_result; - _o_result = f->len; - return _o_result; + return f->len; } Files_File Files_New (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; __DUP(name, name__len, CHAR); __NEW(f, Files_FileDesc); @@ -335,9 +332,8 @@ Files_File Files_New (CHAR *name, LONGINT name__len) f->len = 0; f->pos = 0; f->swapper = -1; - _o_result = f; __DEL(name); - return _o_result; + return f; } static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) @@ -385,7 +381,6 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - BOOLEAN _o_result; int16 i; CHAR ch; i = 0; @@ -394,13 +389,11 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) i += 1; ch = name[i]; } - _o_result = ch == '/'; - return _o_result; + return ch == '/'; } static Files_File Files_CacheEntry (Platform_FileIdentity identity) { - Files_File _o_result; Files_File f = NIL; int16 i, error; f = Files_files; @@ -419,18 +412,15 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) f->identity = identity; error = Platform_Size(f->fd, &f->len); } - _o_result = f; - return _o_result; + return f; } f = f->next; } - _o_result = NIL; - return _o_result; + return NIL; } Files_File Files_Old (CHAR *name, LONGINT name__len) { - Files_File _o_result; Files_File f = NIL; int32 fd; int16 pos; @@ -470,9 +460,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) error = Platform_Identify(fd, &identity, Platform_FileIdentity__typ); f = Files_CacheEntry(identity); if (f != NIL) { - _o_result = f; __DEL(name); - return _o_result; + return f; } else { __NEW(f, Files_FileDesc); Heap_RegisterFinalizer((void*)f, Files_Finalize); @@ -488,23 +477,20 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) f->next = Files_files; Files_files = f; Heap_FileCount += 1; - _o_result = f; __DEL(name); - return _o_result; + return f; } } else if (dir[0] == 0x00) { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } else { Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256); Files_ScanPath(&pos, (void*)dir, 256); } } } else { - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } @@ -544,9 +530,7 @@ void Files_GetDate (Files_File f, int32 *t, int32 *d) int32 Files_Pos (Files_Rider *r, address *r__typ) { - int32 _o_result; - _o_result = (*r).org + (*r).offset; - return _o_result; + return (*r).org + (*r).offset; } void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) @@ -673,9 +657,7 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x Files_File Files_Base (Files_Rider *r, address *r__typ) { - Files_File _o_result; - _o_result = (*r).buf->f; - return _o_result; + return (*r).buf->f; } void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) @@ -759,17 +741,23 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int error = Platform_Rename((void*)old, old__len, (void*)new, new__len); if (!Platform_DifferentFilesystems(error)) { *res = error; + __DEL(old); + __DEL(new); return; } else { error = Platform_OldRO((void*)old, old__len, &fdold); if (error != 0) { *res = 2; + __DEL(old); + __DEL(new); return; } error = Platform_New((void*)new, new__len, &fdnew); if (error != 0) { error = Platform_Close(fdold); *res = 3; + __DEL(old); + __DEL(new); return; } error = Platform_Read(fdold, (address)buf, 4096, &n); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 0da695a9..5117800b 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -127,7 +127,6 @@ void Heap_Unlock (void) SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) { - SYSTEM_PTR _o_result; Heap_Module m; if (__STRCMP(name, "Heap") == 0) { __SYSNEW(m, 64); @@ -141,8 +140,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) m->enumPtrs = enumPtrs; m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; - _o_result = (void*)m; - return _o_result; + return (void*)m; } void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) @@ -172,7 +170,6 @@ void Heap_INCREF (Heap_Module m) static int64 Heap_NewChunk (int64 blksz) { - int64 _o_result; int64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { @@ -184,8 +181,7 @@ static int64 Heap_NewChunk (int64 blksz) Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } - _o_result = chnk; - return _o_result; + return chnk; } static void Heap_ExtendHeap (int64 blksz) @@ -219,7 +215,6 @@ static void Heap_ExtendHeap (int64 blksz) SYSTEM_PTR Heap_NEWREC (int64 tag) { - SYSTEM_PTR _o_result; int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); @@ -267,12 +262,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) new = Heap_NEWREC(tag); } Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } else { Heap_Unlock(); - _o_result = NIL; - return _o_result; + return NIL; } } __GET(adr + 8, t, int64); @@ -320,13 +313,11 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(address)(adr + 8); - return _o_result; + return (SYSTEM_PTR)(address)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (int64 size) { - SYSTEM_PTR _o_result; int64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); @@ -338,8 +329,7 @@ SYSTEM_PTR Heap_NEWBLK (int64 size) __PUT(tag + 8, -8, int64); __PUT((int64)(address)new - 8, tag, int64); Heap_Unlock(); - _o_result = new; - return _o_result; + return new; } static void Heap_Mark (int64 q) diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 9f7407f0..97e17ad2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -74,7 +74,6 @@ static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) { - Modules_Module _o_result; Modules_Module m = NIL; CHAR bodyname[64]; Modules_Command body; @@ -93,14 +92,12 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len) Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); } - _o_result = m; __DEL(name); - return _o_result; + return m; } Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len) { - Modules_Command _o_result; Modules_Cmd c = NIL; __DUP(name, name__len, CHAR); c = mod->cmds; @@ -110,9 +107,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam if (c != NIL) { Modules_res = 0; Modules_resMsg[0] = 0x00; - _o_result = c->cmd; __DEL(name); - return _o_result; + return c->cmd; } else { Modules_res = 2; __MOVE(" command \"", Modules_resMsg, 11); @@ -121,9 +117,8 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2); Modules_Append((void*)Modules_resMsg, 256, name, name__len); Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12); - _o_result = NIL; __DEL(name); - return _o_result; + return NIL; } __RETCHK; } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 038bd92c..dff6adc6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -74,7 +74,6 @@ static void OPB_err (int16 n) OPT_Node OPB_NewLeaf (OPT_Object obj) { - OPT_Node _o_result; OPT_Node node = NIL; switch (obj->mode) { case 1: @@ -102,8 +101,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) } node->obj = obj; node->typ = obj->typ; - _o_result = node; - return _o_result; + return node; } void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) @@ -131,34 +129,27 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) static int16 OPB_BoolToInt (BOOLEAN b) { - int16 _o_result; if (b) { - _o_result = 1; - return _o_result; + return 1; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } static BOOLEAN OPB_IntToBool (int64 i) { - BOOLEAN _o_result; - _o_result = i != 0; - return _o_result; + return i != 0; } OPT_Node OPB_NewBoolConst (BOOLEAN boolval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_booltyp; x->conval = OPT_NewConst(); x->conval->intval = OPB_BoolToInt(boolval); - _o_result = x; - return _o_result; + return x; } void OPB_OptIf (OPT_Node *x) @@ -198,26 +189,22 @@ void OPB_OptIf (OPT_Node *x) OPT_Node OPB_Nil (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_niltyp; x->conval = OPT_NewConst(); x->conval->intval = 0; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_EmptySet (void) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->typ = OPT_settyp; x->conval = OPT_NewConst(); x->conval->setval = 0x0; - _o_result = x; - return _o_result; + return x; } static void OPB_SetIntType (OPT_Node node) @@ -238,32 +225,27 @@ static void OPB_SetSetType (OPT_Node node) OPT_Node OPB_NewIntConst (int64 intval) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->intval = intval; OPB_SetIntType(x); - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); x->conval->realval = realval; x->typ = typ; x->conval->intval = -1; - _o_result = x; - return _o_result; + return x; } OPT_Node OPB_NewString (OPS_String str, int64 len) { - OPT_Node _o_result; OPT_Node x = NIL; x = OPT_NewNode(7); x->conval = OPT_NewConst(); @@ -272,8 +254,7 @@ OPT_Node OPB_NewString (OPS_String str, int64 len) x->conval->intval2 = OPM_Longint(len); x->conval->ext = OPT_NewExt(); __COPY(str, *x->conval->ext, 256); - _o_result = x; - return _o_result; + return x; } static void OPB_CharToString (OPT_Node n) @@ -305,9 +286,7 @@ static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN OPB_NotVar (OPT_Node x) { - BOOLEAN _o_result; - _o_result = (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); - return _o_result; + return (x->class >= 7 && ((x->class != 11 || x->subcl != 29) || x->left->class >= 7)); } void OPB_DeRef (OPT_Node *x) @@ -489,7 +468,6 @@ void OPB_In (OPT_Node *x, OPT_Node y) static int64 OPB_log (int64 x) { - int64 _o_result; OPB_exp = 0; if (x > 0) { while (!__ODD(x)) { @@ -497,8 +475,7 @@ static int64 OPB_log (int64 x) OPB_exp += 1; } } - _o_result = x; - return _o_result; + return x; } static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) @@ -529,14 +506,12 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(11); node->subcl = op; node->typ = typ; node->left = z; - _o_result = node; - return _o_result; + return node; } void OPB_MOp (int8 op, OPT_Node *x) @@ -775,7 +750,6 @@ static int16 ConstCmp__14 (void); static int16 ConstCmp__14 (void) { - int16 _o_result; int16 res; switch (*ConstOp__13_s->f) { case 0: @@ -836,8 +810,7 @@ static int16 ConstCmp__14 (void) break; } (*ConstOp__13_s->x)->typ = OPT_booltyp; - _o_result = res; - return _o_result; + return res; } static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) @@ -1202,7 +1175,6 @@ static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) { - BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; xCharArr = (__IN((*x)->typ->comp, 0x0c, 32) && (*x)->typ->BaseTyp->form == 3) || *Op__38_s->f == 8; yCharArr = (__IN((*y)->typ->comp, 0x0c, 32) && (*y)->typ->BaseTyp->form == 3) || *Op__38_s->g == 8; @@ -1228,8 +1200,7 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) OPB_Index(&*x, OPB_NewIntConst(0)); } } - _o_result = ok; - return _o_result; + return ok; } void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) @@ -2016,14 +1987,12 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) { - OPT_Node _o_result; OPT_Node node = NIL; node = OPT_NewNode(class); node->subcl = subcl; node->left = left; node->right = right; - _o_result = node; - return _o_result; + return node; } void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 20c369e9..9401b9a7 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -157,19 +157,16 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) static int16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; } - _o_result = i; - return _o_result; + return i; } static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i, h; i = 0; h = 0; @@ -177,8 +174,7 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) h = 3 * h + (int16)s[__X(i, s__len)]; i += 1; } - _o_result = (int)__MOD(h, 105); - return _o_result; + return (int)__MOD(h, 105); } void OPC_Ident (OPT_Object obj) @@ -320,9 +316,7 @@ void OPC_Andent (OPT_Struct typ) static BOOLEAN OPC_Undefined (OPT_Object obj) { - BOOLEAN _o_result; - _o_result = obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); - return _o_result; + return obj->name[0] == 0x00 || (((obj->mnolev >= 0 && obj->linkadr != (3 + OPM_currFile))) && obj->linkadr != 2); } static void OPC_DeclareBase (OPT_Object dcl) @@ -391,13 +385,11 @@ static void OPC_DeclareBase (OPT_Object dcl) int32 OPC_NofPtrs (OPT_Struct typ) { - int32 _o_result; OPT_Object fld = NIL; OPT_Struct btyp = NIL; int32 n; if ((typ->form == 11 && typ->sysflag == 0)) { - _o_result = 1; - return _o_result; + return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { btyp = typ->BaseTyp; if (btyp != NIL) { @@ -414,8 +406,7 @@ int32 OPC_NofPtrs (OPT_Struct typ) } fld = fld->link; } - _o_result = n; - return _o_result; + return n; } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -423,11 +414,9 @@ int32 OPC_NofPtrs (OPT_Struct typ) n = btyp->n * n; btyp = btyp->BaseTyp; } - _o_result = OPC_NofPtrs(btyp) * n; - return _o_result; + return OPC_NofPtrs(btyp) * n; } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -608,7 +597,6 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { - OPT_Object _o_result; OPT_Struct typ = NIL, base = NIL; int32 mno; typ = obj->link->typ; @@ -622,8 +610,7 @@ OPT_Object OPC_BaseTProc (OPT_Object obj) base = typ->BaseTyp; } OPT_FindField(obj->name, typ, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPC_DefineTProcMacros (OPT_Object obj, BOOLEAN *empty) @@ -734,18 +721,14 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - BOOLEAN _o_result; int16 i; - BOOLEAN r; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { i += 1; } - r = y[__X(i, y__len)] == 0x00; - _o_result = r; __DEL(y); - return _o_result; + return y[__X(i, y__len)] == 0x00; } static void OPC_CProcDefs (OPT_Object obj, int16 vis) @@ -1455,12 +1438,6 @@ void OPC_EnterProc (OPT_Object proc) } OPC_ProcHeader(proc, 1); OPC_BegBlk(); - if (proc->typ != OPT_notyp) { - OPC_BegStat(); - OPC_Ident(proc->typ->strobj); - OPM_WriteString((CHAR*)" _o_result;", 12); - OPM_WriteLn(); - } scope = proc->scope; OPC_IdentList(scope->scope, 0); if (!scope->leaf) { diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 47d8fab3..5b67d672 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -124,33 +124,25 @@ void OPM_LogWLn (void) int64 OPM_SignedMaximum (int32 bytecount) { - int64 _o_result; int64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); - _o_result = result - 1; - return _o_result; + return result - 1; } int64 OPM_SignedMinimum (int32 bytecount) { - int64 _o_result; - _o_result = -OPM_SignedMaximum(bytecount) - 1; - return _o_result; + return -OPM_SignedMaximum(bytecount) - 1; } int32 OPM_Longint (int64 n) { - int32 _o_result; - _o_result = __VAL(int32, n); - return _o_result; + return __VAL(int32, n); } int16 OPM_Integer (int64 n) { - int16 _o_result; - _o_result = __VAL(int16, n); - return _o_result; + return __VAL(int16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) @@ -266,7 +258,6 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) BOOLEAN OPM_OpenPar (void) { - BOOLEAN _o_result; CHAR s[256]; if (Platform_ArgCount == 1) { OPM_LogWLn(); @@ -274,7 +265,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr(Configuration_versionLong, 75); OPM_LogW('.'); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG.", 39); + OPM_LogWStr((CHAR*)"Based on Ofront by J. Templ and Software Templ OEG.", 52); OPM_LogWLn(); OPM_LogWStr((CHAR*)"Further development by Norayr Chilingarian, David Brown and others.", 68); OPM_LogWLn(); @@ -287,7 +278,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWStr((CHAR*)" options {files {options}}.", 28); OPM_LogWLn(); OPM_LogWLn(); - OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33); + OPM_LogWStr((CHAR*)"Options:", 9); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)" Run time safety", 18); @@ -345,7 +336,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm).", 97); OPM_LogWLn(); - OPM_LogWStr((CHAR*)" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); + OPM_LogWStr((CHAR*)" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms).", 71); OPM_LogWLn(); OPM_LogWLn(); OPM_LogWStr((CHAR*)"All options are off by default, except where noted above.", 58); @@ -356,8 +347,7 @@ BOOLEAN OPM_OpenPar (void) OPM_LogWLn(); OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39); OPM_LogWLn(); - _o_result = 0; - return _o_result; + return 0; } else { OPM_AddressSize = 8; OPM_GetAlignment(&OPM_Alignment); @@ -376,8 +366,7 @@ BOOLEAN OPM_OpenPar (void) OPM_GlobalAlignment = OPM_Alignment; __COPY(OPM_Model, OPM_GlobalModel, 10); OPM_GlobalOptions = OPM_Options; - _o_result = 1; - return _o_result; + return 1; } __RETCHK; } @@ -741,20 +730,16 @@ void OPM_SymRCh (CHAR *ch) int32 OPM_SymRInt (void) { - int32 _o_result; int32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); - _o_result = k; - return _o_result; + return k; } int64 OPM_SymRInt64 (void) { - int64 _o_result; int64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); - _o_result = k; - return _o_result; + return k; } void OPM_SymRSet (uint64 *s) @@ -797,9 +782,7 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) BOOLEAN OPM_eofSF (void) { - BOOLEAN _o_result; - _o_result = OPM_oldSF.eof; - return _o_result; + return OPM_oldSF.eof; } void OPM_SymWCh (CHAR ch) diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 0325d7f2..615109df 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -901,7 +901,6 @@ static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) { - BOOLEAN _o_result; if ((b->form == 11 && x->form == 11)) { b = b->BaseTyp; x = x->BaseTyp; @@ -911,8 +910,7 @@ static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b) x = x->BaseTyp; } while (!(x == NIL || x == b)); } - _o_result = x == b; - return _o_result; + return x == b; } static struct ProcedureDeclaration__16 { diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index b3c52f3c..5a34663d 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -97,7 +97,6 @@ static LONGREAL Ten__9 (int16 e); static LONGREAL Ten__9 (int16 e) { - LONGREAL _o_result; LONGREAL x, p; x = (LONGREAL)1; p = (LONGREAL)10; @@ -110,23 +109,18 @@ static LONGREAL Ten__9 (int16 e) p = p * p; } } - _o_result = x; - return _o_result; + return x; } static int16 Ord__7 (CHAR ch, BOOLEAN hex) { - int16 _o_result; if (ch <= '9') { - _o_result = (int16)ch - 48; - return _o_result; + return (int16)ch - 48; } else if (hex) { - _o_result = ((int16)ch - 65) + 10; - return _o_result; + return ((int16)ch - 65) + 10; } else { OPS_err(2); - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -324,6 +318,7 @@ void OPS_Get (int8 *sym) while (OPS_ch <= ' ') { if (OPS_ch == 0x00) { *sym = 64; + Get__1_s = _s.lnk; return; } else { OPM_Get(&OPS_ch); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index fe2c4bd5..48352c94 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -179,7 +179,6 @@ static void OPT_err (int16 n) int16 OPT_IntSize (int64 n) { - int16 _o_result; int16 bytes; if (n < 0) { n = -(n + 1); @@ -188,77 +187,59 @@ int16 OPT_IntSize (int64 n) while ((bytes < 8 && __ASH(n, -(__ASHL(bytes, 3) - 1)) != 0)) { bytes += 1; } - _o_result = bytes; - return _o_result; + return bytes; } OPT_Struct OPT_IntType (int32 size) { - OPT_Struct _o_result; if (size <= OPT_int8typ->size) { - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } if (size <= OPT_int16typ->size) { - _o_result = OPT_int16typ; - return _o_result; + return OPT_int16typ; } if (size <= OPT_int32typ->size) { - _o_result = OPT_int32typ; - return _o_result; + return OPT_int32typ; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } OPT_Struct OPT_SetType (int32 size) { - OPT_Struct _o_result; if (size == OPT_set32typ->size) { - _o_result = OPT_set32typ; - return _o_result; + return OPT_set32typ; } - _o_result = OPT_set64typ; - return _o_result; + return OPT_set64typ; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) { - OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); if (dir > 0) { if (x->size < OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } if (x->size < OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size < OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } - _o_result = OPT_int64typ; - return _o_result; + return OPT_int64typ; } else { if (x->size > OPT_linttyp->size) { - _o_result = OPT_linttyp; - return _o_result; + return OPT_linttyp; } if (x->size > OPT_inttyp->size) { - _o_result = OPT_inttyp; - return _o_result; + return OPT_inttyp; } if (x->size > OPT_sinttyp->size) { - _o_result = OPT_sinttyp; - return _o_result; + return OPT_sinttyp; } - _o_result = OPT_int8typ; - return _o_result; + return OPT_int8typ; } __RETCHK; } @@ -285,7 +266,6 @@ void OPT_Align (int32 *adr, int32 base) int32 OPT_SizeAlignment (int32 size) { - int32 _o_result; int32 alignment; if (size < OPM_Alignment) { alignment = 1; @@ -295,13 +275,11 @@ int32 OPT_SizeAlignment (int32 size) } else { alignment = OPM_Alignment; } - _o_result = alignment; - return _o_result; + return alignment; } int32 OPT_BaseAlignment (OPT_Struct typ) { - int32 _o_result; int32 alignment; if (typ->form == 13) { if (typ->comp == 4) { @@ -312,8 +290,7 @@ int32 OPT_BaseAlignment (OPT_Struct typ) } else { alignment = OPT_SizeAlignment(typ->size); } - _o_result = alignment; - return _o_result; + return alignment; } void OPT_TypSize (OPT_Struct typ) @@ -389,25 +366,20 @@ void OPT_TypSize (OPT_Struct typ) OPT_Const OPT_NewConst (void) { - OPT_Const _o_result; OPT_Const const_ = NIL; __NEW(const_, OPT_ConstDesc); - _o_result = const_; - return _o_result; + return const_; } OPT_Object OPT_NewObj (void) { - OPT_Object _o_result; OPT_Object obj = NIL; __NEW(obj, OPT_ObjDesc); - _o_result = obj; - return _o_result; + return obj; } OPT_Struct OPT_NewStr (int8 form, int8 comp) { - OPT_Struct _o_result; OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); typ->form = form; @@ -418,27 +390,22 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) } typ->size = -1; typ->BaseTyp = OPT_undftyp; - _o_result = typ; - return _o_result; + return typ; } OPT_Node OPT_NewNode (int8 class) { - OPT_Node _o_result; OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); node->class = class; - _o_result = node; - return _o_result; + return node; } OPT_ConstExt OPT_NewExt (void) { - OPT_ConstExt _o_result; OPT_ConstExt ext = NIL; ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); - _o_result = ext; - return _o_result; + return ext; } void OPT_OpenScope (int8 level, OPT_Object owner) @@ -1120,7 +1087,6 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1146,13 +1112,11 @@ static OPT_Object OPT_InFld (void) obj->vis = 0; obj->adr = OPM_SymRInt(); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Object OPT_InTProc (int8 mno) { - OPT_Object _o_result; int32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; @@ -1174,22 +1138,17 @@ static OPT_Object OPT_InTProc (int8 mno) obj->vis = 0; obj->adr = __ASHL(OPM_SymRInt(), 16); } - _o_result = obj; - return _o_result; + return obj; } static OPT_Struct OPT_InTyp (int32 tag) { - OPT_Struct _o_result; if (tag == 4) { - _o_result = OPT_IntType(OPM_SymRInt()); - return _o_result; + return OPT_IntType(OPM_SymRInt()); } else if (tag == 7) { - _o_result = OPT_SetType(OPM_SymRInt()); - return _o_result; + return OPT_SetType(OPM_SymRInt()); } else { - _o_result = OPT_impCtxt.ref[__X(tag, 255)]; - return _o_result; + return OPT_impCtxt.ref[__X(tag, 255)]; } __RETCHK; } @@ -1378,7 +1337,6 @@ static void OPT_InStruct (OPT_Struct *typ) static OPT_Object OPT_InObj (int8 mno) { - OPT_Object _o_result; int16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; @@ -1475,8 +1433,7 @@ static OPT_Object OPT_InObj (int8 mno) } } } - _o_result = obj; - return _o_result; + return obj; } void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 64c3f578..c7a907db 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -207,44 +207,35 @@ void OPV_AdrAndSize (OPT_Object topScope) static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) { - int16 _o_result; switch (class) { case 7: case 0: case 2: case 4: case 9: case 13: - _o_result = 10; - return _o_result; + return 10; break; case 5: if (__IN(3, OPM_Options, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 1: if (__IN(comp, 0x0c, 32)) { - _o_result = 10; - return _o_result; + return 10; } else { - _o_result = 9; - return _o_result; + return 9; } break; case 3: - _o_result = 9; - return _o_result; + return 9; break; case 11: switch (subclass) { case 33: case 7: case 24: case 29: case 20: - _o_result = 9; - return _o_result; + return 9; break; case 16: case 21: case 22: case 23: case 25: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Nmop, subclass = ", 55); @@ -257,64 +248,50 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp switch (subclass) { case 1: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 2: if (form == 7) { - _o_result = 3; - return _o_result; + return 3; } else { - _o_result = 8; - return _o_result; + return 8; } break; case 3: case 4: - _o_result = 10; - return _o_result; + return 10; break; case 6: if (form == 7) { - _o_result = 2; - return _o_result; + return 2; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 7: if (form == 7) { - _o_result = 4; - return _o_result; + return 4; } else { - _o_result = 7; - return _o_result; + return 7; } break; case 11: case 12: case 13: case 14: - _o_result = 6; - return _o_result; + return 6; break; case 9: case 10: - _o_result = 5; - return _o_result; + return 5; break; case 5: - _o_result = 1; - return _o_result; + return 1; break; case 8: - _o_result = 0; - return _o_result; + return 0; break; case 19: case 15: case 17: case 18: case 26: case 27: case 28: - _o_result = 10; - return _o_result; + return 10; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence OPT.Ndop, subclass = ", 55); @@ -324,12 +301,10 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp } break; case 10: - _o_result = 10; - return _o_result; + return 10; break; case 8: case 6: - _o_result = 12; - return _o_result; + return 12; break; default: OPM_LogWStr((CHAR*)"unhandled case in OPV.Precedence, class = ", 43); @@ -358,13 +333,10 @@ static void OPV_Len (OPT_Node n, int64 dim) static BOOLEAN OPV_SideEffects (OPT_Node n) { - BOOLEAN _o_result; if (n != NIL) { - _o_result = (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); - return _o_result; + return (n->class == 13 || OPV_SideEffects(n->left)) || OPV_SideEffects(n->right); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } @@ -744,7 +716,6 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) static OPT_Object OPV_SuperProc (OPT_Node n) { - OPT_Object _o_result; OPT_Object obj = NIL; OPT_Struct typ = NIL; typ = n->right->typ; @@ -752,8 +723,7 @@ static OPT_Object OPV_SuperProc (OPT_Node n) typ = typ->BaseTyp; } OPT_FindField(n->left->obj->name, typ->BaseTyp, &obj); - _o_result = obj; - return _o_result; + return obj; } static void OPV_expr (OPT_Node n, int16 prec) @@ -1187,12 +1157,10 @@ static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) static BOOLEAN OPV_ImplicitReturn (OPT_Node n) { - BOOLEAN _o_result; while ((n != NIL && n->class != 26)) { n = n->link; } - _o_result = n == NIL; - return _o_result; + return n == NIL; } static void OPV_NewArr (OPT_Node d, OPT_Node x) @@ -1523,21 +1491,16 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) OPM_WriteString((CHAR*)"__ENDMOD", 9); } } else { + OPC_ExitProc(outerProc, 0, 0); + OPM_WriteString((CHAR*)"return", 7); if (n->left != NIL) { - OPM_WriteString((CHAR*)"_o_result = ", 13); + OPM_Write(' '); if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { OPM_WriteString((CHAR*)"(void*)", 8); OPV_expr(n->left, 10); } else { OPV_expr(n->left, -1); } - OPM_WriteString((CHAR*)";", 2); - OPM_WriteLn(); - OPC_BegStat(); - OPC_ExitProc(outerProc, 0, 0); - OPM_WriteString((CHAR*)"return _o_result", 17); - } else { - OPM_WriteString((CHAR*)"return", 7); } } break; diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 3d2d0c84..6098e568 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -56,14 +56,12 @@ void Out_Char (CHAR ch) static int32 Out_Length (CHAR *s, LONGINT s__len) { - int32 _o_result; int32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; } - _o_result = l; - return _o_result; + return l; } void Out_String (CHAR *str, LONGINT str__len) @@ -152,7 +150,6 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 LONGREAL Out_Ten (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -163,8 +160,7 @@ LONGREAL Out_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 845872c3..9eee96c2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -186,65 +186,47 @@ extern void Heap_InitHeap(); BOOLEAN Platform_TooManyFiles (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORTOOMANYOPENFILES(); - return _o_result; + return e == Platform_ERRORTOOMANYOPENFILES(); } BOOLEAN Platform_NoSuchDirectory (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_DifferentFilesystems (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORNOTSAMEDEVICE(); - return _o_result; + return e == Platform_ERRORNOTSAMEDEVICE(); } BOOLEAN Platform_Inaccessible (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); - return _o_result; + return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } BOOLEAN Platform_Absent (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); - return _o_result; + return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } BOOLEAN Platform_TimedOut (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_ETIMEDOUT(); - return _o_result; + return e == Platform_ETIMEDOUT(); } BOOLEAN Platform_ConnectionFailed (int16 e) { - BOOLEAN _o_result; - _o_result = ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); - return _o_result; + return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } BOOLEAN Platform_Interrupted (int16 e) { - BOOLEAN _o_result; - _o_result = e == Platform_EINTR(); - return _o_result; + return e == Platform_EINTR(); } int64 Platform_OSAllocate (int64 size) { - int64 _o_result; - _o_result = Platform_allocate(size); - return _o_result; + return Platform_allocate(size); } void Platform_OSFree (int64 address) @@ -265,20 +247,17 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { - BOOLEAN _o_result; CHAR buf[4096]; int16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { __COPY(buf, val, val__len); - _o_result = 1; __DEL(var); - return _o_result; + return 1; } else { - _o_result = 0; __DEL(var); - return _o_result; + return 0; } __RETCHK; } @@ -329,7 +308,6 @@ void Platform_GetIntArg (int16 n, int32 *val) int16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 _o_result; int16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); @@ -339,9 +317,8 @@ int16 Platform_ArgPos (CHAR *s, LONGINT s__len) i += 1; Platform_GetArg(i, (void*)arg, 256); } - _o_result = i; __DEL(s); - return _o_result; + return i; } void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) @@ -362,11 +339,9 @@ void Platform_GetClock (int32 *t, int32 *d) int32 Platform_Time (void) { - int32 _o_result; int32 ms; ms = Platform_GetTickCount(); - _o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647); - return _o_result; + return (int)__MOD(ms - Platform_TimeStart, 2147483647); } void Platform_Delay (int32 ms) @@ -392,7 +367,6 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) int16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 _o_result; int16 result; __DUP(cmd, cmd__len, CHAR); result = 127; @@ -404,127 +378,102 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) } Platform_cleanupProcess(); } - _o_result = __ASHL(result, 8); __DEL(cmd); - return _o_result; + return __ASHL(result, 8); } int16 Platform_Error (void) { - int16 _o_result; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) { - int16 _o_result; int32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *h = fd; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Close (int32 h) { - int16 _o_result; if (Platform_closeHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } (*identity).volume = Platform_bhfiVsn(); (*identity).indexhigh = Platform_bhfiIndexHigh(); (*identity).indexlow = Platform_bhfiIndexLow(); (*identity).mtimehigh = Platform_bhfiMtimeHigh(); (*identity).mtimelow = Platform_bhfiMtimeLow(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) { - int16 _o_result; int32 h; int16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { - _o_result = e; __DEL(n); - return _o_result; + return e; } e = Platform_Identify(h, &*identity, identity__typ); i = Platform_Close(h); - _o_result = e; __DEL(n); - return _o_result; + return e; } BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); - return _o_result; + return (((i1.indexhigh == i2.indexhigh && i1.indexlow == i2.indexlow)) && i1.volume == i2.volume); } BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2) { - BOOLEAN _o_result; - _o_result = (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); - return _o_result; + return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) @@ -542,160 +491,127 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) int16 Platform_Size (int32 h, int32 *l) { - int16 _o_result; Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } *l = Platform_liLongint(); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { - int16 _o_result; int16 result; int32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { *n = lengthread; - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Write (int32 h, int64 p, int32 l) { - int16 _o_result; if (Platform_writefile(h, p, l) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Sync (int32 h) { - int16 _o_result; if (Platform_flushFileBuffers(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Seek (int32 h, int32 o, int16 r) { - int16 _o_result; int16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Truncate (int32 h, int32 limit) { - int16 _o_result; int16 rc; int32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, limit, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } if (Platform_setEndOfFile(h) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_setFilePointerEx(h, oldpos, Platform_seekset(), &rc); if (rc == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Unlink (CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_deleteFile(n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } int16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 _o_result; int16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } Platform_getCurrentDirectory((void*)Platform_CWD, 4096); - _o_result = 0; - return _o_result; + return 0; } int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { - int16 _o_result; if (Platform_moveFile(o, o__len, n, n__len) == 0) { - _o_result = Platform_err(); - return _o_result; + return Platform_err(); } else { - _o_result = 0; - return _o_result; + return 0; } __RETCHK; } diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 87ddfb2a..0aca5733 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -25,7 +25,6 @@ static CHAR Reals_ToHex (int16 i); REAL Reals_Ten (int16 e) { - REAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -36,13 +35,11 @@ REAL Reals_Ten (int16 e) power = power * power; e = __ASHR(e, 1); } - _o_result = r; - return _o_result; + return r; } LONGREAL Reals_TenL (int16 e) { - LONGREAL _o_result; LONGREAL r, power; r = (LONGREAL)1; power = (LONGREAL)10; @@ -52,8 +49,7 @@ LONGREAL Reals_TenL (int16 e) } e = __ASHR(e, 1); if (e <= 0) { - _o_result = r; - return _o_result; + return r; } power = power * power; } @@ -62,11 +58,9 @@ LONGREAL Reals_TenL (int16 e) int16 Reals_Expo (REAL x) { - int16 _o_result; int16 i; __GET((address)&x + 2, i, int16); - _o_result = __MASK(__ASHR(i, 7), -256); - return _o_result; + return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, int16 ex) @@ -80,11 +74,9 @@ void Reals_SetExpo (REAL *x, int16 ex) int16 Reals_ExpoL (LONGREAL x) { - int16 _o_result; int16 i; __GET((address)&x + 6, i, int16); - _o_result = __MASK(__ASHR(i, 4), -2048); - return _o_result; + return __MASK(__ASHR(i, 4), -2048); } void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) @@ -122,13 +114,10 @@ void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) static CHAR Reals_ToHex (int16 i) { - CHAR _o_result; if (i < 10) { - _o_result = (CHAR)(i + 48); - return _o_result; + return (CHAR)(i + 48); } else { - _o_result = (CHAR)(i + 55); - return _o_result; + return (CHAR)(i + 55); } __RETCHK; } diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5bbe808d..000c09c8 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -23,7 +23,6 @@ export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR int16 Strings_Length (CHAR *s, LONGINT s__len) { - int16 _o_result; int32 i; __DUP(s, s__len, CHAR); i = 0; @@ -31,13 +30,11 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) i += 1; } if (i <= 32767) { - _o_result = (int16)i; __DEL(s); - return _o_result; + return (int16)i; } else { - _o_result = 32767; __DEL(s); - return _o_result; + return 32767; } __RETCHK; } @@ -70,6 +67,7 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L } if (pos > n1) { Strings_Append(dest, dest__len, (void*)source, source__len); + __DEL(source); return; } if ((pos + n2) < dest__len) { @@ -131,6 +129,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA } if (pos >= len) { dest[0] = 0x00; + __DEL(source); return; } i = 0; @@ -146,17 +145,15 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) { - int16 _o_result; int16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); n2 = Strings_Length(pattern, pattern__len); if (n2 == 0) { - _o_result = 0; __DEL(pattern); __DEL(s); - return _o_result; + return 0; } i = pos; while (i <= n1 - n2) { @@ -166,18 +163,16 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, j += 1; } if (j == n2) { - _o_result = i; __DEL(pattern); __DEL(s); - return _o_result; + return i; } } i += 1; } - _o_result = -1; __DEL(pattern); __DEL(s); - return _o_result; + return -1; } void Strings_Cap (CHAR *s, LONGINT s__len) @@ -200,50 +195,42 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) { - BOOLEAN _o_result; while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { - _o_result = 0; - return _o_result; + return 0; } n -= 1; m -= 1; } if (m < 0) { - _o_result = n < 0; - return _o_result; + return n < 0; } while ((m >= 0 && mask[__X(m, mask__len)] == '*')) { m -= 1; } if (m < 0) { - _o_result = 1; - return _o_result; + return 1; } while (n >= 0) { if (M__8(name, name__len, mask, mask__len, n, m)) { - _o_result = 1; - return _o_result; + return 1; } n -= 1; } - _o_result = 0; - return _o_result; + return 0; } BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { - BOOLEAN _o_result; struct Match__7 _s; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; - _o_result = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return _o_result; + return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); } diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3271c367..e84157d1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -234,12 +234,10 @@ export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGIN static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) { - Texts_FontsFont _o_result; Texts_FontsFont F = NIL; __NEW(F, Texts_FontDesc); __COPY(name, F->name, 32); - _o_result = F; - return _o_result; + return F; } static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) @@ -338,22 +336,18 @@ static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text bas static Texts_Piece Texts_ClonePiece (Texts_Piece p) { - Texts_Piece _o_result; Texts_Piece q = NIL; __NEW(q, Texts_PieceDesc); __GUARDEQP(q, Texts_PieceDesc) = *p; - _o_result = q; - return _o_result; + return q; } static Texts_Elem Texts_CloneElem (Texts_Elem e) { - Texts_Elem _o_result; Texts_CopyMsg msg; msg.e = NIL; (*e->handle)(e, (void*)&msg, Texts_CopyMsg__typ); - _o_result = msg.e; - return _o_result; + return msg.e; } void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) @@ -369,14 +363,11 @@ void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE) Texts_Text Texts_ElemBase (Texts_Elem E) { - Texts_Text _o_result; - _o_result = E->base; - return _o_result; + return E->base; } int32 Texts_ElemPos (Texts_Elem E) { - int32 _o_result; Texts_Run u = NIL; int32 pos; u = E->base->head->next; @@ -385,8 +376,7 @@ int32 Texts_ElemPos (Texts_Elem E) pos = pos + u->len; u = u->next; } - _o_result = pos; - return _o_result; + return pos; } static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) @@ -716,9 +706,7 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) int32 Texts_Pos (Texts_Reader *R, address *R__typ) { - int32 _o_result; - _o_result = (*R).org + (*R).off; - return _o_result; + return (*R).org + (*R).off; } void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index e17c4614..c0abf4e3 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -275,7 +275,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" Target machine address size and alignment (default is that of the running compiler binary)"); LogWLn; LogWStr(" -A44 32 bit addresses, 32 bit alignment (e.g. Unix/linux 32 bit on x86)."); LogWLn; LogWStr(" -A48 32 bit addresses, 64 bit alignment (e.g. Windows 32 bit on x86, linux 32 bit on arm)."); LogWLn; - LogWStr(" -A88 66 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; + LogWStr(" -A88 64 bit addresses, 64 bit alignment (e.g. 64 bit platforms)."); LogWLn; LogWLn; LogWStr("All options are off by default, except where noted above."); LogWLn; LogWStr("Initial options specify defaults for all files."); LogWLn; diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 08aa873b..53f7843e 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old - egrep -v "(^/\* voc +)|Configuration_|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new + egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old + egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 03556336ce3f987da6d1edab0b1848200d5966fe Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 28 Oct 2016 21:00:07 +0100 Subject: [PATCH 101/140] Restore result variable just for issue #40 using same fix as J. Templ. --- bootstrap/unix-44/OPC.c | 12 ++++++++++++ bootstrap/unix-44/OPC.h | 1 + bootstrap/unix-44/OPV.c | 14 ++++++++++++++ bootstrap/unix-44/Strings.c | 5 ++++- bootstrap/unix-48/OPC.c | 12 ++++++++++++ bootstrap/unix-48/OPC.h | 1 + bootstrap/unix-48/OPV.c | 14 ++++++++++++++ bootstrap/unix-48/Strings.c | 5 ++++- bootstrap/unix-88/OPC.c | 12 ++++++++++++ bootstrap/unix-88/OPC.h | 1 + bootstrap/unix-88/OPV.c | 14 ++++++++++++++ bootstrap/unix-88/Strings.c | 5 ++++- bootstrap/windows-48/OPC.c | 12 ++++++++++++ bootstrap/windows-48/OPC.h | 1 + bootstrap/windows-48/OPV.c | 14 ++++++++++++++ bootstrap/windows-48/Strings.c | 5 ++++- bootstrap/windows-88/OPC.c | 12 ++++++++++++ bootstrap/windows-88/OPC.h | 1 + bootstrap/windows-88/OPV.c | 14 ++++++++++++++ bootstrap/windows-88/Strings.c | 5 ++++- src/compiler/OPC.Mod | 6 ++++++ src/compiler/OPV.Mod | 10 ++++++++++ 22 files changed, 171 insertions(+), 5 deletions(-) diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index c7a907db..452a1182 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 787ce143..f44318ed 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9401b9a7..27ab3d15 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -69,6 +69,7 @@ export void OPC_IntLiteral (int64 n, int32 size); export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); static int16 OPC_Length (CHAR *s, LONGINT s__len); +export BOOLEAN OPC_NeedsRetval (OPT_Object proc); export int32 OPC_NofPtrs (OPT_Struct typ); static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); @@ -1428,6 +1429,11 @@ void OPC_DefineInter (OPT_Object proc) OPM_WriteLn(); } +BOOLEAN OPC_NeedsRetval (OPT_Object proc) +{ + return (proc->typ != OPT_notyp && !proc->scope->leaf); +} + void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; @@ -1448,6 +1454,12 @@ void OPC_EnterProc (OPT_Object proc) OPM_WriteString((CHAR*)"_s", 3); OPC_EndStat(); } + if (OPC_NeedsRetval(proc)) { + OPC_BegStat(); + OPC_Ident(proc->typ->strobj); + OPM_WriteString((CHAR*)" __retval", 10); + OPC_EndStat(); + } var = proc->link; while (var != NIL) { if ((var->typ->comp == 2 && var->mode == 1)) { diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index c09a1524..bbfd1911 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -37,6 +37,7 @@ import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); import void OPC_IntLiteral (int64 n, int32 size); import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import BOOLEAN OPC_NeedsRetval (OPT_Object proc); import int32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index c7a907db..452a1182 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1490,6 +1490,20 @@ static void OPV_stat (OPT_Node n, OPT_Object outerProc) } else { OPM_WriteString((CHAR*)"__ENDMOD", 9); } + } else if (OPC_NeedsRetval(outerProc)) { + OPM_WriteString((CHAR*)"__retval = ", 12); + if ((n->left->typ->form == 11 && n->obj->typ != n->left->typ)) { + OPM_WriteString((CHAR*)"(void*)", 8); + OPV_expr(n->left, 10); + } else { + OPV_expr(n->left, -1); + } + OPC_EndStat(); + OPC_BegStat(); + OPC_ExitProc(outerProc, 0, 0); + OPC_EndStat(); + OPC_BegStat(); + OPM_WriteString((CHAR*)"return __retval", 16); } else { OPC_ExitProc(outerProc, 0, 0); OPM_WriteString((CHAR*)"return", 7); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 000c09c8..104a0fb7 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -223,14 +223,17 @@ static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__le BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len) { struct Match__7 _s; + BOOLEAN __retval; __DUP(string, string__len, CHAR); __DUP(pattern, pattern__len, CHAR); _s.lnk = Match__7_s; Match__7_s = &_s; + __retval = M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); Match__7_s = _s.lnk; __DEL(string); __DEL(pattern); - return M__8((void*)string, string__len, (void*)pattern, pattern__len, Strings_Length(string, string__len) - 1, Strings_Length(pattern, pattern__len) - 1); + ; + return __retval; } diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index d30cb712..ba59ef22 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -950,6 +950,11 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteLn; END DefineInter; + PROCEDURE NeedsRetval*(proc: OPT.Object): BOOLEAN; (* aux. variable __retval needed for return *) + BEGIN (* simple rule; ignores DUPlicated value arrays because they use alloca. *) + RETURN (proc^.typ # OPT.notyp) & ~proc^.scope^.leaf + END NeedsRetval; + PROCEDURE EnterProc* (proc: OPT.Object); VAR var, scope: OPT.Object; typ: OPT.Struct; dim: INTEGER; BEGIN @@ -962,6 +967,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BegStat; OPM.WriteString('struct '); OPM.WriteStringVar (scope^.name); OPM.Write(' '); OPM.WriteString(LocalScope); EndStat END ; + IF NeedsRetval(proc) THEN BegStat; Ident(proc^.typ^.strobj); OPM.WriteString(" __retval"); EndStat END; var := proc^.link; WHILE var # NIL DO (* declare copy of fixed size value array parameters *) IF (var^.typ^.comp = OPT.Array) & (var^.mode = OPT.Var) THEN diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 83c451c3..cc3c93ef 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -875,6 +875,16 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END | OPT.Nreturn: IF OPM.level = 0 THEN IF OPM.mainprog IN OPM.Options THEN OPM.WriteString("__FINI") ELSE OPM.WriteString("__ENDMOD") END + ELSIF OPC.NeedsRetval(outerProc) THEN + OPM.WriteString("__retval = "); + IF (n^.left^.typ^.form = OPT.Pointer) & (n^.obj^.typ # n^.left^.typ) THEN + OPM.WriteString("(void*)"); expr(n^.left, 10) + ELSE + expr(n^.left, MinPrec) + END ; + OPC.EndStat; + OPC.BegStat; OPC.ExitProc(outerProc, FALSE, FALSE); OPC.EndStat; + OPC.BegStat; OPM.WriteString("return __retval"); ELSE OPC.ExitProc(outerProc, FALSE, FALSE); OPM.WriteString("return"); From 2a242ae9608385ed77b0c6be9ece1728d7b74f6d Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 30 Oct 2016 14:22:10 +0000 Subject: [PATCH 102/140] Add Oakwood 'In' module and a test for it. --- .gitignore | 1 + src/runtime/In.Mod | 175 +++++++++++++++++------------- src/runtime/Out.Mod | 2 +- src/test/confidence/in/expected | 14 +++ src/test/confidence/in/intest.mod | 16 +++ src/test/confidence/in/test.sh | 16 +++ src/tools/make/oberon.mk | 6 +- 7 files changed, 151 insertions(+), 79 deletions(-) create mode 100644 src/test/confidence/in/expected create mode 100644 src/test/confidence/in/intest.mod create mode 100644 src/test/confidence/in/test.sh diff --git a/.gitignore b/.gitignore index db4032e0..a8e5ff00 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /src/test/**/*.obj /src/test/**/*.sym **/*.stackdump +/src/test/confidence/**/input /src/test/confidence/**/result /src/test/confidence/**/result-* /src/test/confidence/**/*.asm diff --git a/src/runtime/In.Mod b/src/runtime/In.Mod index aa67e4e7..873a00d9 100644 --- a/src/runtime/In.Mod +++ b/src/runtime/In.Mod @@ -3,113 +3,136 @@ MODULE In; IMPORT Platform, SYSTEM, Out; VAR - nextch: CHAR; - ready: BOOLEAN; - initialized: BOOLEAN; + Done-: BOOLEAN; + nextch: CHAR; (* Maintains 1 character read ahaead except at end of line. *) + readstate: INTEGER; - Done-: BOOLEAN; - -PROCEDURE ReadChar; -VAR error: Platform.ErrorCode; n: LONGINT; ch: CHAR; -BEGIN - error := Platform.ReadBuf(Platform.StdIn, ch, n); - ready := (error = 0) & (n = 1); - IF ready & (nextch = 0DX) & (ch = 0AX) THEN - ready := (error = 0) & (n = 1) - END; - IF ready THEN nextch := ch ELSE nextch := 0X END -END ReadChar; - -PROCEDURE Flush; -BEGIN Out.Flush; IF ~initialized THEN ReadChar END; initialized := TRUE -END Flush; +CONST + pending = 0; (* readstate when at start of input or end of line. Implies nextch undefined. *) + ready = 1; (* readstate when nextch is defined and contains next character on current line. *) + eof = 2; (* readstate when at end of file. *) PROCEDURE Open*; - VAR error: Platform.ErrorCode; +VAR error: Platform.ErrorCode; BEGIN - error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) - ready := TRUE; initialized := FALSE; + error := Platform.Seek(Platform.StdIn, 0, Platform.SeekSet); (* Rewind STDIN to beginning of file. *) + readstate := pending; + Done := TRUE; END Open; -PROCEDURE Char*(VAR ch: CHAR); -BEGIN Flush; - Done := ready; - IF ready THEN ch := nextch; ReadChar ELSE ch := 0X END -END Char; - -PROCEDURE Skip; +PROCEDURE ReadChar; +VAR error: Platform.ErrorCode; n: LONGINT; BEGIN - WHILE ready & (nextch <= " ") DO ReadChar END; (* Skip leading blanks, CR, LF, tab etc. *) -END Skip; + error := Platform.ReadBuf(Platform.StdIn, nextch, n); + IF (error = 0) & (n = 1) THEN readstate := ready ELSE readstate := eof END +END ReadChar; + +PROCEDURE StartRead; (* Ensure either nextch is valid or we're at EOF. *) +BEGIN Out.Flush; IF readstate = pending THEN ReadChar END; +END StartRead; + +PROCEDURE StartAndSkip; (* Like StartRead, but also skip over blanks, CR, LF, tab. *) +BEGIN StartRead; + WHILE (readstate = ready) & (nextch <= " ") DO ReadChar END +END StartAndSkip; + +PROCEDURE Char*(VAR ch: CHAR); +BEGIN + StartRead; + Done := readstate = ready; + IF Done THEN + ch := nextch; + IF ch = 0AX THEN readstate := pending ELSE ReadChar END + ELSE + ch := 0X + END +END Char; PROCEDURE HugeInt*(VAR h: HUGEINT); VAR - neg, hex, decdigit, hexdigit: BOOLEAN; + neg, hex, endofnum: BOOLEAN; decacc, hexacc, digit: HUGEINT; BEGIN - Flush; Skip; - - neg := nextch = '-'; IF neg THEN ReadChar END; - hex := FALSE; - endofnum := FALSE; - decacc := 0; - hexacc := 0; - Done := FALSE; - - WHILE ready & ~endofnum DO - decdigit := (nextch >= "0") & (nextch <= "9"); - IF decdigit THEN digit := ORD(nextch) MOD 16 END; - - hexdigit := (nextch >= "f") & (nextch <= "f") OR (nextch >= "A") & (nextch <= "F"); - IF hexdigit THEN ORD(nextch) MOD 16 + 9; hex := TRUE END; - - IF decdigit OR hexdigit THEN - Done := TRUE; - decacc := decacc * 10 + digit; - hexacc := hexacc * 16 + digit; - ReadChar - ELSIF nextch = "H" THEN - hex := TRUE; endofnum := TRUE; ReadChar + StartAndSkip; + Done := FALSE; + IF readstate = ready THEN + neg := nextch = '-'; IF neg THEN ReadChar END; + hex := FALSE; + endofnum := FALSE; + decacc := 0; + hexacc := 0; + WHILE (readstate = ready) & ~endofnum DO + digit := -1; + IF (nextch >= "0") & (nextch <= "9") THEN + digit := ORD(nextch) MOD 16 + ELSIF (nextch >= "a") & (nextch <= "f") + OR (nextch >= "A") & (nextch <= "F") THEN + digit := ORD(nextch) MOD 16 + 9; hex := TRUE + END; + IF digit >= 0 THEN + Done := TRUE; + decacc := decacc * 10 + digit; + hexacc := hexacc * 16 + digit; + ReadChar + ELSIF nextch = "H" THEN + hex := TRUE; endofnum := TRUE; ReadChar + ELSE + endofnum := TRUE + END + END; + IF Done THEN + IF hex THEN h := hexacc ELSE h := decacc END; + IF neg THEN h := -h END ELSE - endofnum := TRUE + h := 0 END - END; - IF Done THEN - IF hex THEN h := hexacc ELSE h := decacc END; - IF neg THEN h := -h END - ELSE - h := 0 END END HugeInt; PROCEDURE Int*(VAR i: INTEGER); - VAR h: HUGEINT; +VAR h: HUGEINT; BEGIN HugeInt(h); i := SYSTEM.VAL(INTEGER, h) END Int; PROCEDURE LongInt*(VAR i: LONGINT); - VAR h: HUGEINT; +VAR h: HUGEINT; BEGIN HugeInt(h); i := SYSTEM.VAL(LONGINT, h) END LongInt; PROCEDURE Real*(VAR x: REAL); -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END Real; PROCEDURE LongReal*(VAR y: LONGREAL); -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END LongReal; +PROCEDURE Line*(VAR line: ARRAY OF CHAR); +VAR i: INTEGER; +BEGIN StartRead; i := 0; Done := readstate = ready; + WHILE (readstate = ready) & (nextch # 0DX) & (nextch # 0AX) & (i < LEN(line)-1) DO + line[i] := nextch; INC(i); ReadChar + END; + line[i] := 0X; + IF (readstate = ready) & (nextch = 0DX) THEN ReadChar END; + IF (readstate = ready) & (nextch = 0AX) THEN readstate := pending END; +END Line; + PROCEDURE String*(VAR str: ARRAY OF CHAR); - VAR i: INTEGER; -BEGIN Flush; Skip; i := 0; - IF ready AND nextch = '"' THEN (* " *) +VAR i: INTEGER; +BEGIN StartAndSkip; i := 0; + IF (readstate = ready) & (nextch = '"') THEN (* " *) ReadChar; - WHILE ready & (i < LEN(str)-1) & (nextch >= " ") & (nextch # '"') DO (* " *) - str[i] := nextch; INC(i) + WHILE (readstate = ready) + & (i < LEN(str)-1) + & (nextch >= " ") + & (nextch # '"') DO (* " *) + str[i] := nextch; ReadChar; INC(i) END END; - Done := ready & (i < LEN(str)-1) & (nextch = '"'); (* " *) + Done := (readstate = ready) + & (i < LEN(str)-1) + & (nextch = '"'); (* " *) IF Done THEN ReadChar; str[i] := 0X ELSE @@ -118,11 +141,11 @@ BEGIN Flush; Skip; i := 0; END String; PROCEDURE Name*(VAR name: ARRAY OF CHAR); (* Read filename. Presumably using shell semantics. *) -BEGIN ASSERT(FALSE) (* Not implemented *) +BEGIN HALT(99) (* Not implemented *) END Name; BEGIN - nextch := 0X; - ready := FALSE; - initialized := FALSE; + nextch := 0X; + readstate := pending; + Done := TRUE; END In. diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 52157484..c6429527 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -97,7 +97,7 @@ PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); -(* LongReal(x, n) writes the long real number x to the end of the output stream using an +(* RealP(x, n) writes the long real number x to the end of the output stream using an exponential form. If the textual representation of x requires m characters (including a three-digit signed exponent), x is right adjusted in a ï¬eld of Max(n, m) characters padded with blanks at the left end. A plus sign of the mantissa is not written. diff --git a/src/test/confidence/in/expected b/src/test/confidence/in/expected new file mode 100644 index 00000000..df0db21e --- /dev/null +++ b/src/test/confidence/in/expected @@ -0,0 +1,14 @@ +--- Testing with Oberon 2 variable model --- +chars: Splurdle +integer: 37 +string: "Bert" +line: rest of line +line: another line + + +--- Testing with Component Pascal variable model --- +chars: Splurdle +integer: 37 +string: "Bert" +line: rest of line +line: another line diff --git a/src/test/confidence/in/intest.mod b/src/test/confidence/in/intest.mod new file mode 100644 index 00000000..cb8d2963 --- /dev/null +++ b/src/test/confidence/in/intest.mod @@ -0,0 +1,16 @@ +MODULE intest; +IMPORT Out, In; + +VAR ch: CHAR; i: INTEGER; s: ARRAY 100 OF CHAR; + +BEGIN + In.Char(ch); Out.String("chars: "); + WHILE In.Done & (ch # ".") DO Out.Char(ch); In.Char(ch) END; + Out.Ln; + In.Int(i); IF In.Done THEN Out.String("integer: "); Out.Int(i,1); Out.Ln END; + In.String(s); IF In.Done THEN Out.String('string: "'); Out.String(s); Out.String('"'); Out.Ln END; + In.Line(s); + WHILE In.Done DO + Out.String("line: "); Out.String(s); Out.Ln; In.Line(s) + END +END intest. diff --git a/src/test/confidence/in/test.sh b/src/test/confidence/in/test.sh new file mode 100644 index 00000000..ee738ab4 --- /dev/null +++ b/src/test/confidence/in/test.sh @@ -0,0 +1,16 @@ +#!/bin/sh +. ../testenv.sh +rm -f intest # Remove LSW binary so it doesn't hide Cygwin binary. +echo 'Splurdle.25H "Bert"rest of line'>input +echo another line>>input +$OBECOMP intest.mod -m -O2 +./intest result-O2 +$OBECOMP intest.mod -m -OC +./intest result-OC +echo --- Testing with Oberon 2 variable model --- >result +cat result-O2 >>result +echo "" >>result +echo "" >>result +echo --- Testing with Component Pascal variable model --- >>result +cat result-OC >>result +. ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ffdbded1..c67dfe10 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -197,6 +197,7 @@ runtime: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/In.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod @@ -382,14 +383,15 @@ RUNTEST = COMPILER=$(COMPILER) OBECOMP="$(OBECOMP) -O$(MODEL)" FLAVOUR=$(FLAVOUR confidence: @printf "\n\n--- Confidence tests ---\n\n" cd src/test/confidence/hello; $(RUNTEST) - cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/out; $(RUNTEST) + cd src/test/confidence/in; $(RUNTEST) cd src/test/confidence/math; $(RUNTEST) cd src/test/confidence/intsyntax; $(RUNTEST) cd src/test/confidence/language; $(RUNTEST) + cd src/test/confidence/arrayassignment; $(RUNTEST) cd src/test/confidence/texts; $(RUNTEST) cd src/test/confidence/library; $(RUNTEST) + cd src/test/confidence/isptest; $(RUNTEST) cd src/test/confidence/lola; $(RUNTEST) - cd src/test/confidence/arrayassignment; $(RUNTEST) if [ "$(PLATFORM)" != "windows" ] ; then cd src/test/confidence/signal; $(RUNTEST); fi @printf "\n\n--- Confidence tests passed ---\n\n" From 4f74364b59dcbdf59170563d14dc149dd08ab56b Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 31 Oct 2016 11:47:51 +0000 Subject: [PATCH 103/140] Don't let expected differences between bootstrap and built compiler show as changes. Update Readme. --- ReadMe.md | 68 ++++++++++++++++++++------------- src/tools/make/ignore | 7 ++++ src/tools/make/sourcechanges.sh | 4 +- 3 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 src/tools/make/ignore diff --git a/ReadMe.md b/ReadMe.md index be623b82..50d4d38e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -63,7 +63,7 @@ Also see [Installation](/doc/Installation.md). ## A 'Hello' application -Anything appended to Oberon.Log is automatically displayed on the console, so the +Anything appended to Oberon.Log is automatically written to stdout, so the following conventional Oberon program will display 'Hello.': ```Modula-2 @@ -77,13 +77,13 @@ BEGIN END hello. ``` -Alternatively the Console may be accessed directly as follows: +Alternatively the Oakwood module Out can be used to write directly to stdout: ```Modula-2 MODULE hello; - IMPORT Console; + IMPORT Out; BEGIN - Console.String("Hello."); Console.Ln; + Out.String("Hello."); Out.Ln; END hello. ``` @@ -102,7 +102,7 @@ Also see [Compiling](/doc/Compiling.md). ## Licensing Vishap Oberon's frontend and C backend engine is a fork of Josef Templ’s Ofront, which has been released -under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 environment. +under the FreeBSD License. Unlike Ofront, Vishap Oberon does not include the Oberon v4 GUI environment. The Ulm Oberon Library and the Ooc libraries are distributed under GPL. Proprietry code using these libraries may not be statically linked. @@ -138,20 +138,32 @@ For details, see [Porting](/doc/Porting.md). ## Language support and libraries -Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. +Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. SYSTEM.Mod includes additional functionality and some changes for 64 bit support. -It also supports some features of Oberon-07. +##### Integer and set type sizes: -Vishap Oberon comes with libraries easing the porting of code from the major -Oberon systems: +| Type | -O2 option (default) | -OC option | +| --- | --- | --- | +| SHORTINT | 8 bit | 16 bit | +| INTEGER | 16 bit | 32 bit | +| LONGINT | 32 bit | 64 bit | +| SET | 32 bit | 64 bit | + +##### Libraries + +Included libraries ease porting of code from the major Oberon systems: - Oberon V4 and S3 compatible library set. - - ooc (optimizing oberon-2 compiler) library port. - - Ulm’s Oberon system library port. + - Okwood standard libraries. + - Some other freely redistributable libraries. + +Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations. + + +Vishap Oberon also supports some features of Oberon-07. -Some other freely redistributable libraries are available as a part of voc distribution. See also [Features](/doc/Features.md). @@ -165,25 +177,20 @@ See [Roadmap](/doc/Roadmap.md). ## Contributors -Originally developed as a cross platform implementation of the -Oberon system by Joseph Templ. +Joseph Templ developed ofront as a tool to translate Oberon-2 programs into semantically equivalent +C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. -Updated for 64 bit support, refactored as a standalone compiler and brought -to new platforms by Norayr Chilingarian. +From Joseph's github repository: -Build process simplified for more platform support and bugs fixed by David -C W Brown. +> Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. + +Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems, and . + +David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. ## Origin of the name "Ñ´ishap Oberon" -###### Ñ´ishap - -Vishaps are dragons inhabiting the Armenian Highlands. -We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. - -Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. - -###### Oberon - System and Programming Language +###### Oberon Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -202,6 +209,13 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) +###### Ñ´ishap + +Vishaps are dragons inhabiting the Armenian Highlands. +We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. + +Also, Vishaps are known in tales, fiction. [This page](http://blog.fogus.me/2015/04/27/six-works-of-computer-science-fiction/) refers to some technologies as “computer science fictionâ€. Among them to Oberon. This brings another meaning, Oberon is like aliens, ghosts. And Vishaps. + ## References ###### Oberon @@ -224,4 +238,6 @@ of Einstein and Antoine de Saint-Exupéry: ###### Links - [Niklaus Wirth's personal page at ETH Zurich](https://www.inf.ethz.ch/personal/wirth/) - [ETH Zurich's Wirth publications page](http://www.ethoberon.ethz.ch/WirthPubl/) + - [Joseph Templ's ofront on github](https://hithub.com/jtempl/ofront) + - [Software Templ OG](http://www.software-templ.com) - [Oberon: Steps beyond Pascal and Modula](http://fruttenboel.verhoeven272.nl/Oberon/) diff --git a/src/tools/make/ignore b/src/tools/make/ignore new file mode 100644 index 00000000..f25566d8 --- /dev/null +++ b/src/tools/make/ignore @@ -0,0 +1,7 @@ +^/\* voc + +Configuration_ +OPM_ResourceDir +__MOVE.* cmd, +OPM_(IntSize|PointerSize|Alignment) = +Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) +__COPY\("(gcc|clang|msc|i686-w64-mingw \ No newline at end of file diff --git a/src/tools/make/sourcechanges.sh b/src/tools/make/sourcechanges.sh index 53f7843e..1439ce4e 100644 --- a/src/tools/make/sourcechanges.sh +++ b/src/tools/make/sourcechanges.sh @@ -14,8 +14,8 @@ changes="0" for f in $1/*; do fn=$(basename $f) - egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $f >$fn.old - egrep -v "(^/\* voc +)|Configuration_|OPM_ResourceDir|__MOVE.* cmd, |OPM_(IntSize|PointerSize|Alignment) =|Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp)" $fn >$fn.new + egrep -v -f ../../src/tools/make/ignore $f >$fn.old + egrep -v -f ../../src/tools/make/ignore $fn >$fn.new if ! diff -U 2 -b $fn.old $fn.new >$fn.diff; then echo "" echo "" From 6a9861355fe868ff42eb1074efeef89227c57b84 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 31 Oct 2016 18:51:38 +0000 Subject: [PATCH 104/140] Update features documentation for -O2/-OC --- ReadMe.md | 26 ++--- doc/BasicTypeSize.md | 172 -------------------------------- doc/Features.md | 137 ++++++++++++++++++++++--- doc/Roadmap.md | 150 ---------------------------- src/compiler/OPT.Mod | 3 +- src/runtime/Platformwindows.Mod | 2 +- 6 files changed, 134 insertions(+), 356 deletions(-) delete mode 100644 doc/BasicTypeSize.md delete mode 100644 doc/Roadmap.md diff --git a/ReadMe.md b/ReadMe.md index 50d4d38e..7832f2ea 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,15 +13,15 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ###### Contents -> [Installation](#installation) -> [A 'Hello' application](#a-hello-application) -> [Licensing](#licensing) -> [Platform support and porting](#platform-support-and-porting) -> [Language support and libraries](#language-support-and-libraries) -> [History](#history) -> [Roadmap](#roadmap) -> [Contributors](#contributors) -> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) +> [Installation](#installation) +> [A 'Hello' application](#a-hello-application) +> [Licensing](#licensing) +> [Platform support and porting](#platform-support-and-porting) +> [Language support and libraries](#language-support-and-libraries) +> [History](#history) +> [Roadmap](#roadmap) +> [Contributors](#contributors) +> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) > [References](#references) @@ -171,16 +171,12 @@ See also [Features](/doc/Features.md). See [History](/doc/History.md). -## Roadmap - -See [Roadmap](/doc/Roadmap.md). - ## Contributors Joseph Templ developed ofront as a tool to translate Oberon-2 programs into semantically equivalent -C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. +C programs. It was Copyrighted in 1995, and transferred to the Free BSD license in 2012. -From Joseph's github repository: +From Joseph's github repository: > Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. diff --git a/doc/BasicTypeSize.md b/doc/BasicTypeSize.md deleted file mode 100644 index a6dc52ef..00000000 --- a/doc/BasicTypeSize.md +++ /dev/null @@ -1,172 +0,0 @@ -## Cross Platform Compatibility and Basic Type Sizes in Vishap Oberon - -###### Abstract - -Vishap Oberon needs to support 32 and 64 bit machine architectures. 16 and -possibly 8 bits would be good too. - -Currently Vishap Oberon has different INTEGER, LONGINT and SET sizes on 16 -and 32 bit architectures. While this enables memory management code to use -LONGINT on all architectures, it breaks library and user code which makes -assumptions about type sizes. - -The goal is to specify changes to the Vishap compiler and library to allow C -code generation for multiple machine architectures without breaking existing -code, and to allow serialized data to be interchangeable between machine -architectures. - -###### Motivation - -Current type sizes are loosely specified and vary between implementations. There -are conflicting general assumptions, for example: that LONGINT is large enough -to contain any machine address; but also that LONGINT always take 32 bits when -serialised to files. (See Oakwood guidelines appendix A 1.2.5.4.) - -The compiler has ended up with a number of INTEGER types, each with its own -set of code to handle declaration, access, storage etc. There is a good -opportunity to refactor and simplify the current duplicated code. - -Neither C's basic types, nor Oberon's are fixed in size. Yet for cross platform -compatability we need fixed size types. - -###### Basis of implementation - integers and sets - -In the generated C code we use these types for all integer and set variables: - -| Unsigned | Signed | Sets | -| ----------- | ----------- | ------ | -| INTEGER_U8 | INTEGER_S8 | SET_8 | -| INTEGER_U16 | INTEGER_S16 | SET_16 | -| INTEGER_U32 | INTEGER_S32 | SET_32 | -| INTEGER_U64 | INTEGER_S64 | SET_64 | - -SYSTEM.H uses conditional compilation to derive these types from the types -available in the C compiler we are building on. - -Then, with suitable compiler options we control the mapping of compiler types -to these C types. - -There are three strategies that clients may wish to use: - -1) Emphasizing compatability with serialised data and existing code. Here - we fix Oberon type sizes across platforms, and introduce a new LONG64 type - as follows: - -| Oberon type | Size | -| ----------- | ---------------- | -| BOOLEAN | 8 bits | -| BYTE | 8 bits unsigned | -| SHORTINT | 8 bits signed | -| INTEGER | 16 bits signed | -| LONGINT | 32 bits signed | -| SET | 32 flag bits | -| LONG64 | 64 bits signed | - - This gives a set of sizes that are available on all platforms (even SDCC - supports 64 bit ints), and which have fixed characteristics (e.g. the size of - character array sufficient to support any LONGINT values is fixed.) - - Note that these sizes match current Vishap Oberon behaviour on x86. - -2) Emphasizing performant maxima. Here we make e.g. LONGINT the largest - efficient size available. On x86 we stick with the sizes as above, but for - x64 we make changes to INTEGER, LONGINT and SET as follows: - -| Oberon type | Size on x64 | -| ----------- | ---------------- | -| INTEGER | 32 bits signed | -| LONGINT | 64 bits signed | -| SET | 64 flag bits | - -3) Supporting system code, especially memory management. - - With SYSTEM imported, we extend the parsing of type INTEGER to accept a - subsequent qualifier which may be U8, S8, U16, S16, U32, S32, U64, S64 or - ADDRESS. - - Thus the type `INTEGER ADDRESS` takes over the role of `LONGINT` in existing - memory management code. The compiler will map `INTEGER ADDRESS` to the - relevant `INTEGER_U32` or `INTEGER_U64` in generated C code. - - Additionally the fixed size qualifiers U8, S8, U16, etc. allow the writing of - Oberon source code that generates the same C code regardless of compilation - options used. - -###### Cross platform libraries - -Many integral input parameters are currently coded as LONGINT with the intention -of accepting any size of integer. E.g. Texts.WriteInt. All such code needs -upgrading to accept LONG64 with implementation changes where necessary to -account for the larger values. Boring, but straightforward. - -Some integral output parameter are currently coded as `VAR LONGINT`, for example -the integer value field `i` in RECORD type `Scanner`. This is a problem: - -Assuming scenario 1 - LONGINT is always 32 bits. - - - If retained as LONGINT, Scanner won't be able to handle 64 bit integers. - - If changed to LONG64, existing code will compile with type compatibility - errors. - -So neither option is possible on its own. - -The simplest workaround is to add a new field `l` and a new scanner class -Long64 (similar to the pair of REAL and LONGREAL values already in Scanner). - -Existing code will continue to work with values in the 32 bit range (which is -OK, because that's all the existing code can generate). New code can allow for -thye LongReal case. - -(Ugly but workable). - -Oakwood says that INTEGER must be stored as 2 bytes little endian, so Files.Mod -must use 16 bits on file for Files.ReadInt and Files.WriteInt. So what happens -in scenario 2 above? Since INTEGER is 32 bits in scenario 2, it would be -necessary to call Files.WriteLInt Files.ReadLInt. This is not obvious, and will -need the coder to work around the apparent type incompatibility. - -If only the type compatibility of passing a smaller integer variable to a larger -value parameter also worked for a larger var parameter. - -Would this be possible? - -e.g. - -```Modula-2 - PROCEDURE p(VAR x: LONGINT); BEGIN ... END p; - - PROCEDURE q; - VAR r: INTEGER; - BEGIN p(r) END q; -``` - -q passes an `INTEGER` to the `VAR x: LONGINT` parameter of p. Normally this -would be a type compatability error. - -If we want to defer value range checking until runtime, the compiler would have -to behave as if q was written with a temp LONGINT variable like this: - -```Modula-2 - PROCEDURE q; - VAR r: INTEGER; temp: LONGINT; - BEGIN p(temp); r := SHORT(temp) END q; -``` - -Not simple enough. - - -###### IMPORT SYSTEM - -With SYSTEM imported, we allow the type INTEGER to be followed by a size and -sign specification consiting of a letter (U for unsigned or S for signed) -followed by a numeric bit count which may be 8, 16, 32 or 64. Additionally -INTEGER may be followed by the word ADDRESS to request an unsigned integer type -of the same size as a machine address. - -Thus we could define - -###### Not supported - -This solution does not seek to handle architectures such as the 8086/80286 where -a generalised address is not a single numeric value. TopSpeed Modula handled -this nicely, but we don't go that far. diff --git a/doc/Features.md b/doc/Features.md index e7e8a39d..6ed5d420 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -1,25 +1,130 @@ -#### (Work in progress) +### Features + +#### 32 bit and 64 bit systems vs integer, set and address size. + +The Oberon language specification sets explicit lower bounds on the maximum and minimum +values supported by SHORTINT, INTEGER and LONGINT, and the maximum number of items supported +by SET. + +Most Oberon systems implemented these lower bounds, however a few more recent systems allow +wider ranges of values. + +While it may seem safe to compile code developed on earlier systems with the newer, larger +integer and set types, it is not. Some examples: + + - Code that uses MIN(INTEGER), MAX(INTEGER) etc. as a flag values will run into problems if + it tries to store the flag value to a file using standard library functions. The Oakwood + guidelines specify that INTEGER be stored in 16 bits on file regardless of it's size in + memory*. + + - Code that assumes that INTEGER values wrap around at known values will fail. For example + i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on + systems with a larger SHORTINT representation. + + - Bit manipulation code that uses SYSTEM.VAL to access parts of values will access the + wrong number of bits. For example, the implementation of REAL and LONGREAL library functions + use SYSTEM.VAL(SET, realvalue) to access and change the sign, mantissa and exponent of REALs. + +Therefore we provide compilation options to select the representation of SHORTINT, INTEGER, LONGINT and SET. + +\* It makes sense for Oakwood to insist on fixed sizes for the standard types as this is a pre-requisite +for stable file exchange between different builds of applications, and between different applications following a standard file format. + + +#### Compiler options for integer and set sizes. + +The -O2 and -OC compiler options select nbetween the two most commonly used integer and set +type implementations. + +| Type | -O2 option (default) | -OC option | +| --- | --- | --- | +| SHORTINT | 8 bit | 16 bit | +| INTEGER | 16 bit | 32 bit | +| LONGINT | 32 bit | 64 bit | +| SET | 32 bit | 64 bit | + The following Oberon types are independent of compiler size: -| Types | Size | -| ----- | -------| -| CHAR, SHORTINT | 8 bit | -| REAL | 32 bit | -| LONGREAL | 64 bit | +| Types | Size | +| ----- | -------| +| REAL | 32 bit | +| LONGREAL | 64 bit | +| HUGEINT* | 64 bit | +| CHAR** | 8 bit | -The following type sizes follow the built compiler size: +\* The additional type HUGEINT is predefined as a 64 bit integer, providing 64 bit support even +in -O2 compilations. -| Types | 32 bit builds | 64 bit builds | -| ----- | ------------- | ------------- | -| INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 16 bit | +\** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. + - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. + - Writing systems often require more than one unicode codepoint to represent a single character (and what constitutes a character can vary according to context). + - UTF-8 is now widely used. -HALT/exit code has been simplified. Exit now just calls the system exit API rather than calling the kill API and passing our own process ID. For runtime errors it now displayes the appropriate error message (e.g. Index out of range). - -Compilation errors now include the line number at the start of the displayed source line. The pos (character offset) is still displayed on the error message line. The error handling code was already doing some walking of the source file to find start and end of line - I changed this to walk through the source file from the start identifying line end positions, counting lines and caching the position at the start of the last error line. The resultant code is simpler, and displays the line number without losing the pos. The performance cost of walking the source file is not an issue. +See [UTF-8 Everywhere](http://utf8everywhere.org/) for much more background on this recommendation. - - In his latest specs (around 2013) Wirth removed the 'COPY(a, b)' character array copy procedure, replacing it with 'b := a'. I have accordingly enabled 'b := a' in voc as an alternative to 'COPY(a, b)' (COPY is still supported.). +#### SYSTEM.Mod support for fixed size integers and sets. + +SYSTEM.Mod includes the following additional types: + +| Type | Size | Range | +| --- | --- | --- | +| SYSTEM.INT8 | 8 bit | -128 .. 127 | +| SYSTEM.INT16 | 16 bit | -32,768 .. 32,767 | +| SYSTEM.INT32 | 32 bit | -2,147,483,6478 .. ‭2,147,483,647‬ | +| SYSTEM.INT64 | 64 bit | -‭9,223,372,036,854,775,808 .. ‭9,223,372,036,854,775,807‬ | +| SYSTEM.SET32 | 32 bit | 0 .. 31 | +| SYSTEM.SET64 | 64 bit | 0 .. 63 | + +Integer literals are recognised within the full signed 64 bit integer range MIN(SYSTEM.INT64) to MAX(SYSTEM.INT64). Additionally the parsing of hex notation allows negative values to be entered as a full 16 hex digits with top bit set. For example, -1 may be represented in Oberon source as 0FFFFFFFFFFFFFFFFH. + + +#### The SHORT and LONG functions + +SHORT() of LONGINT and INTEGER values, and LONG() of SHORTINT and INTEGER values behave as +originally specified by Oberon-2. + +In -O2, where LONGINT is 32 bits, LONG() now accepts a LONGINT value returning a HUGEINT value. + +In -OC, where SHORTINT is 16 bits, SHORT() now accepts a SHORTINT value returning a SYSTEM.INT8 value. + + +#### Pointers and Addresses + +Most Oberon systems have implicitly or explicitly assumed that LONGINT is large enough to hold +machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no +longer possible. + +The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. + +The following SYSTEM module predefined functions and procedures now use SYSTEM.ADDRESS instead of LONGINT. + +*Function procedures* + +| Name | Argument types | Result Type | Function | +| ---- | --- | --- | --- | +| SYSTEM.ADR(*v*) | any | SYSTEM.ADDRESS | Address of argument | +| SYSTEM.BIT(*a*, *n*) | *a*: SYSTEM.ADDESS; *n*: integer | BOOLEAN | bit *n* of Mem[*a*] | + +*Proper procedures* + +| Name | Argument types | Function | +| ---- | --- | --- | +| SYSTEM.GET(*a*, *v*) | *a*: SYSTEM.ADDRESS; *v*: any basic type, pointer, procedure type | *v* := Mem[*a*] | +| SYSTEM.PUT(*a*, *x*) | *a*: SYSTEM.ADDRESS; *x*: any basic type, pointer, procedure type | Mem[*a*] := *v* | +| SYSTEM.MOVE(*a0*, *a1*, *n*) | *a0*, *a1*: SYSTEM.ADDRESS; *n*: integer | Mem[*a1*..*a1*+*n*-1] := Mem[*a0*..*a0*+*n*-1] | + +Note that the standard function LEN() still returns LONGINT. + + +#### Runtime error and exit handling + +When passed FALSE, ASSERT displays the message 'Assertion failure.'. If a second, nonzero value is passed to ASSERT it will also be displayed. ASSERT then exits to the OS passing the assert value or zero. + +HALT displays the message 'Terminated by Halt(n)'. For negative values that correspond to a standard runtime error a descriptive string is also printed. Finally Halt exits to the oprerating system passing the error code. + +Bear in mind that both Linux and Windows generally treat the return code as a signed 8 bit value, ignoring higher order bits. Therefore it is best to restrict HALT and ASSERT codes to the range -128 .. 127. + +A client application may register a halt handler by calling Platform.SetHalt(p) where p: PROCEDURE(n: SYSTEM.INT32). This procedure will be called before Halt displays it's message. The procedure may suppress the Halt message by calling Platform.Exit(code: INTEGER) directly. - - Oberon code often writes to Oberon.Log expecting the text to appear on the screen. While voc has an Oberon.DumpLog procedure, I looked into making the behaviour automatic. Interestingly the voc source declares the Text notifier constants replace, insert and delete, but omits implementation of the notifier calls. The implementation turned out to be very little code, and I have used it to echo all text written to Oberon.Log to the console. This has the advantage over DumpLog that text is written immediately rather than only when DumpLog is called, and allows existing program source to work unchanged. diff --git a/doc/Roadmap.md b/doc/Roadmap.md deleted file mode 100644 index 5fac7121..00000000 --- a/doc/Roadmap.md +++ /dev/null @@ -1,150 +0,0 @@ - -#### (Work in progress) - -#### Machine size issues - -I don't see any really good solutions to different machine sizes. Existing code, -such as the libraries, assumes that INTEGER is 16 bit and LONGINT is 32 bit and -so is broken on 64 bit builds of voc. - -Could the implementation of INTnn types help? It would not solve (for example) -the need for a type that always matches address size. Nor would it provide -unsigned types. Implementation of low level memory management needs both. - -Wirth's latest spec includes a BYTE type (not SYSTEM.BYTE, just BYTE) that -behaves as an unsigned 8 bit integer, for use in low level code. BYTE thus -avoids the need for SYSTEM.VAL when manipulating 8 bit unsigned numeric values, -making code easier to write and, more importantly, easier to read. A BYTE type -would be useful for microcontroller C support. So I believe it makes sense to -add Wirths's BYTE to voc. - -Linux/Unix specifies many API datatypes and structure fields in terms of named C -numeric types, with the result that they vary in size between implementations. -This is perhaps the strongest driving force for adding support for various -numeric types to voc - but they would better match the C types than be of fixed -size. - -So maybe one could provide Platform.int, Platform.long, Platform.longlong, -Platform.unsignedint, Platform.unsignedlong, Platform.unsignedlonglong and, -importantly for memory management, Platform.uintptr. - -Personally I miss Pascal and Modula's subrange variables. As well as being great -for error detection (assuming value checking code is generated), they can also -be used to imply variables of arbitrary sizes (e.g. 'VAR mybyte = 0..255;'). -With these one could remove the Platform.int* types and replace them with -constants Platform.MaxInt, Platform.MaxLong etc. I think this would be a cleaner -more generalised option - but maybe, probably, it is a step too far. Always -beware of over-generalising. Wirth found that most programmers did not use, or -very rarely used, subrange types. - -#### More thoughts about 64 bit support and what INTEGER and LONGINT mean - -Arguably, because Oberon says LONGINT is big enough for addresses, -it seems that LONGINT has to be 64 bits on a 64 bit system. - -But I'm having second thoughts. - -There's a lot of code out there that assumes the size of INTEGER and LONGINT -and is broken if they are not 16 and 32 bits respectively. Frustratingly a -lot of the broken code doesn't go wrong until it encounters values outside the -16 and 32 bit ranges - like Texts.WriteInt which handles values up 2**32 fine, -and then aborts the program with an index out of range error when the number -is more than 11 characters long. - -I suggest use of LONGINT for addresses is a small subset of use cases of LONGINT. - -Instead I propose we - - keep INTEGER at 16 bits and LONGINT at 32 bits. - - Add LONG64 for 64 bit signed integers, to be available on both 32 and 64 - bit systems, (quite possible as C has an int64_t on both systems). - - add a SYSTEM.ADDRESS type for address manipulation - - an unsigned type that always matches the machine address size (32, 64 or even 16 bit). - - is compatible with SHORTINT, INTEGER, LONGINT and LONG64. - -It means changing the memory management and platform interface code, but it -means client code does not need changing. - -This fixes the current 16 bit hole in the range of INTEGER types on 64 bit systems. - -#### Oakwood Guidelines on type sizes - -The Oakwood guidelines are interesting. - - - 5.2 requires that e.g. LONGINT is 32 bits *or more*, - -but - - Appendix A 1.2.5.4 requires that MODULE Files *always* reads and writes - LONGINT as 4 bytes. - -The restriction for the Files module makes sense as it is intended to produce -and consume files in a compatible way between platforms. Thus if a system uses -64 bit LONGINT, it is an error (detected or not) to write -to MODULE Files any LONGINT values outside the 32 bit range. - -To put it shockingly, it is an error to write the vast majority of possible -LONGINT values - specifically over 99.998% of LONGINT values are invalid for -MODULE Files. - -I see this as another argument in favour of locking LONGINT down as 32 bits. - -#### It's all the same to C - -It should be possible to make the 32/64 bit compilation a compiler option -available whether the compiler binary itself was built with 32 or 64 bit C. - -Indeed - is there any benefit in a 64 bit compiler binary? A 32 bit compiler -binary will be smaller and faster. The memory requirements of the compiler are -orders of magnitude less than those that would need a 64 bit implementation. - -The only need for a 64 bit compiler binary is for systems that can only run -64 bit binaries. - -Point being - the bit size of the compiler binary should be independent of the -bit size of the target machine of the C code being generated. - -So the compiler options could be: - - 1. Generated binary bit size - 32 or 64 bit. Determines bit size of - SYSTEM.ADDRESS. Add 16 bit option for controllers. - 2. Size of INTEGER, SET and LONGINT. Defaulting to 16,32,32 the parameter would - also allow 32/64/64. - -The libraries would be written and compiled to handle all cases. e.g. - - A WriteInt routine needs it's value parameter to accept integers of all - sizes and would be coded as LONG64. - - ReadInt is slightly more difficult because the parameter is VAR. Make the - parameter ARRAY OF BYTE and process according to SIZE(param). - -#### A feature I'd really like to see - -We should report .Mod file name and line number at fault when exiting abnormally, -e.g. due to index out of range. Followed by a stack trace. - -Wirth's original Pascal (Pascal 6000 on the CDC mainframe at ETHZ) had this at -least by 1975. This could be achieved by including a table of .Mod file line -number vs code address, and having the runtime seach this table for the failure -address. It would be quite a lot of work! - -The current position tracking code in the compiler is buggy - for example the -position at the end of the `expr` in `WHILE expr DO stmt END` is recorded as -the position of the END when it should be of the 'DO'. This makes compiler error -reporting a bit unhelpful, but it's worse for runtime error reporting as we end -up with duplicate entries in the line number table. The position handling code -is somewhat obscure as it uses a convenient but misnamed spare integer field in -the symbol record and it's difficult to follow just when it patches it. - -#### Oberon 07/15 mode - - - Add standard BYTE type being an unsigned integer between 0 and 255. - - Structured value parameters become read-only and get passed the same way as - VAR parameters - i.e. no copying. - - CASE statements only support INTEGER (with low positive values) and CHAR. - - Reject LOOP statements. - - All imported variables are read-only. - -See [Difference between Oberon-07 and Oberon](https://www.inf.ethz.ch/personal/wirth/Oberon/Oberon07.pdf). - -#### To be left out? - -Work on other compatibility layers is in progress. -voc team also works on bindings to existing C/Pascal libraries. diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 93db3e5e..c2e7412f 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1323,13 +1323,12 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); - syslink := topScope^.right; + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); -(*EnterTyp("SET", Set, -1, settyp);*) (* Size set in Compiler.PropagateElementaryTypeSize *) EnterTyp("REAL", Real, 4, realtyp); EnterTyp("LONGREAL", LReal, 8, lrltyp); EnterTyp("HUGEINT", Int, 8, hinttyp); diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 65c97d24..bc9e4fd3 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -545,7 +545,7 @@ BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; PROCEDURE DisplayHaltCode(code: LONGINT); BEGIN CASE code OF - | -1: errstring("Rider ReadBuf/WriteBuf transfer size longer than buffer.") + | -1: errstring("Assertion failure.") | -2: errstring("Index out of range.") | -3: errstring("Reached end of function without reaching RETURN.") | -4: errstring("CASE statement: no matching label and no ELSE.") From c63bc9e093dc8fc43ffa769ac3641886379e8eee Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 1 Nov 2016 11:58:54 +0000 Subject: [PATCH 105/140] Fix readme table of contents layout. --- ReadMe.md | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 7832f2ea..fc974684 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,18 +11,18 @@ Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -###### Contents +#### Contents -> [Installation](#installation) -> [A 'Hello' application](#a-hello-application) -> [Licensing](#licensing) -> [Platform support and porting](#platform-support-and-porting) -> [Language support and libraries](#language-support-and-libraries) -> [History](#history) -> [Roadmap](#roadmap) -> [Contributors](#contributors) -> [Origin of the name "Ñ´ishap Oberon"](#origin-of-the-name-Ñ´ishap-oberon) -> [References](#references) +    [**Installation**](#installation)
+    [**A 'Hello' application**](#a-hello-application)
+    [**Licensing**](#licensing)
+    [**Platform support and porting**](#platform-support-and-porting)
+    [**Language support and libraries**](#language-support-and-libraries)
+    [**History**](#history)
+    [**Roadmap**](#roadmap)
+    [**Contributors**](#contributors)
+    [**Origin of the name "Ñ´ishap Oberon"**](#origin-of-the-name-Ñ´ishap-oberon)
+    [**References**](#references)
## Installation @@ -37,7 +37,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. | Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | | Darwin | type 'git' at the command line and accept the prompt to install it. | -More details, including for MingW and MS C, in [Installation](/doc/Installation.md). +More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). ###### Build and install @@ -59,7 +59,7 @@ by make full, e.g. | Windows | See [Installation](/doc/Installation.md) | | Termux | `export PATH="/data/data/com.termux/files/opt/voc/bin:$PATH"` | -Also see [Installation](/doc/Installation.md). +Also see [**Installation**](/doc/Installation.md). ## A 'Hello' application @@ -97,7 +97,7 @@ executable binary. Execute as usual on Linux ('./hello') or Windows ('hello'). -Also see [Compiling](/doc/Compiling.md). +Also see [**Compiling**](/doc/Compiling.md). ## Licensing @@ -134,7 +134,7 @@ In some cases manual work will be required: necessary to implement a new variant of Platform.Mod providing the same interface as Platformunix.Mod and Platform Windows.Mod. -For details, see [Porting](/doc/Porting.md). +For details, see [**Porting**](/doc/Porting.md). ## Language support and libraries @@ -165,11 +165,8 @@ Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, O Vishap Oberon also supports some features of Oberon-07. -See also [Features](/doc/Features.md). +See also [**Features**](/doc/Features.md). -## History - -See [History](/doc/History.md). ## Contributors From 668c2ef508ba062913678244667b895ee390884a Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 2 Nov 2016 12:12:59 +0000 Subject: [PATCH 106/140] Minor documentation updates. --- ReadMe.md | 27 +++++++++++++-------------- doc/Porting.md | 40 +++++++++------------------------------- 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index fc974684..fa3f6ffe 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -121,20 +121,19 @@ It compiles under gcc, clang and Microsoft Visual C. Installation supports GNU/Linux, MAC OSX, BSD and Windows (native and cygwin). A C program (src/tools/make/configure.c) detects the details of the C compiler -and operating system on which it is running. In most cases it will automatically -determine all that is needed for the port to a new platform. and 'make full' -will just work. +and operating system on which it is running. -In some cases manual work will be required: +The following systems are recognised: - - If configure.c cannot recognise the operating system on which it is running - a few lines will need to be added to detect and set the make variables - correctly. - - If porting to a system that does not provide a Unix style API, it will be - necessary to implement a new variant of Platform.Mod providing the same - interface as Platformunix.Mod and Platform Windows.Mod. + - Linux, including Ubuntu and Centos derivatives. + - The BSDs, including OpenBSD and FreeBSD. + - Cygwin under Windows, MingW under Cygwin, Bash on Ubuntu on Windows. + +Additionally a Windows .cmd is provided for building with Microsoft C. + +For details, including how to add support for unrecognised systems, see +[**Porting**](/doc/Porting.md). -For details, see [**Porting**](/doc/Porting.md). ## Language support and libraries @@ -154,9 +153,9 @@ Vishap Oberon supports the Oberon 2 programming language, including type-bound p Included libraries ease porting of code from the major Oberon systems: - Oberon V4 and S3 compatible library set. - - ooc (optimizing oberon-2 compiler) library port. + - Ooc (optimizing oberon-2 compiler) library port. - Ulm’s Oberon system library port. - - Okwood standard libraries. + - Oakwood standard libraries. - Some other freely redistributable libraries. Oakwood libraries are supported for both -O2 and -OC options, whereas the ULM, OOC and ETH system 3 libraries are only available on -O2 (default) compilations. @@ -177,7 +176,7 @@ From Joseph's github repository: > Design and implementation of ofront is due to Josef Templ ... ofront has been based in part on Regis Crelier's PhD thesis and Stefan Gehring's diploma thesis, both at ETH Zurich, Institute for Computer Systems. -Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems, and . +Norayr Chilingarian forked ofront in 2013, porting extensive libraries from [ULM Oberon](http://www.mathematik.uni-ulm.de/oberon/), [OO2C](https://github.com/Spirit-of-Oberon/oo2c) and ETH Oberon System 3, and adding support for more platforms including 64 bit systems. David Brown has worked on adding support for more platforms incuding windows using MSC, cygwin or mingw since January 2016. More recently he has generalised basic type support within the compiler to allow e.g. 64 bit LONGINT on 32 bit systems, and 32 bit LONGINT on 64 bit systems. diff --git a/doc/Porting.md b/doc/Porting.md index 94707e04..8bb2e74e 100644 --- a/doc/Porting.md +++ b/doc/Porting.md @@ -1,8 +1,6 @@ -#### (Work in progress) - ### Porting to a new platform -Porting to a new 32 or 64 bits platform is usually automatically handled +Porting to a new 32 or 64 bit platform is usually automatically handled by `make full`: - The makefile compiles `src/tools/make/configure.c` with the @@ -13,7 +11,7 @@ by `make full`: operating system it is running on and what the appropriate installation directory will be. - `configure.c` sets makefile variables that are used to select - which of 5 sets of preprepared C source files to build to create + which of 5 sets of pre-prepared C source files to build to create the bootstrap compiler. On most systems this will be sufficient for `make full` to build @@ -23,10 +21,11 @@ and install the compiler and libraries. `--- Branch v2docs freebsd gcc LP64 confidence tests passed ---` + #### Updating configure.c -It should only be necessary to change `configure.c` if it -cannot determine the correct install directory. +Most likely you will only need to change `configure.c` if it cannot determine +the correct install directory. In this case add code to `src/tools/make/configure.c`'s function `determineOS()` to set the `os` variable to the name @@ -41,7 +40,7 @@ variable | set to | example `binext` | Binary file extension | `""` `staticlink` | Static linking option | `"-static"` -If your new platform does not support static removing, set the +If your new platform does not support static linking, set the `staticlink` variable to `""`. Then modify `determineInstallDirectory()` to select the correct @@ -53,28 +52,7 @@ to the Windows API (`Platformwindows.Mod`), and one suitable for Unix-like systems including Linux, BSD, Android and cygwin (`Platformunix.Mod`). +If you are porting to a system that does not provide a Unix style API, it will +be necessary to implement a new variant of Platform.Mod providing the same +interface as Platformunix.Mod and Platform Windows.Mod. -#### How to add a new compiler option - - - Define it in OPM as a constant before defopt is defined. - - Define a BOOLEAN variable in OPM which will describe if setting is set. - - Add handling of a new option in OPM.ScanOptions - - Set your BOOLEAN value in OPM.OpenPari (or in ScanOptions, after the - CASE) so you can check it later. - - Check your boolean when necessary, (see useParFile in OPM.GetOptions) - - Add it in OPC.GenHeaderMsg function. - -#### Known bugs - -When using SYSTEM.LSH(s, n) where s is SET, -the C compiler generates an error like -`error: duplicate 'unsigned'`, -that's because SET is defined as unsigned in SYSTEM.h, -while LSH is defined in SYSTEM.h as ((t)((unsigned t)(x)<<(n))), -and it makes not possible to make SYSTEM.LSH with type SET. - -I don't want to prohibit it at the parser level -because C backend is only one of possible backends. - -The solution currently is to cast set type to longint before lsh-ing it. -And then casting it back to set if necessary. From 1935f63cd6835714b5a66799267123270e35263c Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 2 Nov 2016 12:59:51 +0000 Subject: [PATCH 107/140] Fix ABS in SYSTEM.h and fix tools/make/ignore. --- src/runtime/SYSTEM.h | 2 +- src/tools/make/ignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index cb7c8815..4600fe8b 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -202,7 +202,7 @@ extern int64 SYSTEM_ENTIER (double x); static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} -#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ABSFD(x) SYSTEM_ABSD(x) diff --git a/src/tools/make/ignore b/src/tools/make/ignore index f25566d8..1f2cafbe 100644 --- a/src/tools/make/ignore +++ b/src/tools/make/ignore @@ -4,4 +4,4 @@ OPM_ResourceDir __MOVE.* cmd, OPM_(IntSize|PointerSize|Alignment) = Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) -__COPY\("(gcc|clang|msc|i686-w64-mingw \ No newline at end of file +__COPY\("(gcc|clang|msc|i686-w64-mingw) From baeb2db81f50bbd42dee69963082b7a04a4cc3ca Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 11:48:33 +0000 Subject: [PATCH 108/140] Uppercase internal SYSTEM.H types address, int*, uint*. Phase 1. --- ReadMe.md | 10 +- bootstrap/SYSTEM.c | 75 +++--- bootstrap/SYSTEM.h | 162 ++++++------ bootstrap/unix-44/Compiler.c | 14 +- bootstrap/unix-44/Configuration.c | 12 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 234 +++++++++--------- bootstrap/unix-44/Files.h | 68 ++--- bootstrap/unix-44/Heap.c | 266 ++++++++++---------- bootstrap/unix-44/Heap.h | 16 +- bootstrap/unix-44/Modules.c | 26 +- bootstrap/unix-44/Modules.h | 14 +- bootstrap/unix-44/OPB.c | 166 ++++++------- bootstrap/unix-44/OPB.h | 22 +- bootstrap/unix-44/OPC.c | 241 +++++++++--------- bootstrap/unix-44/OPC.h | 20 +- bootstrap/unix-44/OPM.c | 198 +++++++-------- bootstrap/unix-44/OPM.h | 50 ++-- bootstrap/unix-44/OPP.c | 106 ++++---- bootstrap/unix-44/OPP.h | 4 +- bootstrap/unix-44/OPS.c | 60 ++--- bootstrap/unix-44/OPS.h | 8 +- bootstrap/unix-44/OPT.c | 278 ++++++++++----------- bootstrap/unix-44/OPT.h | 58 ++--- bootstrap/unix-44/OPV.c | 84 +++---- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 82 +++---- bootstrap/unix-44/Out.h | 10 +- bootstrap/unix-44/Platform.c | 252 +++++++++---------- bootstrap/unix-44/Platform.h | 104 ++++---- bootstrap/unix-44/Reals.c | 70 +++--- bootstrap/unix-44/Reals.h | 16 +- bootstrap/unix-44/Strings.c | 56 ++--- bootstrap/unix-44/Strings.h | 14 +- bootstrap/unix-44/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-44/Texts.h | 114 ++++----- bootstrap/unix-44/VT100.c | 98 ++++---- bootstrap/unix-44/VT100.h | 36 +-- bootstrap/unix-44/errors.c | 10 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 12 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 14 +- bootstrap/unix-48/Configuration.c | 12 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 234 +++++++++--------- bootstrap/unix-48/Files.h | 68 ++--- bootstrap/unix-48/Heap.c | 266 ++++++++++---------- bootstrap/unix-48/Heap.h | 16 +- bootstrap/unix-48/Modules.c | 26 +- bootstrap/unix-48/Modules.h | 14 +- bootstrap/unix-48/OPB.c | 166 ++++++------- bootstrap/unix-48/OPB.h | 22 +- bootstrap/unix-48/OPC.c | 241 +++++++++--------- bootstrap/unix-48/OPC.h | 20 +- bootstrap/unix-48/OPM.c | 198 +++++++-------- bootstrap/unix-48/OPM.h | 50 ++-- bootstrap/unix-48/OPP.c | 106 ++++---- bootstrap/unix-48/OPP.h | 4 +- bootstrap/unix-48/OPS.c | 60 ++--- bootstrap/unix-48/OPS.h | 8 +- bootstrap/unix-48/OPT.c | 278 ++++++++++----------- bootstrap/unix-48/OPT.h | 58 ++--- bootstrap/unix-48/OPV.c | 84 +++---- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 82 +++---- bootstrap/unix-48/Out.h | 10 +- bootstrap/unix-48/Platform.c | 252 +++++++++---------- bootstrap/unix-48/Platform.h | 104 ++++---- bootstrap/unix-48/Reals.c | 70 +++--- bootstrap/unix-48/Reals.h | 16 +- bootstrap/unix-48/Strings.c | 56 ++--- bootstrap/unix-48/Strings.h | 14 +- bootstrap/unix-48/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-48/Texts.h | 116 ++++----- bootstrap/unix-48/VT100.c | 98 ++++---- bootstrap/unix-48/VT100.h | 36 +-- bootstrap/unix-48/errors.c | 10 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 12 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 14 +- bootstrap/unix-88/Configuration.c | 12 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 234 +++++++++--------- bootstrap/unix-88/Files.h | 72 +++--- bootstrap/unix-88/Heap.c | 268 ++++++++++---------- bootstrap/unix-88/Heap.h | 16 +- bootstrap/unix-88/Modules.c | 26 +- bootstrap/unix-88/Modules.h | 14 +- bootstrap/unix-88/OPB.c | 166 ++++++------- bootstrap/unix-88/OPB.h | 22 +- bootstrap/unix-88/OPC.c | 241 +++++++++--------- bootstrap/unix-88/OPC.h | 20 +- bootstrap/unix-88/OPM.c | 198 +++++++-------- bootstrap/unix-88/OPM.h | 50 ++-- bootstrap/unix-88/OPP.c | 106 ++++---- bootstrap/unix-88/OPP.h | 4 +- bootstrap/unix-88/OPS.c | 60 ++--- bootstrap/unix-88/OPS.h | 8 +- bootstrap/unix-88/OPT.c | 280 ++++++++++----------- bootstrap/unix-88/OPT.h | 58 ++--- bootstrap/unix-88/OPV.c | 84 +++---- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 82 +++---- bootstrap/unix-88/Out.h | 10 +- bootstrap/unix-88/Platform.c | 252 +++++++++---------- bootstrap/unix-88/Platform.h | 104 ++++---- bootstrap/unix-88/Reals.c | 70 +++--- bootstrap/unix-88/Reals.h | 16 +- bootstrap/unix-88/Strings.c | 56 ++--- bootstrap/unix-88/Strings.h | 14 +- bootstrap/unix-88/Texts.c | 354 +++++++++++++-------------- bootstrap/unix-88/Texts.h | 118 ++++----- bootstrap/unix-88/VT100.c | 98 ++++---- bootstrap/unix-88/VT100.h | 36 +-- bootstrap/unix-88/errors.c | 10 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 12 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 14 +- bootstrap/windows-48/Configuration.c | 12 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 234 +++++++++--------- bootstrap/windows-48/Files.h | 68 ++--- bootstrap/windows-48/Heap.c | 266 ++++++++++---------- bootstrap/windows-48/Heap.h | 16 +- bootstrap/windows-48/Modules.c | 26 +- bootstrap/windows-48/Modules.h | 14 +- bootstrap/windows-48/OPB.c | 166 ++++++------- bootstrap/windows-48/OPB.h | 22 +- bootstrap/windows-48/OPC.c | 241 +++++++++--------- bootstrap/windows-48/OPC.h | 20 +- bootstrap/windows-48/OPM.c | 198 +++++++-------- bootstrap/windows-48/OPM.h | 50 ++-- bootstrap/windows-48/OPP.c | 106 ++++---- bootstrap/windows-48/OPP.h | 4 +- bootstrap/windows-48/OPS.c | 60 ++--- bootstrap/windows-48/OPS.h | 8 +- bootstrap/windows-48/OPT.c | 278 ++++++++++----------- bootstrap/windows-48/OPT.h | 58 ++--- bootstrap/windows-48/OPV.c | 84 +++---- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 82 +++---- bootstrap/windows-48/Out.h | 10 +- bootstrap/windows-48/Platform.c | 310 +++++++++++------------ bootstrap/windows-48/Platform.h | 110 ++++----- bootstrap/windows-48/Reals.c | 70 +++--- bootstrap/windows-48/Reals.h | 16 +- bootstrap/windows-48/Strings.c | 56 ++--- bootstrap/windows-48/Strings.h | 14 +- bootstrap/windows-48/Texts.c | 354 +++++++++++++-------------- bootstrap/windows-48/Texts.h | 116 ++++----- bootstrap/windows-48/VT100.c | 98 ++++---- bootstrap/windows-48/VT100.h | 36 +-- bootstrap/windows-48/errors.c | 10 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 12 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 14 +- bootstrap/windows-88/Configuration.c | 12 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 234 +++++++++--------- bootstrap/windows-88/Files.h | 72 +++--- bootstrap/windows-88/Heap.c | 268 ++++++++++---------- bootstrap/windows-88/Heap.h | 16 +- bootstrap/windows-88/Modules.c | 26 +- bootstrap/windows-88/Modules.h | 14 +- bootstrap/windows-88/OPB.c | 166 ++++++------- bootstrap/windows-88/OPB.h | 22 +- bootstrap/windows-88/OPC.c | 241 +++++++++--------- bootstrap/windows-88/OPC.h | 20 +- bootstrap/windows-88/OPM.c | 198 +++++++-------- bootstrap/windows-88/OPM.h | 50 ++-- bootstrap/windows-88/OPP.c | 106 ++++---- bootstrap/windows-88/OPP.h | 4 +- bootstrap/windows-88/OPS.c | 60 ++--- bootstrap/windows-88/OPS.h | 8 +- bootstrap/windows-88/OPT.c | 280 ++++++++++----------- bootstrap/windows-88/OPT.h | 58 ++--- bootstrap/windows-88/OPV.c | 84 +++---- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 82 +++---- bootstrap/windows-88/Out.h | 10 +- bootstrap/windows-88/Platform.c | 310 +++++++++++------------ bootstrap/windows-88/Platform.h | 110 ++++----- bootstrap/windows-88/Reals.c | 70 +++--- bootstrap/windows-88/Reals.h | 16 +- bootstrap/windows-88/Strings.c | 56 ++--- bootstrap/windows-88/Strings.h | 14 +- bootstrap/windows-88/Texts.c | 354 +++++++++++++-------------- bootstrap/windows-88/Texts.h | 118 ++++----- bootstrap/windows-88/VT100.c | 98 ++++---- bootstrap/windows-88/VT100.h | 36 +-- bootstrap/windows-88/errors.c | 10 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 12 +- bootstrap/windows-88/extTools.h | 2 +- doc/Features.md | 45 ++-- src/compiler/OPC.Mod | 57 +++-- src/compiler/OPV.Mod | 2 +- src/runtime/Platformunix.Mod | 8 +- src/runtime/Platformwindows.Mod | 44 ++-- src/runtime/SYSTEM.c | 75 +++--- src/runtime/SYSTEM.h | 160 ++++++------ 205 files changed, 8388 insertions(+), 8311 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index fa3f6ffe..30d63d60 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -27,7 +27,10 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. ## Installation -###### Prerequisites +While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries +with the following simple steps. + +###### 1. Install prerequisites | Platform | Packages | | --------- | ------------ | @@ -39,7 +42,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). -###### Build and install +###### 2. Build and install the compiler and libraries 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` @@ -47,7 +50,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -###### PATH environment variable +###### 3. Stet your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. @@ -61,6 +64,7 @@ by make full, e.g. Also see [**Installation**](/doc/Installation.md). + ## A 'Hello' application Anything appended to Oberon.Log is automatically written to stdout, so the diff --git a/bootstrap/SYSTEM.c b/bootstrap/SYSTEM.c index b97144e7..a1b2cb14 100644 --- a/bootstrap/SYSTEM.c +++ b/bootstrap/SYSTEM.c @@ -24,7 +24,7 @@ -int64 SYSTEM_DIV(int64 x, int64 y) +INT64 SYSTEM_DIV(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -35,7 +35,7 @@ int64 SYSTEM_DIV(int64 x, int64 y) else {return (-x)/(-y);} } -int64 SYSTEM_MOD(int64 x, int64 y) +INT64 SYSTEM_MOD(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -46,31 +46,20 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -// LONGINT SYSTEM_ENTIER(double x) -// { -// LONGINT y; -// if (x >= 0) -// return (LONGINT)x; -// else { -// y = (LONGINT)x; -// if (y <= x) return y; else return y - 1; -// } -// } - -int64 SYSTEM_ENTIER(double x) +INT64 SYSTEM_ENTIER(double x) { - int64 y; + INT64 y; if (x >= 0) - return (int64)x; + return (INT64)x; else { - y = (int64)x; + y = (INT64)x; if (y <= x) return y; else return y - 1; } } -void SYSTEM_INHERIT(address *t, address *t0) +void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0) { t -= __TPROC0OFF; t0 -= __TPROC0OFF; @@ -78,23 +67,23 @@ void SYSTEM_INHERIT(address *t, address *t0) } -void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)()) { while (n > 0) { - P((address)(*((void**)(adr)))); + P((ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } } -void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()) { - address *t, off; + ADDRESS *t, off; typ++; while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -103,19 +92,19 @@ void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, address); nofdim--; + nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(address); - if (elemalgn > sizeof(address)) { + dataoff = nofdyn * sizeof(ADDRESS); + if (elemalgn > sizeof(ADDRESS)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -125,37 +114,37 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (address*)POINTER__typ) { + else if (typ == (ADDRESS*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(address)); - p = (address*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} - *p = - (nofelems + 1) * sizeof(address); /* sentinel */ - x[-1] -= nofelems * sizeof(address); + while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;} + *p = - (nofelems + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nofelems * sizeof(ADDRESS); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(address)); - p = (address*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(address); /* sentinel */ - x[-1] -= nptr * sizeof(address); + *p = - (nptr + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nptr * sizeof(ADDRESS); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); @@ -165,7 +154,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 @@ -177,7 +166,7 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, address h) { + void SystemSetHandler(int s, ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -216,12 +205,12 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(address h) { + void SystemSetInterruptHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(address h) { + void SystemSetQuitHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index cb7c8815..481cded9 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -33,22 +33,22 @@ void *alloca(size_t size); #if defined (o__64) && !defined(_WIN64) // LP64 - typedef long int64; - typedef unsigned long uint64; + typedef long INT64; + typedef unsigned long UINT64; #else // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; + typedef long long INT64; + typedef unsigned long long UINT64; #endif -typedef int int32; -typedef unsigned int uint32; +typedef int INT32; +typedef unsigned int UINT32; -typedef short int int16; -typedef unsigned short int uint16; +typedef short int INT16; +typedef unsigned short int UINT16; -typedef signed char int8; -typedef unsigned char uint8; +typedef signed char INT8; +typedef unsigned char UINT8; // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -63,29 +63,41 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type +#define POINTER__typ ((ADDRESS*)(1)) // not NIL and not a valid type // Oberon types -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 CHAR; +typedef INT8 BOOLEAN; +typedef INT8 SYSTEM_BYTE; +typedef UINT8 CHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// 'address' is a synonym for an int of pointer size +// 'ADDRESS' is a synonym for an integer of pointer size #if defined (o__64) - #define address int64 + #define ADDRESS INT64 #else - #define address int32 + #define ADDRESS INT32 #endif +// Temporary build support - which changing lowercase int* and address to uppercase + +#define int8 INT8 +#define int16 INT16 +#define int32 INT32 +#define int64 INT64 +#define uint8 UINT8 +#define uint16 UINT16 +#define uint32 UINT32 +#define uint64 UINT64 +#define address ADDRESS + @@ -96,30 +108,30 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); +extern ADDRESS Platform_OSAllocate (ADDRESS size); +extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(int32 x); -extern void Platform_AssertFail(int32 x); +extern void Platform_Halt(INT32 x); +extern void Platform_AssertFail(INT32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) // Index checking -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} #define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -129,10 +141,10 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, address h); + extern void SystemSetHandler(int s, ADDRESS h); #else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); + extern void SystemSetInterruptHandler(ADDRESS h); + extern void SystemSetQuitHandler (ADDRESS h); #endif @@ -140,7 +152,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - int64 i = 0; + INT64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -164,8 +176,8 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x +#define __GET(a, x, t) x=*(t*)(ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x #define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) #define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) @@ -175,34 +187,34 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) +#define __ASHL(x, n) ((INT64)(x)<<(n)) +#define __ASHR(x, n) ((INT64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) +static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((INT64)(x), (INT64)(n)) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n) -extern int64 SYSTEM_DIV(int64 x, int64 y); +extern INT64 SYSTEM_DIV(INT64 x, INT64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) -extern int64 SYSTEM_MOD(int64 x, int64 y); +extern INT64 SYSTEM_MOD(INT64 x, INT64 y); #define __MODF(x, y) SYSTEM_MOD(x, y) #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern int64 SYSTEM_ENTIER (double x); +extern INT64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) -static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} -static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} -#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(i) : SYSTEM_ABS64(i)) +static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;} +static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;} +#define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __ABSFD(x) SYSTEM_ABSD(x) @@ -216,7 +228,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) @@ -227,8 +239,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) (*(((address**)(p))-1)) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ) +#define __TYPEOF(p) (*(((ADDRESS**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) @@ -257,67 +269,67 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(int32 argc, address argv); +extern void Platform_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); +extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size); +extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag); +extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) -#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len)) +#define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(address *t, address *t0); -extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); +extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0); +extern void SYSTEM_ENUMP (void *adr, ADDRESS n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - address tproc[m]; /* Proc for each ptr field */ \ - address tag; \ - address next; /* Module table type list points here */ \ - address level; \ - address module; \ + ADDRESS tproc[m]; /* Proc for each ptr field */ \ + ADDRESS tag; \ + ADDRESS next; /* Module table type list points here */ \ + ADDRESS level; \ + ADDRESS module; \ char name[24]; \ - address basep[__MAXEXT]; /* List of bases this extends */ \ - address reserved; \ - address blksz; /* xxx_typ points here */ \ - address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + ADDRESS basep[__MAXEXT]; /* List of bases this extends */ \ + ADDRESS reserved; \ + ADDRESS blksz; /* xxx_typ points here */ \ + ADDRESS ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (ADDRESS)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (address*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ - t##__desc.basep[level] = (address)t##__typ; \ - t##__desc.module = (address)m; \ + t##__typ = (ADDRESS*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS)); \ + t##__desc.basep[level] = (ADDRESS)t##__typ; \ + t##__desc.module = (ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ - Heap_REGTYP(m, (address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \ + Heap_REGTYP(m, (ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ddeec08e..998a53d3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 8f575f62..93b5757c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index abf8a8f1..37631f98 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5c021003..f130d638 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - int32 written; + INT32 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 18456e59..ff45e732 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 02d87d28..92b17de0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index be04a384..19f2a2f5 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,22 +84,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -108,64 +108,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ddeec08e..998a53d3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 8f575f62..93b5757c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[216]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index f55e7e01..3340bb93 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5c021003..f130d638 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - int32 written; + INT32 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 18456e59..ff45e732 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 961ebbe7..ac0a3850 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 891c877a..f2c8d90e 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; - int64 _prvt0; + INT64 _prvt0; char _prvt1[24]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 686dbfbf..d5fefc27 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 06ca3f58..47c54d97 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,61 +10,61 @@ typedef typedef struct Files_FileDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[208]; - int32 fd; + INT32 fd; char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; - int64 _prvt0; + INT64 _prvt0; char _prvt1[8]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 5117800b..a162ea04 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + INT64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int64 types; + INT64 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; -export int64 Heap_allocated; +static INT64 Heap_freeList[10]; +static INT64 Heap_bigBlocks; +export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static INT64 Heap_heap, Heap_heapend; +export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (INT64 q); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT64 size); +export SYSTEM_PTR Heap_NEWREC (INT64 tag); +static INT64 Heap_NewChunk (INT64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, INT64 typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, INT64); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static INT64 Heap_NewChunk (INT64 blksz) { - int64 chnk; + INT64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 8, chnk + (24 + blksz), INT64); + __PUT(chnk + 24, chnk + 32, INT64); + __PUT(chnk + 32, blksz, INT64); + __PUT(chnk + 40, -8, INT64); + __PUT(chnk + 48, Heap_bigBlocks, INT64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (INT64 blksz) { - int64 size, chnk, j, next; + INT64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int64); + __GET(j, next, INT64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int64); + __GET(j, next, INT64); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, INT64); + __PUT(j, chnk, INT64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, int64); + __GET(chnk + 8, Heap_heapend, INT64); } } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (INT64 tag) { - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int64); + __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } } if (i < 9) { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) return NIL; } } - __GET(adr + 8, t, int64); + __GET(adr + 8, t, INT64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, int64); + __GET(adr + 24, adr, INT64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, INT64); } else { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, INT64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, INT64); + __PUT(i + 8, 0, INT64); + __PUT(i + 16, 0, INT64); + __PUT(i + 24, 0, INT64); i += 32; } - __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 24, 0, INT64); + __PUT(adr, tag, INT64); + __PUT(adr + 8, 0, INT64); + __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 8); } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (INT64 size) { - int64 blksz, tag; + INT64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((int64)(address)new + blksz) - 24; - __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); - __PUT(tag + 8, -8, int64); - __PUT((int64)(address)new - 8, tag, int64); + tag = ((INT64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, INT64); + __PUT(tag, blksz, INT64); + __PUT(tag + 8, -8, INT64); + __PUT((INT64)(address)new - 8, tag, INT64); Heap_Unlock(); return new; } -static void Heap_Mark (int64 q) +static void Heap_Mark (INT64 q) { - int64 p, tag, offset, fld, n, tagbits; + INT64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, int64); + __GET(q - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, INT64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); + __GET(tag, offset, INT64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __PUT(q - 8, (tag + offset) + 1, INT64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, int64); + __GET(q - 8, tag, INT64); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, INT64); fld = q + offset; - __GET(fld, p, int64); + __GET(fld, p, INT64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int64); + __GET(fld, n, INT64); if (n != 0) { - __GET(n - 8, tagbits, int64); + __GET(n - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, INT64); + __PUT(q - 8, tag + 1, INT64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(address)p); + Heap_Mark((INT64)(address)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + INT64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, int64); + __GET(chnk + 8, end, INT64); while (adr < end) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int64); - __GET(tag, size, int64); + __PUT(adr, tag, INT64); + __GET(tag, size, INT64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) { - int64 i, j, x; + INT64 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) { - int64 l, r, x; + INT64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, int64); + __GET(chnk + 8, lim1, INT64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { - __GET(tag - 1, size, int64); + __GET(tag - 1, size, INT64); adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + INT64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, int64); + __GET(n->obj - 8, tag, INT64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + INT64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,9 +591,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, INT64); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == (int64)cand__len) { + if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -613,8 +613,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(address)obj; + f->obj = (INT64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, int64); - __PUT(Heap_heap, 0, int64); + __GET(Heap_heap + 8, Heap_heapend, INT64); + __PUT(Heap_heap, 0, INT64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index b0c90472..0b6a9d03 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[56]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT64 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (INT64 size); +import SYSTEM_PTR Heap_NEWREC (INT64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, INT64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 97e17ad2..39e2d6ca 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5b67d672..46b6c33e 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 615109df..3eabde0b 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 48352c94..e1405ce9 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -404,11 +404,11 @@ OPT_Node OPT_NewNode (int8 class) OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 452a1182..ee84e643 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 0f0b9f79..04b1e484 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(1, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(1, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 22ecf90b..3e3c2992 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + INT64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, index, mtime; + INT32 volume, index, mtime; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT64 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[256]; -export int16 Platform_ArgCount; -export int64 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int64 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT64 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT64 Platform_OSAllocate (INT64 size); +export void Platform_OSFree (INT64 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 offset, int16 whence); +export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 l); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int64 p, int32 l); -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 l); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -127,7 +127,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (ADDRESS)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -147,13 +147,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(address)(p), l) +#define Platform_readfile(fd, p, l) (LONGINT)read(fd, (void*)(ADDRESS)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (address)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (ADDRESS)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -170,63 +170,63 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(ADDRESS)(p), l) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_EMFILE() || e == Platform_ENFILE(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_EXDEV(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return (e == Platform_EACCES() || e == Platform_EROFS()) || e == Platform_EAGAIN(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ENOENT(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int64 Platform_OSAllocate (int64 size) +INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); } -void Platform_OSFree (int64 address) +void Platform_OSFree (INT64 address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (INT32 argc, INT64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -254,7 +254,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -263,10 +263,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -274,11 +274,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -289,9 +289,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -319,57 +319,57 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) Platform_sethandler(4, handler); } -static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_gettimeval(); Platform_sectotm(Platform_tvsec()); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_gettimeval(); *sec = Platform_tvsec(); *usec = Platform_tvusec(); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; Platform_gettimeval(); ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000; return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { - int32 s, ns; + INT32 s, ns; s = __DIV(ms, 1000); ns = (int)__MOD(ms, 1000) * 1000000; Platform_nanosleep(s, ns); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { __DUP(cmd, cmd__len, CHAR); __DEL(cmd); return Platform_system(cmd, cmd__len); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openro(n, n__len); if (fd < 0) { return Platform_err(); @@ -380,9 +380,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_openrw(n, n__len); if (fd < 0) { return Platform_err(); @@ -393,9 +393,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int16 fd; + INT16 fd; fd = Platform_opennew(n, n__len); if (fd < 0) { return Platform_err(); @@ -406,7 +406,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closefile(h) < 0) { return Platform_err(); @@ -416,7 +416,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -428,7 +428,7 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { __DUP(n, n__len, CHAR); Platform_structstats(); @@ -453,18 +453,18 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return i1.mtime == i2.mtime; } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtime = source.mtime; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_sectotm(i.mtime); Platform_YMDHMStoClock(Platform_tmyear(), Platform_tmmon(), Platform_tmmday(), Platform_tmhour(), Platform_tmmin(), Platform_tmsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_structstats(); if (Platform_fstat(h) < 0) { @@ -474,7 +474,7 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) { *n = Platform_readfile(h, p, l); if (*n < 0) { @@ -486,7 +486,7 @@ int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { @@ -498,9 +498,9 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int64 p, int32 l) +INT16 Platform_Write (INT32 h, INT64 p, INT32 l) { - int64 written; + INT64 written; written = Platform_writefile(h, p, l); if (written < 0) { return Platform_err(); @@ -510,7 +510,7 @@ int16 Platform_Write (int32 h, int64 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_fsync(h) < 0) { return Platform_err(); @@ -520,7 +520,7 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 offset, int16 whence) +INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence) { if (Platform_lseek(h, offset, whence) < 0) { return Platform_err(); @@ -530,7 +530,7 @@ int16 Platform_Seek (int32 h, int32 offset, int16 whence) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 l) +INT16 Platform_Truncate (INT32 h, INT32 l) { if (Platform_ftruncate(h, l) < 0) { return Platform_err(); @@ -540,7 +540,7 @@ int16 Platform_Truncate (int32 h, int32 l) __RETCHK; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_unlink(n, n__len) < 0) { return Platform_err(); @@ -550,9 +550,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; if ((Platform_chdir(n, n__len) >= 0 && Platform_getcwd((void*)Platform_CWD, 256) != NIL)) { return 0; } else { @@ -561,7 +561,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_rename(o, o__len, n, n__len) < 0) { return Platform_err(); @@ -571,7 +571,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -586,7 +586,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -594,7 +594,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -603,7 +603,7 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: @@ -659,7 +659,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -672,10 +672,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -684,7 +684,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -694,7 +694,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 4ed02d04..2da07523 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,77 +7,77 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[8]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT64 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[256]; -import int16 Platform_ArgCount; -import int64 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT16 Platform_ArgCount; +import INT64 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int64 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT64 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT64 Platform_OSAllocate (INT64 size); +import void Platform_OSFree (INT64 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 offset, int16 whence); +import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 l); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int64 p, int32 l); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 l); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index e84157d1..3b932ce7 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 1d663861..bff9cc72 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int32 len; - int64 _prvt0; + INT32 len; + INT64 _prvt0; } Texts_BufDesc; typedef @@ -30,26 +30,26 @@ typedef typedef struct Texts_RunDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[27]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[28]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[20]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[38]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index acf98586..6a00f93e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 10b85a66..a0965363 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -11,58 +11,58 @@ typedef typedef struct Files_FileDesc { char _prvt0[224]; - int32 fd; + INT32 fd; char _prvt1[32]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; char _prvt0[15]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 4bc74170..ca99053e 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + INT32 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int32 types; + INT32 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int32 Heap_freeList[10]; -static int32 Heap_bigBlocks; -export int32 Heap_allocated; +static INT32 Heap_freeList[10]; +static INT32 Heap_bigBlocks; +export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static INT32 Heap_heap, Heap_heapend; +export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int32 blksz); +static void Heap_ExtendHeap (INT32 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len); +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int32 q); -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); +static void Heap_Mark (INT32 q); +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT32 size); +export SYSTEM_PTR Heap_NEWREC (INT32 tag); +static INT32 Heap_NewChunk (INT32 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, INT32 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, INT32 typ) { - __PUT(typ, m->types, int32); + __PUT(typ, m->types, INT32); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static INT32 Heap_NewChunk (INT32 blksz) { - int32 chnk; + INT32 chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); - __PUT(chnk + 20, -4, int32); - __PUT(chnk + 24, Heap_bigBlocks, int32); + __PUT(chnk + 4, chnk + (12 + blksz), INT32); + __PUT(chnk + 12, chnk + 16, INT32); + __PUT(chnk + 16, blksz, INT32); + __PUT(chnk + 20, -4, INT32); + __PUT(chnk + 24, Heap_bigBlocks, INT32); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int32 blksz) +static void Heap_ExtendHeap (INT32 blksz) { - int32 size, chnk, j, next; + INT32 size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int32); + __GET(j, next, INT32); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int32); + __GET(j, next, INT32); } - __PUT(chnk, next, int32); - __PUT(j, chnk, int32); + __PUT(chnk, next, INT32); + __PUT(j, chnk, INT32); } if (next == 0) { - __GET(chnk + 4, Heap_heapend, int32); + __GET(chnk + 4, Heap_heapend, INT32); } } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (INT32 tag) { - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT32 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int32); + __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } } if (i < 9) { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) return NIL; } } - __GET(adr + 4, t, int32); + __GET(adr + 4, t, INT32); if (t >= blksz) { break; } prev = adr; - __GET(adr + 12, adr, int32); + __GET(adr + 12, adr, INT32); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); - __PUT(end + 8, -4, int32); - __PUT(end, end + 4, int32); + __PUT(end + 4, blksz, INT32); + __PUT(end + 8, -4, INT32); + __PUT(end, end + 4, INT32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, INT32); } else { - __GET(adr + 12, next, int32); + __GET(adr + 12, next, INT32); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, INT32); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); - __PUT(adr + 12, Heap_freeList[di], int32); + __PUT(adr + 4, restsize, INT32); + __PUT(adr + 12, Heap_freeList[di], INT32); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, int32); - __PUT(i + 4, 0, int32); - __PUT(i + 8, 0, int32); - __PUT(i + 12, 0, int32); + __PUT(i, 0, INT32); + __PUT(i + 4, 0, INT32); + __PUT(i + 8, 0, INT32); + __PUT(i + 12, 0, INT32); i += 16; } - __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); - __PUT(adr + 4, 0, int32); - __PUT(adr + 8, 0, int32); + __PUT(adr + 12, 0, INT32); + __PUT(adr, tag, INT32); + __PUT(adr + 4, 0, INT32); + __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 4); } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (INT32 size) { - int32 blksz, tag; + INT32 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((address)&blksz); - tag = ((int32)(address)new + blksz) - 12; - __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); - __PUT(tag + 4, -4, int32); - __PUT((int32)(address)new - 4, tag, int32); + tag = ((INT32)(address)new + blksz) - 12; + __PUT(tag - 4, 0, INT32); + __PUT(tag, blksz, INT32); + __PUT(tag + 4, -4, INT32); + __PUT((INT32)(address)new - 4, tag, INT32); Heap_Unlock(); return new; } -static void Heap_Mark (int32 q) +static void Heap_Mark (INT32 q) { - int32 p, tag, offset, fld, n, tagbits; + INT32 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 4, tagbits, int32); + __GET(q - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, int32); + __PUT(q - 4, tagbits + 1, INT32); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, int32); + __GET(tag, offset, INT32); if (offset < 0) { - __PUT(q - 4, (tag + offset) + 1, int32); + __PUT(q - 4, (tag + offset) + 1, INT32); if (p == 0) { break; } n = q; q = p; - __GET(q - 4, tag, int32); + __GET(q - 4, tag, INT32); tag -= 1; - __GET(tag, offset, int32); + __GET(tag, offset, INT32); fld = q + offset; - __GET(fld, p, int32); + __GET(fld, p, INT32); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int32); + __GET(fld, n, INT32); if (n != 0) { - __GET(n - 4, tagbits, int32); + __GET(n - 4, tagbits, INT32); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, int32); - __PUT(q - 4, tag + 1, int32); + __PUT(n - 4, tagbits + 1, INT32); + __PUT(q - 4, tag + 1, INT32); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(address)p); + Heap_Mark((INT32)(address)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + INT32 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 12; - __GET(chnk + 4, end, int32); + __GET(chnk + 4, end, INT32); while (adr < end) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int32); - __GET(tag, size, int32); + __PUT(adr, tag, INT32); + __GET(tag, size, INT32); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); - __PUT(start + 8, -4, int32); + __PUT(start, start + 4, INT32); + __PUT(start + 4, freesize, INT32); + __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], int32); + __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, int32); + __PUT(start + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } -static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) +static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len) { - int32 i, j, x; + INT32 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) +static void Heap_HeapSort (INT32 n, INT32 *a, LONGINT a__len) { - int32 l, r, x; + INT32 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int32 n, int32 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT32 n, INT32 *cand, LONGINT cand__len) { - int32 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 12; - __GET(chnk + 4, lim1, int32); + __GET(chnk + 4, lim1, INT32); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int32); + __GET(adr, tag, INT32); if (__ODD(tag)) { - __GET(tag - 1, size, int32); + __GET(tag - 1, size, INT32); adr += size; } else { - __GET(tag, size, int32); + __GET(tag, size, INT32); ptr = adr + 4; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int32); + __GET(chnk, chnk, INT32); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int32 tag; + INT32 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 4, tag, int32); + __GET(n->obj - 4, tag, INT32); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int32 inc, nofcand, sp, p, stack0; + INT32 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,7 +591,7 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int32); + __GET(sp, p, INT32); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -613,8 +613,8 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int32 cand[10000]; + INT32 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(address)obj; + f->obj = (INT32)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); - __GET(Heap_heap + 4, Heap_heapend, int32); - __PUT(Heap_heap, 0, int32); + __GET(Heap_heap + 4, Heap_heapend, INT32); + __PUT(Heap_heap, 0, INT32); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 1a319646..dbc3fcd7 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[44]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT32 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (INT32 size); +import SYSTEM_PTR Heap_NEWREC (INT32 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, INT32 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index bb6774da..d8293ed7 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 458de3f2..be4ec200 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 5e181cb9..45f4db77 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index f55e7e01..3340bb93 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -408,7 +408,7 @@ OPT_ConstExt OPT_NewExt (void) return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index f44318ed..8854dd67 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6098e568..03213c6a 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(Platform_StdOut, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 39e59543..4a084fb4 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int32 (*Platform_ArgVecPtr)[1]; + INT32 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; + INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT32 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT32 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int32 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT32 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT32 Platform_OSAllocate (INT32 size); +export void Platform_OSFree (INT32 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 o, int16 r); +export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 limit); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -118,11 +118,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -130,44 +130,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,63 +182,63 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_ERRORTOOMANYOPENFILES(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_ERRORNOTSAMEDEVICE(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int32 Platform_OSAllocate (int32 size) +INT32 Platform_OSAllocate (INT32 size) { return Platform_allocate(size); } -void Platform_OSFree (int32 address) +void Platform_OSFree (INT32 address) { Platform_free(address); } -void Platform_Init (int32 argc, int32 argvadr) +void Platform_Init (INT32 argc, INT32 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -248,7 +248,7 @@ void Platform_Init (int32 argc, int32 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { CHAR buf[4096]; - int16 res; + INT16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -271,7 +271,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -280,10 +280,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -291,11 +291,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -306,9 +306,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,26 +325,26 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; ms = Platform_GetTickCount(); return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -355,7 +355,7 @@ void Platform_Delay (int32 ms) } } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -365,9 +365,9 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) *usec = Platform_uluSec(); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 result; + INT16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -382,14 +382,14 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) return __ASHL(result, 8); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +400,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +413,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +426,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +436,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -450,10 +450,10 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - int32 h; - int16 e, i; + INT32 h; + INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -476,20 +476,20 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,10 +499,10 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; @@ -514,10 +514,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; @@ -529,7 +529,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +539,7 @@ int16 Platform_Write (int32 h, int32 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,9 +549,9 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 o, int16 r) +INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) { - int16 rc; + INT16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -562,10 +562,10 @@ int16 Platform_Seek (int32 h, int32 o, int16 r) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 limit) +INT16 Platform_Truncate (INT32 h, INT32 limit) { - int16 rc; - int32 oldpos; + INT16 rc; + INT32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -585,7 +585,7 @@ int16 Platform_Truncate (int32 h, int32 limit) return 0; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -595,9 +595,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { return Platform_err(); @@ -606,7 +606,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); @@ -616,7 +616,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -632,7 +632,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -640,7 +640,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -649,11 +649,11 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: Platform_errstring((CHAR*)"Index out of range.", 20); @@ -705,7 +705,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -718,10 +718,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -730,7 +730,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -740,7 +740,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index bf14c58e..27a42a84 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,80 +7,80 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT32 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import int16 Platform_ArgCount; -import int32 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT16 Platform_ArgCount; +import INT32 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int32 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT32 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT32 Platform_OSAllocate (INT32 size); +import void Platform_OSFree (INT32 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 o, int16 r); +import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 limit); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT32 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) #endif // Platform diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 961ebbe7..ac0a3850 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 891c877a..f2c8d90e 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,7 +8,7 @@ typedef struct Texts_BufDesc { - int32 len; + INT32 len; char _prvt0[4]; } Texts_BufDesc; @@ -30,25 +30,25 @@ typedef typedef struct Texts_RunDesc { - int32 _prvt0; + INT32 _prvt0; char _prvt1[15]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { char _prvt0[20]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt1[4]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -69,13 +69,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[32]; } Texts_Reader; @@ -84,23 +84,23 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; - int64 _prvt0; + INT64 _prvt0; char _prvt1[24]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[12]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[26]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 759e721b..86c4c1fd 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -26,7 +26,7 @@ static CHAR Compiler_mname[256]; export void Compiler_Module (BOOLEAN *done); static void Compiler_PropagateElementaryTypeSizes (void); export void Compiler_Translate (void); -static void Compiler_Trap (int32 sig); +static void Compiler_Trap (INT32 sig); void Compiler_Module (BOOLEAN *done) @@ -147,7 +147,7 @@ void Compiler_Translate (void) } } -static void Compiler_Trap (int32 sig) +static void Compiler_Trap (INT32 sig) { Heap_FINALL(); if (sig == 3) { diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 95ddb569..3f8c68d8 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f6a548e4..6abf2414 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 9b1abaed..e7239705 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -18,7 +18,7 @@ typedef struct Files_BufDesc { Files_File f; BOOLEAN chg; - int32 org, size; + INT32 org, size; SYSTEM_BYTE data[4096]; } Files_BufDesc; @@ -33,85 +33,85 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - int32 fd, len, pos; + INT32 fd, len, pos; Files_Buffer bufs[4]; - int16 swapper, state; + INT16 swapper, state; Files_File next; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; Files_Buffer buf; - int32 org, offset; + INT32 org, offset; } Files_Rider; static Files_File Files_files; -static int16 Files_tempno; +static INT16 Files_tempno; static CHAR Files_HOME[1024]; static struct { LONGINT len[1]; CHAR data[1]; } *Files_SearchPath; -export address *Files_FileDesc__typ; -export address *Files_BufDesc__typ; -export address *Files_Rider__typ; +export ADDRESS *Files_FileDesc__typ; +export ADDRESS *Files_BufDesc__typ; +export ADDRESS *Files_Rider__typ; -export Files_File Files_Base (Files_Rider *r, address *r__typ); +export Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); static Files_File Files_CacheEntry (Platform_FileIdentity identity); -export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +export void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); export void Files_Close (Files_File f); static void Files_CloseOSFile (Files_File f); static void Files_Create (Files_File f); -export void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode); +export void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode); static void Files_Finalize (SYSTEM_PTR o); static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len); static void Files_Flush (Files_Buffer buf); -export void Files_GetDate (Files_File f, int32 *t, int32 *d); +export void Files_GetDate (Files_File f, INT32 *t, INT32 *d); export void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len); static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len); -export int32 Files_Length (Files_File f); +export INT32 Files_Length (Files_File f); static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len); export Files_File Files_New (CHAR *name, LONGINT name__len); export Files_File Files_Old (CHAR *name, LONGINT name__len); -export int32 Files_Pos (Files_Rider *r, address *r__typ); +export INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); export void Files_Purge (Files_File f); -export void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -export void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -export void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -export void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -export void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -export void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -export void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -export void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -export void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -export void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +export void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +export void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +export void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +export void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +export void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +export void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +export void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +export void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +export void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); export void Files_Register (Files_File f); -export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len); -export void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +export void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len); +export void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); export void Files_SetSearchPath (CHAR *path, LONGINT path__len); -export void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -export void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -export void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -export void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -export void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -export void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -export void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -export void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -export void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -export void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +export void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +export void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +export void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +export void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +export void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +export void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +export void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +export void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) #define Files_ToAdr(x) (address)x -static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) +static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { __DUP(s, s__len, CHAR); Out_Ln(); @@ -140,7 +140,7 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, int16 errcode) static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT name__len, CHAR *dest, LONGINT dest__len) { - int16 i, j; + INT16 i, j; __DUP(dir, dir__len, CHAR); __DUP(name, name__len, CHAR); i = 0; @@ -165,7 +165,7 @@ static void Files_MakeFileName (CHAR *dir, LONGINT dir__len, CHAR *name, LONGINT static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *name, LONGINT name__len) { - int32 n, i, j; + INT32 n, i, j; __DUP(finalName, finalName__len, CHAR); Files_tempno += 1; n = Files_tempno; @@ -217,7 +217,7 @@ static void Files_Create (Files_File f) { Platform_FileIdentity identity; BOOLEAN done; - int16 error; + INT16 error; CHAR err[32]; if (f->fd == -1) { if (f->state == 1) { @@ -254,7 +254,7 @@ static void Files_Create (Files_File f) static void Files_Flush (Files_Buffer buf) { - int16 error; + INT16 error; Files_File f = NIL; if (buf->chg) { f = buf->f; @@ -278,7 +278,7 @@ static void Files_Flush (Files_Buffer buf) static void Files_CloseOSFile (Files_File f) { Files_File prev = NIL; - int16 error; + INT16 error; if (Files_files == f) { Files_files = f->next; } else { @@ -298,8 +298,8 @@ static void Files_CloseOSFile (Files_File f) void Files_Close (Files_File f) { - int32 i; - int16 error; + INT32 i; + INT16 error; if (f->state != 1 || f->registerName[0] != 0x00) { Files_Create(f); i = 0; @@ -315,7 +315,7 @@ void Files_Close (Files_File f) } } -int32 Files_Length (Files_File f) +INT32 Files_Length (Files_File f) { return f->len; } @@ -336,9 +336,9 @@ Files_File Files_New (CHAR *name, LONGINT name__len) return f; } -static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) +static void Files_ScanPath (INT16 *pos, CHAR *dir, LONGINT dir__len) { - int16 i; + INT16 i; CHAR ch; i = 0; if (Files_SearchPath == NIL) { @@ -381,7 +381,7 @@ static void Files_ScanPath (int16 *pos, CHAR *dir, LONGINT dir__len) static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; ch = name[0]; @@ -395,7 +395,7 @@ static BOOLEAN Files_HasDir (CHAR *name, LONGINT name__len) static Files_File Files_CacheEntry (Platform_FileIdentity identity) { Files_File f = NIL; - int16 i, error; + INT16 i, error; f = Files_files; while (f != NIL) { if (Platform_SameFile(identity, f->identity)) { @@ -422,11 +422,11 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - int32 fd; - int16 pos; + INT32 fd; + INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; - int16 error; + INT16 error; Platform_FileIdentity identity; __DUP(name, name__len, CHAR); if (name[0] != 0x00) { @@ -497,9 +497,9 @@ Files_File Files_Old (CHAR *name, LONGINT name__len) void Files_Purge (Files_File f) { - int16 i; + INT16 i; Platform_FileIdentity identity; - int16 error; + INT16 error; i = 0; while (i < 4) { if (f->bufs[i] != NIL) { @@ -519,25 +519,25 @@ void Files_Purge (Files_File f) Platform_SetMTime(&f->identity, Platform_FileIdentity__typ, identity); } -void Files_GetDate (Files_File f, int32 *t, int32 *d) +void Files_GetDate (Files_File f, INT32 *t, INT32 *d) { Platform_FileIdentity identity; - int16 error; + INT16 error; Files_Create(f); error = Platform_Identify(f->fd, &identity, Platform_FileIdentity__typ); Platform_MTimeAsClock(identity, &*t, &*d); } -int32 Files_Pos (Files_Rider *r, address *r__typ) +INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { return (*r).org + (*r).offset; } -void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) +void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) { - int32 org, offset, i, n; + INT32 org, offset, i, n; Files_Buffer buf = NIL; - int16 error; + INT16 error; if (f != NIL) { if (pos > f->len) { pos = f->len; @@ -595,9 +595,9 @@ void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos) (*r).res = 0; } -void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) +void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) { - int32 offset; + INT32 offset; Files_Buffer buf = NIL; buf = (*r).buf; offset = (*r).offset; @@ -619,9 +619,9 @@ void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x) } } -void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -655,15 +655,15 @@ void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).eof = 0; } -Files_File Files_Base (Files_Rider *r, address *r__typ) +Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ) { return (*r).buf->f; } -void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) +void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) { Files_Buffer buf = NIL; - int32 offset; + INT32 offset; buf = (*r).buf; offset = (*r).offset; if ((*r).org != buf->org || offset >= 4096) { @@ -681,9 +681,9 @@ void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x) (*r).res = 0; } -void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n) +void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n) { - int32 xpos, min, restInBuf, offset; + INT32 xpos, min, restInBuf, offset; Files_Buffer buf = NIL; if (n > x__len) { Files_IdxTrap(); @@ -717,17 +717,17 @@ void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT (*r).res = 0; } -void Files_Delete (CHAR *name, LONGINT name__len, int16 *res) +void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) { __DUP(name, name__len, CHAR); *res = Platform_Unlink((void*)name, name__len); __DEL(name); } -void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res) +void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - int32 fdold, fdnew, n; - int16 error, ignore; + INT32 fdold, fdnew, n; + INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; __DUP(old, old__len, CHAR); @@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int void Files_Register (Files_File f) { - int16 idx, errcode; + INT16 idx, errcode; Files_File f1 = NIL; CHAR file[104]; if ((f->state == 1 && f->registerName[0] != 0x00)) { @@ -807,7 +807,7 @@ void Files_Register (Files_File f) } } -void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) +void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res) { __DUP(path, path__len, CHAR); *res = Platform_Chdir((void*)path, path__len); @@ -816,7 +816,7 @@ void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res) static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *dest, LONGINT dest__len) { - int32 i, j; + INT32 i, j; if (!Platform_LittleEndian) { i = src__len; j = 0; @@ -830,51 +830,51 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de } } -void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x) +void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x) { Files_Read(&*R, R__typ, (CHAR*)(void*)&*x); } -void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x) +void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = (int16)b[0] + __ASHL((int16)b[1], 8); + *x = (INT16)b[0] + __ASHL((INT16)b[1], 8); } -void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x) +void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } -void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x) +void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x) { CHAR b[4]; - int32 l; + INT32 l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = (((int16)b[0] + __ASHL((int16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = (uint32)l; + l = (((INT16)b[0] + __ASHL((INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (UINT32)l; } -void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x) +void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); Files_FlipBytes((void*)b, 4, (void*)&*x, 4); } -void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x) +void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x) { CHAR b[8]; Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8); Files_FlipBytes((void*)b, 8, (void*)&*x, 8); } -void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -884,9 +884,9 @@ void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!(ch == 0x00)); } -void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; CHAR ch; BOOLEAN b; i = 0; @@ -902,29 +902,29 @@ void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) } while (!b); } -void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len) +void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) { - int8 s, b; - int64 q; + INT8 s, b; + INT64 q; s = 0; q = 0; Files_Read(&*R, R__typ, (void*)&b); while (b < 0) { - q += (int64)__ASH(((int16)b + 128), s); + q += (INT64)__ASH(((INT16)b + 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&b); } - q += (int64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); + q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); __MOVE((address)&q, (address)x, x__len); } -void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x) +void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) { Files_Write(&*R, R__typ, __VAL(CHAR, x)); } -void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) +void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x) { CHAR b[2]; b[0] = (CHAR)x; @@ -932,7 +932,7 @@ void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x) Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2); } -void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) +void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x) { CHAR b[4]; b[0] = (CHAR)x; @@ -942,11 +942,11 @@ void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) +void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x) { CHAR b[4]; - int32 i; - i = (int32)x; + INT32 i; + i = (INT32)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); @@ -954,23 +954,23 @@ void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x) Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x) +void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x) { CHAR b[4]; Files_FlipBytes((void*)&x, 4, (void*)b, 4); Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4); } -void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x) +void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x) { CHAR b[8]; Files_FlipBytes((void*)&x, 8, (void*)b, 8); Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8); } -void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len) +void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { - int16 i; + INT16 i; i = 0; while (x[i] != 0x00) { i += 1; @@ -978,7 +978,7 @@ void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1); } -void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x) +void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x) { while (x < -64 || x > 63) { Files_Write(&*R, R__typ, (CHAR)(__MASK(x, -128) + 128)); @@ -995,7 +995,7 @@ void Files_GetName (Files_File f, CHAR *name, LONGINT name__len) static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; - int32 res; + INT32 res; f = (Files_File)(address)o; if (f->fd >= 0) { Files_CloseOSFile(f); diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2e014659..4d65d916 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,61 +10,61 @@ typedef typedef struct Files_FileDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[216]; - int32 fd; + INT32 fd; char _prvt2[60]; } Files_FileDesc; typedef struct Files_Rider { - int32 res; + INT32 res; BOOLEAN eof; - int64 _prvt0; + INT64 _prvt0; char _prvt1[8]; } Files_Rider; -import address *Files_FileDesc__typ; -import address *Files_Rider__typ; +import ADDRESS *Files_FileDesc__typ; +import ADDRESS *Files_Rider__typ; -import Files_File Files_Base (Files_Rider *r, address *r__typ); -import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, int16 *res); +import Files_File Files_Base (Files_Rider *r, ADDRESS *r__typ); +import void Files_ChangeDirectory (CHAR *path, LONGINT path__len, INT16 *res); import void Files_Close (Files_File f); -import void Files_Delete (CHAR *name, LONGINT name__len, int16 *res); -import void Files_GetDate (Files_File f, int32 *t, int32 *d); +import void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res); +import void Files_GetDate (Files_File f, INT32 *t, INT32 *d); import void Files_GetName (Files_File f, CHAR *name, LONGINT name__len); -import int32 Files_Length (Files_File f); +import INT32 Files_Length (Files_File f); import Files_File Files_New (CHAR *name, LONGINT name__len); import Files_File Files_Old (CHAR *name, LONGINT name__len); -import int32 Files_Pos (Files_Rider *r, address *r__typ); +import INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ); import void Files_Purge (Files_File f); -import void Files_Read (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x); -import void Files_ReadBool (Files_Rider *R, address *R__typ, BOOLEAN *x); -import void Files_ReadBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_ReadInt (Files_Rider *R, address *R__typ, int16 *x); -import void Files_ReadLInt (Files_Rider *R, address *R__typ, int32 *x); -import void Files_ReadLReal (Files_Rider *R, address *R__typ, LONGREAL *x); -import void Files_ReadLine (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); -import void Files_ReadNum (Files_Rider *R, address *R__typ, SYSTEM_BYTE *x, LONGINT x__len); -import void Files_ReadReal (Files_Rider *R, address *R__typ, REAL *x); -import void Files_ReadSet (Files_Rider *R, address *R__typ, uint32 *x); -import void Files_ReadString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x); +import void Files_ReadBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN *x); +import void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_ReadInt (Files_Rider *R, ADDRESS *R__typ, INT16 *x); +import void Files_ReadLInt (Files_Rider *R, ADDRESS *R__typ, INT32 *x); +import void Files_ReadLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL *x); +import void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); +import void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len); +import void Files_ReadReal (Files_Rider *R, ADDRESS *R__typ, REAL *x); +import void Files_ReadSet (Files_Rider *R, ADDRESS *R__typ, UINT32 *x); +import void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void Files_Register (Files_File f); -import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int16 *res); -import void Files_Set (Files_Rider *r, address *r__typ, Files_File f, int32 pos); +import void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res); +import void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos); import void Files_SetSearchPath (CHAR *path, LONGINT path__len); -import void Files_Write (Files_Rider *r, address *r__typ, SYSTEM_BYTE x); -import void Files_WriteBool (Files_Rider *R, address *R__typ, BOOLEAN x); -import void Files_WriteBytes (Files_Rider *r, address *r__typ, SYSTEM_BYTE *x, LONGINT x__len, int32 n); -import void Files_WriteInt (Files_Rider *R, address *R__typ, int16 x); -import void Files_WriteLInt (Files_Rider *R, address *R__typ, int32 x); -import void Files_WriteLReal (Files_Rider *R, address *R__typ, LONGREAL x); -import void Files_WriteNum (Files_Rider *R, address *R__typ, int64 x); -import void Files_WriteReal (Files_Rider *R, address *R__typ, REAL x); -import void Files_WriteSet (Files_Rider *R, address *R__typ, uint32 x); -import void Files_WriteString (Files_Rider *R, address *R__typ, CHAR *x, LONGINT x__len); +import void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x); +import void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x); +import void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x__len, INT32 n); +import void Files_WriteInt (Files_Rider *R, ADDRESS *R__typ, INT16 x); +import void Files_WriteLInt (Files_Rider *R, ADDRESS *R__typ, INT32 x); +import void Files_WriteLReal (Files_Rider *R, ADDRESS *R__typ, LONGREAL x); +import void Files_WriteNum (Files_Rider *R, ADDRESS *R__typ, INT64 x); +import void Files_WriteReal (Files_Rider *R, ADDRESS *R__typ, REAL x); +import void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); +import void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); import void *Files__init(void); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 5117800b..a162ea04 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -40,7 +40,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + INT64 obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -55,53 +55,53 @@ typedef struct Heap_ModuleDesc { Heap_Module next; Heap_ModuleName name; - int32 refcnt; + INT32 refcnt; Heap_Cmd cmds; - int64 types; + INT64 types; Heap_EnumProc enumPtrs; - int32 reserved1, reserved2; + INT32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static int64 Heap_freeList[10]; -static int64 Heap_bigBlocks; -export int64 Heap_allocated; +static INT64 Heap_freeList[10]; +static INT64 Heap_bigBlocks; +export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static INT64 Heap_heap, Heap_heapend; +export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; -static int16 Heap_lockdepth; +static INT16 Heap_lockdepth; static BOOLEAN Heap_interrupted; -export int16 Heap_FileCount; +export INT16 Heap_FileCount; -export address *Heap_ModuleDesc__typ; -export address *Heap_CmdDesc__typ; -export address *Heap_FinDesc__typ; -export address *Heap__1__typ; +export ADDRESS *Heap_ModuleDesc__typ; +export ADDRESS *Heap_CmdDesc__typ; +export ADDRESS *Heap_FinDesc__typ; +export ADDRESS *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (int64 blksz); +static void Heap_ExtendHeap (INT64 blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len); +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (int64 q); -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); +static void Heap_Mark (INT64 q); +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (INT64 size); +export SYSTEM_PTR Heap_NEWREC (INT64 tag); +static INT64 Heap_NewChunk (INT64 blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len); +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -157,9 +157,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, INT64 typ) { - __PUT(typ, m->types, int64); + __PUT(typ, m->types, INT64); m->types = typ; } @@ -168,25 +168,25 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static INT64 Heap_NewChunk (INT64 blksz) { - int64 chnk; + INT64 chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); - __PUT(chnk + 40, -8, int64); - __PUT(chnk + 48, Heap_bigBlocks, int64); + __PUT(chnk + 8, chnk + (24 + blksz), INT64); + __PUT(chnk + 24, chnk + 32, INT64); + __PUT(chnk + 32, blksz, INT64); + __PUT(chnk + 40, -8, INT64); + __PUT(chnk + 48, Heap_bigBlocks, INT64); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } return chnk; } -static void Heap_ExtendHeap (int64 blksz) +static void Heap_ExtendHeap (INT64 blksz) { - int64 size, chnk, j, next; + INT64 size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,30 +195,30 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; - __GET(j, next, int64); + __GET(j, next, INT64); while ((next != 0 && chnk > next)) { j = next; - __GET(j, next, int64); + __GET(j, next, INT64); } - __PUT(chnk, next, int64); - __PUT(j, chnk, int64); + __PUT(chnk, next, INT64); + __PUT(j, chnk, INT64); } if (next == 0) { - __GET(chnk + 8, Heap_heapend, int64); + __GET(chnk + 8, Heap_heapend, INT64); } } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (INT64 tag) { - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + INT64 i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); - __GET(tag, blksz, int64); + __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; if (i < 9) { @@ -229,17 +229,17 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } } if (i < 9) { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; adr += restsize; } @@ -268,31 +268,31 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) return NIL; } } - __GET(adr + 8, t, int64); + __GET(adr + 8, t, INT64); if (t >= blksz) { break; } prev = adr; - __GET(adr + 24, adr, int64); + __GET(adr + 24, adr, INT64); } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); - __PUT(end + 16, -8, int64); - __PUT(end, end + 8, int64); + __PUT(end + 8, blksz, INT64); + __PUT(end + 16, -8, INT64); + __PUT(end, end + 8, INT64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, INT64); } else { - __GET(adr + 24, next, int64); + __GET(adr + 24, next, INT64); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, INT64); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); - __PUT(adr + 24, Heap_freeList[di], int64); + __PUT(adr + 8, restsize, INT64); + __PUT(adr + 24, Heap_freeList[di], INT64); Heap_freeList[di] = adr; } } @@ -301,69 +301,69 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, int64); - __PUT(i + 8, 0, int64); - __PUT(i + 16, 0, int64); - __PUT(i + 24, 0, int64); + __PUT(i, 0, INT64); + __PUT(i + 8, 0, INT64); + __PUT(i + 16, 0, INT64); + __PUT(i + 24, 0, INT64); i += 32; } - __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); - __PUT(adr + 8, 0, int64); - __PUT(adr + 16, 0, int64); + __PUT(adr + 24, 0, INT64); + __PUT(adr, tag, INT64); + __PUT(adr + 8, 0, INT64); + __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); return (SYSTEM_PTR)(address)(adr + 8); } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (INT64 size) { - int64 blksz, tag; + INT64 blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((address)&blksz); - tag = ((int64)(address)new + blksz) - 24; - __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); - __PUT(tag + 8, -8, int64); - __PUT((int64)(address)new - 8, tag, int64); + tag = ((INT64)(address)new + blksz) - 24; + __PUT(tag - 8, 0, INT64); + __PUT(tag, blksz, INT64); + __PUT(tag + 8, -8, INT64); + __PUT((INT64)(address)new - 8, tag, INT64); Heap_Unlock(); return new; } -static void Heap_Mark (int64 q) +static void Heap_Mark (INT64 q) { - int64 p, tag, offset, fld, n, tagbits; + INT64 p, tag, offset, fld, n, tagbits; if (q != 0) { - __GET(q - 8, tagbits, int64); + __GET(q - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, int64); + __PUT(q - 8, tagbits + 1, INT64); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, int64); + __GET(tag, offset, INT64); if (offset < 0) { - __PUT(q - 8, (tag + offset) + 1, int64); + __PUT(q - 8, (tag + offset) + 1, INT64); if (p == 0) { break; } n = q; q = p; - __GET(q - 8, tag, int64); + __GET(q - 8, tag, INT64); tag -= 1; - __GET(tag, offset, int64); + __GET(tag, offset, INT64); fld = q + offset; - __GET(fld, p, int64); + __GET(fld, p, INT64); __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; - __GET(fld, n, int64); + __GET(fld, n, INT64); if (n != 0) { - __GET(n - 8, tagbits, int64); + __GET(n - 8, tagbits, INT64); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, int64); - __PUT(q - 8, tag + 1, int64); + __PUT(n - 8, tagbits + 1, INT64); + __PUT(q - 8, tag + 1, INT64); __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; @@ -379,12 +379,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(address)p); + Heap_Mark((INT64)(address)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + INT64 chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -396,58 +396,58 @@ static void Heap_Scan (void) chnk = Heap_heap; while (chnk != 0) { adr = chnk + 24; - __GET(chnk + 8, end, int64); + __GET(chnk + 8, end, INT64); while (adr < end) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, int64); - __GET(tag, size, int64); + __PUT(adr, tag, INT64); + __GET(tag, size, INT64); Heap_allocated += size; adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); freesize += size; adr += size; } } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); - __PUT(start + 16, -8, int64); + __PUT(start, start + 8, INT64); + __PUT(start + 8, freesize, INT64); + __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], int64); + __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, int64); + __PUT(start + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = start; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } -static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) +static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len) { - int64 i, j, x; + INT64 i, j, x; j = l; x = a[j]; for (;;) { @@ -464,9 +464,9 @@ static void Heap_Sift (int64 l, int64 r, int64 *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) +static void Heap_HeapSort (INT64 n, INT64 *a, LONGINT a__len) { - int64 l, r, x; + INT64 l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -482,25 +482,25 @@ static void Heap_HeapSort (int64 n, int64 *a, LONGINT a__len) } } -static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkCandidates (INT64 n, INT64 *cand, LONGINT cand__len) { - int64 chnk, adr, tag, next, lim, lim1, i, ptr, size; + INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; while ((chnk != 0 && chnk < lim)) { adr = chnk + 24; - __GET(chnk + 8, lim1, int64); + __GET(chnk + 8, lim1, INT64); if (lim < lim1) { lim1 = lim; } while (adr < lim1) { - __GET(adr, tag, int64); + __GET(adr, tag, INT64); if (__ODD(tag)) { - __GET(tag - 1, size, int64); + __GET(tag - 1, size, INT64); adr += size; } else { - __GET(tag, size, int64); + __GET(tag, size, INT64); ptr = adr + 8; while (cand[i] < ptr) { i += 1; @@ -515,17 +515,17 @@ static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len) adr = next; } } - __GET(chnk, chnk, int64); + __GET(chnk, chnk, INT64); } } static void Heap_CheckFin (void) { Heap_FinNode n; - int64 tag; + INT64 tag; n = Heap_fin; while (n != NIL) { - __GET(n->obj - 8, tag, int64); + __GET(n->obj - 8, tag, INT64); if (!__ODD(tag)) { n->marked = 0; Heap_Mark(n->obj); @@ -571,10 +571,10 @@ void Heap_FINALL (void) } } -static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) +static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) { SYSTEM_PTR frame; - int64 inc, nofcand, sp, p, stack0; + INT64 inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -591,9 +591,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) inc = -inc; } while (sp != stack0) { - __GET(sp, p, int64); + __GET(sp, p, INT64); if ((p > Heap_heap && p < Heap_heapend)) { - if (nofcand == (int64)cand__len) { + if (nofcand == (INT64)cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -613,8 +613,8 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - int64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - int64 cand[10000]; + INT64 i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); m = (Heap_Module)(address)Heap_modules; @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(address)obj; + f->obj = (INT64)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -704,8 +704,8 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); - __GET(Heap_heap + 8, Heap_heapend, int64); - __PUT(Heap_heap, 0, int64); + __GET(Heap_heap + 8, Heap_heapend, INT64); + __PUT(Heap_heap, 0, INT64); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index b0c90472..0b6a9d03 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h @@ -22,7 +22,7 @@ typedef typedef struct Heap_ModuleDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[56]; } Heap_ModuleDesc; @@ -31,21 +31,21 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; -import int16 Heap_FileCount; +import INT64 Heap_allocated, Heap_heapsize; +import INT16 Heap_FileCount; -import address *Heap_ModuleDesc__typ; +import ADDRESS *Heap_ModuleDesc__typ; import void Heap_FINALL (void); import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (INT64 size); +import SYSTEM_PTR Heap_NEWREC (INT64 tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, INT64 typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 97e17ad2..39e2d6ca 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Heap.h" @@ -31,20 +31,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); - int32 reserved1, reserved2; + INT32 types; + void (*enumPtrs)(void(*)(INT32)); + INT32 reserved1, reserved2; } Modules_ModuleDesc; -export int16 Modules_res; +export INT16 Modules_res; export CHAR Modules_resMsg[256]; export Modules_ModuleName Modules_imported, Modules_importing; -export address *Modules_ModuleDesc__typ; -export address *Modules_CmdDesc__typ; +export ADDRESS *Modules_ModuleDesc__typ; +export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); @@ -56,7 +56,7 @@ export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len) { - int16 i, j; + INT16 i, j; __DUP(b, b__len, CHAR); i = 0; while (a[__X(i, a__len)] != 0x00) { diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a7b62fe3..c2afbd3c 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -28,20 +28,20 @@ typedef struct Modules_ModuleDesc { Modules_Module next; Modules_ModuleName name; - int32 refcnt; + INT32 refcnt; Modules_Cmd cmds; - int32 types; - void (*enumPtrs)(void(*)(int32)); + INT32 types; + void (*enumPtrs)(void(*)(INT32)); char _prvt0[8]; } Modules_ModuleDesc; -import int16 Modules_res; +import INT16 Modules_res; import CHAR Modules_resMsg[256]; import Modules_ModuleName Modules_imported, Modules_importing; -import address *Modules_ModuleDesc__typ; -import address *Modules_CmdDesc__typ; +import ADDRESS *Modules_ModuleDesc__typ; +import ADDRESS *Modules_CmdDesc__typ; import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index dff6adc6..60993ebe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -11,13 +11,13 @@ #include "OPT.h" -static int16 OPB_exp; -static int64 OPB_maxExp; +static INT16 OPB_exp; +static INT64 OPB_maxExp; export void OPB_Assign (OPT_Node *x, OPT_Node y); -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static int16 OPB_BoolToInt (BOOLEAN b); +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static INT16 OPB_BoolToInt (BOOLEAN b); export void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); static void OPB_CharToString (OPT_Node n); static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode); @@ -25,10 +25,10 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo); export void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); static void OPB_CheckProc (OPT_Struct x, OPT_Object y); static void OPB_CheckPtr (OPT_Node x, OPT_Node y); -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x); +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x); static void OPB_CheckReceiver (OPT_Node *x, OPT_Object fp); -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y); -export void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y); +export void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); static void OPB_Convert (OPT_Node *x, OPT_Struct typ); export void OPB_DeRef (OPT_Node *x); static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar); @@ -38,17 +38,17 @@ export void OPB_Field (OPT_Node *x, OPT_Object y); export void OPB_In (OPT_Node *x, OPT_Node y); export void OPB_Index (OPT_Node *x, OPT_Node y); export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); -static BOOLEAN OPB_IntToBool (int64 i); +static BOOLEAN OPB_IntToBool (INT64 i); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -export void OPB_MOp (int8 op, OPT_Node *x); +export void OPB_MOp (INT8 op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -export OPT_Node OPB_NewIntConst (int64 intval); +export OPT_Node OPB_NewIntConst (INT64 intval); export OPT_Node OPB_NewLeaf (OPT_Object obj); export OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -export OPT_Node OPB_NewString (OPS_String str, int64 len); +export OPT_Node OPB_NewString (OPS_String str, INT64 len); export OPT_Node OPB_Nil (void); static BOOLEAN OPB_NotVar (OPT_Node x); -export void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +export void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); export void OPB_OptIf (OPT_Node *x); export void OPB_Param (OPT_Node ap, OPT_Object fp); export void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); @@ -57,17 +57,17 @@ export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); static void OPB_SetSetType (OPT_Node node); -export void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -export void OPB_StPar0 (OPT_Node *par0, int16 fctno); -export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -export void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -export void OPB_StaticLink (int8 dlev); +export void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +export void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +export void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +export void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +export void OPB_StaticLink (INT8 dlev); export void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); -static void OPB_err (int16 n); -static int64 OPB_log (int64 x); +static void OPB_err (INT16 n); +static INT64 OPB_log (INT64 x); -static void OPB_err (int16 n) +static void OPB_err (INT16 n) { OPM_err(n); } @@ -104,7 +104,7 @@ OPT_Node OPB_NewLeaf (OPT_Object obj) return node; } -void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y) +void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -127,7 +127,7 @@ void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y) *last = y; } -static int16 OPB_BoolToInt (BOOLEAN b) +static INT16 OPB_BoolToInt (BOOLEAN b) { if (b) { return 1; @@ -137,7 +137,7 @@ static int16 OPB_BoolToInt (BOOLEAN b) __RETCHK; } -static BOOLEAN OPB_IntToBool (int64 i) +static BOOLEAN OPB_IntToBool (INT64 i) { return i != 0; } @@ -214,8 +214,8 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { - int32 i32; - __GET((address)&node->conval->setval + 4, i32, int32); + INT32 i32; + __GET((address)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { @@ -223,7 +223,7 @@ static void OPB_SetSetType (OPT_Node node) } } -OPT_Node OPB_NewIntConst (int64 intval) +OPT_Node OPB_NewIntConst (INT64 intval) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -244,7 +244,7 @@ OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ) return x; } -OPT_Node OPB_NewString (OPS_String str, int64 len) +OPT_Node OPB_NewString (OPS_String str, INT64 len) { OPT_Node x = NIL; x = OPT_NewNode(7); @@ -274,7 +274,7 @@ static void OPB_CharToString (OPT_Node n) n->obj = NIL; } -static void OPB_BindNodes (int8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void OPB_BindNodes (INT8 class, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -314,7 +314,7 @@ void OPB_DeRef (OPT_Node *x) void OPB_Index (OPT_Node *x, OPT_Node y) { - int16 f; + INT16 f; OPT_Struct typ = NIL; f = y->typ->form; if ((*x)->class >= 7) { @@ -325,7 +325,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) } if ((*x)->typ->comp == 2) { typ = (*x)->typ->BaseTyp; - if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (int64)(*x)->typ->n))) { + if ((y->class == 7 && (y->conval->intval < 0 || y->conval->intval >= (INT64)(*x)->typ->n))) { OPB_err(81); } } else if ((*x)->typ->comp == 3) { @@ -439,15 +439,15 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) void OPB_In (OPT_Node *x, OPT_Node y) { - int16 f; - int64 k; + INT16 f; + INT64 k; f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if ((f == 4 && y->typ->form == 7)) { if ((*x)->class == 7) { k = (*x)->conval->intval; - if (k < 0 || k >= (int64)__ASHL(y->typ->size, 3)) { + if (k < 0 || k >= (INT64)__ASHL(y->typ->size, 3)) { OPB_err(202); } else if (y->class == 7) { (*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval, 64)); @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) (*x)->typ = OPT_booltyp; } -static int64 OPB_log (int64 x) +static INT64 OPB_log (INT64 x) { OPB_exp = 0; if (x > 0) { @@ -478,7 +478,7 @@ static int64 OPB_log (int64 x) return x; } -static void OPB_CheckRealType (int16 f, int16 nr, OPT_Const x) +static void OPB_CheckRealType (INT16 f, INT16 nr, OPT_Const x) { LONGREAL min, max, r; if (f == 5) { @@ -502,9 +502,9 @@ static struct MOp__28 { struct MOp__28 *lnk; } *MOp__28_s; -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__29 (INT8 op, OPT_Struct typ, OPT_Node z) { OPT_Node node = NIL; node = OPT_NewNode(11); @@ -514,9 +514,9 @@ static OPT_Node NewOp__29 (int8 op, OPT_Struct typ, OPT_Node z) return node; } -void OPB_MOp (int8 op, OPT_Node *x) +void OPB_MOp (INT8 op, OPT_Node *x) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node z = NIL; struct MOp__28 _s; @@ -597,7 +597,7 @@ void OPB_MOp (int8 op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = (int16)__CAP((CHAR)z->conval->intval); + z->conval->intval = (INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -657,7 +657,7 @@ void OPB_MOp (int8 op, OPT_Node *x) static void OPB_CheckPtr (OPT_Node x, OPT_Node y) { - int16 g; + INT16 g; OPT_Struct p = NIL, q = NIL, t = NIL; g = y->typ->form; if (g == 11) { @@ -741,16 +741,16 @@ static void OPB_CheckProc (OPT_Struct x, OPT_Object y) static struct ConstOp__13 { OPT_Node *x; - int16 *f; + INT16 *f; OPT_Const *xval, *yval; struct ConstOp__13 *lnk; } *ConstOp__13_s; -static int16 ConstCmp__14 (void); +static INT16 ConstCmp__14 (void); -static int16 ConstCmp__14 (void) +static INT16 ConstCmp__14 (void) { - int16 res; + INT16 res; switch (*ConstOp__13_s->f) { case 0: res = 9; @@ -813,11 +813,11 @@ static int16 ConstCmp__14 (void) return res; } -static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) +static void OPB_ConstOp (INT16 op, OPT_Node x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Const xval = NIL, yval = NIL; - int64 xv, yv; + INT64 xv, yv; BOOLEAN temp; struct ConstOp__13 _s; _s.x = &x; @@ -1097,8 +1097,8 @@ static void OPB_ConstOp (int16 op, OPT_Node x, OPT_Node y) static void OPB_Convert (OPT_Node *x, OPT_Struct typ) { OPT_Node node = NIL; - int16 f, g; - int64 k; + INT16 f, g; + INT64 k; LONGREAL r; f = (*x)->typ->form; g = typ->form; @@ -1136,12 +1136,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) OPB_err(203); r = (LONGREAL)1; } - (*x)->conval->intval = (int32)__ENTIER(r); + (*x)->conval->intval = (INT32)__ENTIER(r); OPB_SetIntType(*x); } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int16)(*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1155,14 +1155,14 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } static struct Op__38 { - int16 *f, *g; + INT16 *f, *g; struct Op__38 *lnk; } *Op__38_s; -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y); static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y); -static void NewOp__39 (int8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__39 (INT8 op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1203,13 +1203,13 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y) return ok; } -void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) +void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y) { - int16 f, g; + INT16 f, g; OPT_Node t = NIL, z = NIL; OPT_Struct typ = NIL; BOOLEAN do_; - int64 val; + INT64 val; struct Op__38 _s; _s.f = &f; _s.g = &g; @@ -1489,7 +1489,7 @@ void OPB_Op (int8 op, OPT_Node *x, OPT_Node y) void OPB_SetRange (OPT_Node *x, OPT_Node y) { - int64 k, l; + INT64 k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); } else if (((*x)->typ->form == 4 && y->typ->form == 4)) { @@ -1525,7 +1525,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) void OPB_SetElem (OPT_Node *x) { - int64 k; + INT64 k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); } else if ((*x)->typ->form != 4) { @@ -1549,7 +1549,7 @@ void OPB_SetElem (OPT_Node *x) static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) { OPT_Struct y = NIL; - int16 f, g; + INT16 f, g; OPT_Struct p = NIL, q = NIL; y = ynode->typ; f = x->form; @@ -1673,9 +1673,9 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -void OPB_StPar0 (OPT_Node *par0, int16 fctno) +void OPB_StPar0 (OPT_Node *par0, INT16 fctno) { - int16 f; + INT16 f; OPT_Struct typ = NIL; OPT_Node x = NIL; x = *par0; @@ -1983,9 +1983,9 @@ static struct StPar1__53 { struct StPar1__53 *lnk; } *StPar1__53_s; -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__54 (INT8 class, INT8 subcl, OPT_Node left, OPT_Node right) { OPT_Node node = NIL; node = OPT_NewNode(class); @@ -1995,9 +1995,9 @@ static OPT_Node NewOp__54 (int8 class, int8 subcl, OPT_Node left, OPT_Node right return node; } -void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) +void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) { - int16 f, L; + INT16 f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; struct StPar1__53 _s; @@ -2026,7 +2026,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (f == 4) { - if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (int64)__ASHL(p->typ->size, 3)))) { + if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval >= (INT64)__ASHL(p->typ->size, 3)))) { OPB_err(202); } p = NewOp__54(19, fctno, p, x); @@ -2091,8 +2091,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) OPB_err(208); p->conval->intval = 1; } else if (x->conval->intval >= 0) { - if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (int64)__ASH(1, x->conval->intval))) { - p->conval->intval = p->conval->intval * (int64)__ASH(1, x->conval->intval); + if (__ABS(p->conval->intval) <= __DIV(9223372036854775807, (INT64)__ASH(1, x->conval->intval))) { + p->conval->intval = p->conval->intval * (INT64)__ASH(1, x->conval->intval); } else { OPB_err(208); p->conval->intval = 1; @@ -2239,10 +2239,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) StPar1__53_s = _s.lnk; } -void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) +void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n) { OPT_Node node = NIL; - int16 f; + INT16 f; OPT_Node p = NIL; p = *par0; f = x->typ->form; @@ -2284,9 +2284,9 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n) *par0 = p; } -void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) +void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno) { - int16 dim; + INT16 dim; OPT_Node x = NIL, p = NIL; p = *par0; if (fctno <= 19) { @@ -2350,7 +2350,7 @@ void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno) static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpar) { - int16 f; + INT16 f; f = atyp->comp; ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; @@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) } } -void OPB_StaticLink (int8 dlev) +void OPB_StaticLink (INT8 dlev) { OPT_Object scope = NIL; scope = OPT_topScope; @@ -2474,7 +2474,7 @@ void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp) { OPT_Struct typ = NIL; OPT_Node p = NIL; - int8 lev; + INT8 lev; if ((*x)->class == 9) { typ = (*x)->typ; lev = (*x)->obj->mnolev; @@ -2534,7 +2534,7 @@ void OPB_Return (OPT_Node *x, OPT_Object proc) void OPB_Assign (OPT_Node *x, OPT_Node y) { OPT_Node z = NIL; - int8 subcl; + INT8 subcl; if ((*x)->class >= 7) { OPB_err(56); } diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 22742961..bc644f4c 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h @@ -13,7 +13,7 @@ import void OPB_Assign (OPT_Node *x, OPT_Node y); import void OPB_Call (OPT_Node *x, OPT_Node apar, OPT_Object fp); import void OPB_CheckParameters (OPT_Object fp, OPT_Object ap, BOOLEAN checkNames); -import void OPB_Construct (int8 class, OPT_Node *x, OPT_Node y); +import void OPB_Construct (INT8 class, OPT_Node *x, OPT_Node y); import void OPB_DeRef (OPT_Node *x); import OPT_Node OPB_EmptySet (void); import void OPB_Enter (OPT_Node *procdec, OPT_Node stat, OPT_Object proc); @@ -22,25 +22,25 @@ import void OPB_In (OPT_Node *x, OPT_Node y); import void OPB_Index (OPT_Node *x, OPT_Node y); import void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); import void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); -import void OPB_MOp (int8 op, OPT_Node *x); +import void OPB_MOp (INT8 op, OPT_Node *x); import OPT_Node OPB_NewBoolConst (BOOLEAN boolval); -import OPT_Node OPB_NewIntConst (int64 intval); +import OPT_Node OPB_NewIntConst (INT64 intval); import OPT_Node OPB_NewLeaf (OPT_Object obj); import OPT_Node OPB_NewRealConst (LONGREAL realval, OPT_Struct typ); -import OPT_Node OPB_NewString (OPS_String str, int64 len); +import OPT_Node OPB_NewString (OPS_String str, INT64 len); import OPT_Node OPB_Nil (void); -import void OPB_Op (int8 op, OPT_Node *x, OPT_Node y); +import void OPB_Op (INT8 op, OPT_Node *x, OPT_Node y); import void OPB_OptIf (OPT_Node *x); import void OPB_Param (OPT_Node ap, OPT_Object fp); import void OPB_PrepCall (OPT_Node *x, OPT_Object *fpar); import void OPB_Return (OPT_Node *x, OPT_Object proc); import void OPB_SetElem (OPT_Node *x); import void OPB_SetRange (OPT_Node *x, OPT_Node y); -import void OPB_StFct (OPT_Node *par0, int8 fctno, int16 parno); -import void OPB_StPar0 (OPT_Node *par0, int16 fctno); -import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno); -import void OPB_StParN (OPT_Node *par0, OPT_Node x, int16 fctno, int16 n); -import void OPB_StaticLink (int8 dlev); +import void OPB_StFct (OPT_Node *par0, INT8 fctno, INT16 parno); +import void OPB_StPar0 (OPT_Node *par0, INT16 fctno); +import void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno); +import void OPB_StParN (OPT_Node *par0, OPT_Node x, INT16 fctno, INT16 n); +import void OPB_StaticLink (INT8 dlev); import void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard); import void *OPB__init(void); diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 27ab3d15..0ed7bf75 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -11,9 +11,9 @@ #include "OPT.h" -static int16 OPC_indentLevel; -static int8 OPC_hashtab[105]; -static CHAR OPC_keytab[50][9]; +static INT16 OPC_indentLevel; +static INT8 OPC_hashtab[105]; +static CHAR OPC_keytab[60][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -23,12 +23,12 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames); export OPT_Object OPC_BaseTProc (OPT_Object obj); export void OPC_BegBlk (void); export void OPC_BegStat (void); -static void OPC_CProcDefs (OPT_Object obj, int16 vis); -export void OPC_Case (int64 caseVal, int16 form); -static void OPC_CharacterLiteral (int64 c); -export void OPC_Cmp (int16 rel); +static void OPC_CProcDefs (OPT_Object obj, INT16 vis); +export void OPC_Case (INT64 caseVal, INT16 form); +static void OPC_CharacterLiteral (INT64 c); +export void OPC_Cmp (INT16 rel); export void OPC_CompleteIdent (OPT_Object obj); -export void OPC_Constant (OPT_Const con, int16 form); +export void OPC_Constant (OPT_Const con, INT16 form); static void OPC_DeclareBase (OPT_Object dcl); static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef); static void OPC_DeclareParams (OPT_Object par, BOOLEAN macro); @@ -45,45 +45,45 @@ export void OPC_EnterBody (void); export void OPC_EnterProc (OPT_Object proc); export void OPC_ExitBody (void); export void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet); -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign); -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign); +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign); +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign); export void OPC_GenBdy (OPT_Node n); -static void OPC_GenDynTypes (OPT_Node n, int16 vis); +static void OPC_GenDynTypes (OPT_Node n, INT16 vis); export void OPC_GenEnumPtrs (OPT_Object var); export void OPC_GenHdr (OPT_Node n); export void OPC_GenHdrIncludes (void); static void OPC_GenHeaderMsg (void); -export void OPC_Halt (int32 n); +export void OPC_Halt (INT32 n); export void OPC_Ident (OPT_Object obj); -static void OPC_IdentList (OPT_Object obj, int16 vis); +static void OPC_IdentList (OPT_Object obj, INT16 vis); static void OPC_Include (CHAR *name, LONGINT name__len); -static void OPC_IncludeImports (OPT_Object obj, int16 vis); +static void OPC_IncludeImports (OPT_Object obj, INT16 vis); export void OPC_Increment (BOOLEAN decrement); -export void OPC_Indent (int16 count); +export void OPC_Indent (INT16 count); export void OPC_Init (void); static void OPC_InitImports (OPT_Object obj); static void OPC_InitKeywords (void); export void OPC_InitTDesc (OPT_Struct typ); static void OPC_InitTProcs (OPT_Object typ, OPT_Object obj); -export void OPC_IntLiteral (int64 n, int32 size); -export void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +export void OPC_IntLiteral (INT64 n, INT32 size); +export void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName); -static int16 OPC_Length (CHAR *s, LONGINT s__len); +static INT16 OPC_Length (CHAR *s, LONGINT s__len); export BOOLEAN OPC_NeedsRetval (OPT_Object proc); -export int32 OPC_NofPtrs (OPT_Struct typ); -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len); +export INT32 OPC_NofPtrs (OPT_Struct typ); +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len); static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len); static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define); -static void OPC_ProcPredefs (OPT_Object obj, int8 vis); +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis); static void OPC_PutBase (OPT_Struct typ); -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt); +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt); static void OPC_RegCmds (OPT_Object obj); export void OPC_SetInclude (BOOLEAN exclude); static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause); -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x); -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l); +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x); +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l); export void OPC_TDescDecl (OPT_Struct typ); -export void OPC_TypeDefs (OPT_Object obj, int16 vis); +export void OPC_TypeDefs (OPT_Object obj, INT16 vis); export void OPC_TypeOf (OPT_Object ap); static BOOLEAN OPC_Undefined (OPT_Object obj); @@ -94,14 +94,14 @@ void OPC_Init (void) __MOVE("__init(void)", OPC_BodyNameExt, 13); } -void OPC_Indent (int16 count) +void OPC_Indent (INT16 count) { OPC_indentLevel += count; } void OPC_BegStat (void) { - int16 i; + INT16 i; i = OPC_indentLevel; while (i > 0) { OPM_Write(0x09); @@ -137,10 +137,10 @@ void OPC_EndBlk0 (void) OPM_Write('}'); } -static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) +static void OPC_Str1 (CHAR *s, LONGINT s__len, INT32 x) { CHAR ch; - int16 i; + INT16 i; __DUP(s, s__len, CHAR); ch = s[0]; i = 0; @@ -156,9 +156,9 @@ static void OPC_Str1 (CHAR *s, LONGINT s__len, int32 x) __DEL(s); } -static int16 OPC_Length (CHAR *s, LONGINT s__len) +static INT16 OPC_Length (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -166,13 +166,13 @@ static int16 OPC_Length (CHAR *s, LONGINT s__len) return i; } -static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) +static INT16 OPC_PerfectHash (CHAR *s, LONGINT s__len) { - int16 i, h; + INT16 i, h; i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + (int16)s[__X(i, s__len)]; + h = 3 * h + (INT16)s[__X(i, s__len)]; i += 1; } return (int)__MOD(h, 105); @@ -180,25 +180,25 @@ static int16 OPC_PerfectHash (CHAR *s, LONGINT s__len) void OPC_Ident (OPT_Object obj) { - int16 mode, level, h; + INT16 mode, level, h; mode = obj->mode; level = obj->mnolev; if ((__IN(mode, 0x62, 32) && level > 0) || __IN(mode, 0x14, 32)) { OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { OPM_Write('_'); } } } else if ((mode == 5 && __IN(obj->typ->form, 0x90, 32))) { if (obj->typ == OPT_adrtyp) { - OPM_WriteString((CHAR*)"address", 8); + OPM_WriteString((CHAR*)"ADDRESS", 8); } else { if (obj->typ->form == 4) { - OPM_WriteString((CHAR*)"int", 4); + OPM_WriteString((CHAR*)"INT", 4); } else { - OPM_WriteString((CHAR*)"uint", 5); + OPM_WriteString((CHAR*)"UINT", 5); } OPM_WriteInt(__ASHL(obj->typ->size, 3)); } @@ -224,7 +224,7 @@ void OPC_Ident (OPT_Object obj) static void OPC_Stars (OPT_Struct typ, BOOLEAN *openClause) { - int16 pointers; + INT16 pointers; *openClause = 0; if (((typ->strobj == NIL || typ->strobj->name[0] == 0x00) && typ->comp != 4)) { if (__IN(typ->comp, 0x0c, 32)) { @@ -260,7 +260,7 @@ static void OPC_DeclareObj (OPT_Object dcl, BOOLEAN scopeDef) { OPT_Struct typ = NIL; BOOLEAN varPar, openClause; - int16 form, comp; + INT16 form, comp; typ = dcl->typ; varPar = ((dcl->mode == 2 && typ->comp != 2) || typ->comp == 3) || scopeDef; OPC_Stars(typ, &openClause); @@ -324,8 +324,8 @@ static void OPC_DeclareBase (OPT_Object dcl) { OPT_Struct typ = NIL, prev = NIL; OPT_Object obj = NIL; - int16 nofdims; - int32 off, n, dummy; + INT16 nofdims; + INT32 off, n, dummy; typ = dcl->typ; prev = typ; while ((((((((typ->strobj == NIL || typ->comp == 3) || OPC_Undefined(typ->strobj)) && typ->comp != 4)) && typ->form != 10)) && !((typ->form == 11 && typ->BaseTyp->comp == 3)))) { @@ -384,11 +384,11 @@ static void OPC_DeclareBase (OPT_Object dcl) } } -int32 OPC_NofPtrs (OPT_Struct typ) +INT32 OPC_NofPtrs (OPT_Struct typ) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n; + INT32 n; if ((typ->form == 11 && typ->sysflag == 0)) { return 1; } else if ((typ->comp == 4 && __MASK(typ->sysflag, -256) == 0)) { @@ -422,11 +422,11 @@ int32 OPC_NofPtrs (OPT_Struct typ) __RETCHK; } -static void OPC_PutPtrOffsets (OPT_Struct typ, int32 adr, int32 *cnt) +static void OPC_PutPtrOffsets (OPT_Struct typ, INT32 adr, INT32 *cnt) { OPT_Object fld = NIL; OPT_Struct btyp = NIL; - int32 n, i; + INT32 n, i; if ((typ->form == 11 && typ->sysflag == 0)) { OPM_WriteInt(adr); OPM_WriteString((CHAR*)", ", 3); @@ -502,7 +502,7 @@ static void OPC_PutBase (OPT_Struct typ) static void OPC_LenList (OPT_Object par, BOOLEAN ansiDefine, BOOLEAN showParamName) { OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (showParamName) { OPC_Ident(par); OPM_WriteString((CHAR*)"__len", 6); @@ -599,7 +599,7 @@ static void OPC_DeclareTProcs (OPT_Object obj, BOOLEAN *empty) OPT_Object OPC_BaseTProc (OPT_Object obj) { OPT_Struct typ = NIL, base = NIL; - int32 mno; + INT32 mno; typ = obj->link->typ; if (typ->form == 11) { typ = typ->BaseTyp; @@ -722,7 +722,7 @@ static void OPC_DefineType (OPT_Struct str) static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) { - int16 i; + INT16 i; __DUP(y, y__len, CHAR); i = 0; while ((*x)[__X(i + 1, 256)] == y[__X(i, y__len)]) { @@ -732,14 +732,14 @@ static BOOLEAN OPC_Prefixed (OPT_ConstExt x, CHAR *y, LONGINT y__len) return y[__X(i, y__len)] == 0x00; } -static void OPC_CProcDefs (OPT_Object obj, int16 vis) +static void OPC_CProcDefs (OPT_Object obj, INT16 vis) { - int16 i; + INT16 i; OPT_ConstExt ext = NIL; - int16 _for__7; + INT16 _for__7; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && (int16)obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -748,7 +748,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__7 = (int16)(*obj->conval->ext)[0]; + _for__7 = (INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__7) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -760,7 +760,7 @@ static void OPC_CProcDefs (OPT_Object obj, int16 vis) } } -void OPC_TypeDefs (OPT_Object obj, int16 vis) +void OPC_TypeDefs (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_TypeDefs(obj->left, vis); @@ -792,7 +792,7 @@ static void OPC_DefAnonRecs (OPT_Node n) void OPC_TDescDecl (OPT_Struct typ) { - int32 nofptrs; + INT32 nofptrs; OPT_Object o = NIL; OPC_BegStat(); OPM_WriteString((CHAR*)"__TDESC(", 9); @@ -829,9 +829,9 @@ void OPC_InitTDesc (OPT_Struct typ) } } -static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *curAlign) +static void OPC_FillGap (INT32 gap, INT32 off, INT32 align, INT32 *n, INT32 *curAlign) { - int32 adr; + INT32 adr; adr = off; OPT_Align(&adr, align); if ((*curAlign < align && gap - (adr - off) >= align)) { @@ -839,13 +839,13 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur OPC_BegStat(); switch (align) { case 2: - OPM_WriteString((CHAR*)"int16", 6); + OPM_WriteString((CHAR*)"INT16", 6); break; case 4: - OPM_WriteString((CHAR*)"int32", 6); + OPM_WriteString((CHAR*)"INT32", 6); break; case 8: - OPM_WriteString((CHAR*)"int64", 6); + OPM_WriteString((CHAR*)"INT64", 6); break; default: OPM_LogWLn(); @@ -866,11 +866,11 @@ static void OPC_FillGap (int32 gap, int32 off, int32 align, int32 *n, int32 *cur } } -static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, int32 *curAlign) +static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, INT32 *off, INT32 *n, INT32 *curAlign) { OPT_Object fld = NIL; OPT_Struct base = NIL; - int32 gap, adr, align, fldAlign; + INT32 gap, adr, align, fldAlign; fld = typ->link; align = __MASK(typ->align, -65536); if (typ->BaseTyp != NIL) { @@ -926,16 +926,16 @@ static void OPC_FieldList (OPT_Struct typ, BOOLEAN last, int32 *off, int32 *n, i } } -static void OPC_IdentList (OPT_Object obj, int16 vis) +static void OPC_IdentList (OPT_Object obj, INT16 vis) { OPT_Struct base = NIL; BOOLEAN first; - int16 lastvis; + INT16 lastvis; base = NIL; first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05, 32) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || (int16)obj->vis != lastvis) { + if (obj->typ != base || (INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -974,7 +974,7 @@ static void OPC_IdentList (OPT_Object obj, int16 vis) } else if ((obj->mode == 2 && obj->typ->comp == 4)) { OPC_EndStat(); OPC_BegStat(); - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); base = NIL; @@ -1011,7 +1011,7 @@ static void OPC_AnsiParamList (OPT_Object obj, BOOLEAN showParamNames) OPM_WriteString((CHAR*)", LONGINT ", 11); OPC_LenList(obj, 1, showParamNames); } else if ((obj->mode == 2 && obj->typ->comp == 4)) { - OPM_WriteString((CHAR*)", address *", 12); + OPM_WriteString((CHAR*)", ADDRESS *", 12); if (showParamNames) { OPC_Ident(obj); OPM_WriteString((CHAR*)"__typ", 6); @@ -1044,7 +1044,7 @@ static void OPC_ProcHeader (OPT_Object proc, BOOLEAN define) OPM_WriteLn(); } -static void OPC_ProcPredefs (OPT_Object obj, int8 vis) +static void OPC_ProcPredefs (OPT_Object obj, INT8 vis) { if (obj != NIL) { OPC_ProcPredefs(obj->left, vis); @@ -1074,18 +1074,18 @@ static void OPC_Include (CHAR *name, LONGINT name__len) __DEL(name); } -static void OPC_IncludeImports (OPT_Object obj, int16 vis) +static void OPC_IncludeImports (OPT_Object obj, INT16 vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && (int16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); } } -static void OPC_GenDynTypes (OPT_Node n, int16 vis) +static void OPC_GenDynTypes (OPT_Node n, INT16 vis) { OPT_Struct typ = NIL; while ((n != NIL && n->class == 14)) { @@ -1099,7 +1099,7 @@ static void OPC_GenDynTypes (OPT_Node n, int16 vis) } else { OPM_WriteString((CHAR*)"export ", 8); } - OPM_WriteString((CHAR*)"address *", 10); + OPM_WriteString((CHAR*)"ADDRESS *", 10); OPC_Andent(typ); OPM_WriteString((CHAR*)"__typ", 6); OPC_EndStat(); @@ -1134,7 +1134,7 @@ void OPC_GenHdr (OPT_Node n) static void OPC_GenHeaderMsg (void) { - int16 i; + INT16 i; OPM_WriteString((CHAR*)"/* ", 4); OPM_WriteString((CHAR*)"voc", 4); OPM_Write(' '); @@ -1222,16 +1222,16 @@ void OPC_GenBdy (OPT_Node n) OPM_currFile = 1; OPC_GenHeaderMsg(); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SHORTINT int", 21); + OPM_WriteString((CHAR*)"#define SHORTINT INT", 21); OPM_WriteInt(__ASHL(OPT_sinttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define INTEGER int", 21); + OPM_WriteString((CHAR*)"#define INTEGER INT", 21); OPM_WriteInt(__ASHL(OPT_inttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define LONGINT int", 21); + OPM_WriteString((CHAR*)"#define LONGINT INT", 21); OPM_WriteInt(__ASHL(OPT_linttyp->size, 3)); OPM_WriteLn(); - OPM_WriteString((CHAR*)"#define SET uint", 22); + OPM_WriteString((CHAR*)"#define SET UINT", 22); OPM_WriteInt(__ASHL(OPT_settyp->size, 3)); OPM_WriteLn(); OPM_WriteLn(); @@ -1288,7 +1288,7 @@ static void OPC_InitImports (OPT_Object obj) void OPC_GenEnumPtrs (OPT_Object var) { OPT_Struct typ = NIL; - int32 n; + INT32 n; OPC_GlbPtrs = 0; while (var != NIL) { typ = var->typ; @@ -1438,7 +1438,7 @@ void OPC_EnterProc (OPT_Object proc) { OPT_Object var = NIL, scope = NIL; OPT_Struct typ = NIL; - int16 dim; + INT16 dim; if (proc->vis != 1) { OPM_WriteString((CHAR*)"static ", 8); } @@ -1652,7 +1652,7 @@ void OPC_ExitProc (OPT_Object proc, BOOLEAN eoBlock, BOOLEAN implicitRet) void OPC_CompleteIdent (OPT_Object obj) { - int16 comp, level; + INT16 comp, level; level = obj->mnolev; if (obj->adr == 1) { if (obj->typ->comp == 4) { @@ -1681,10 +1681,10 @@ void OPC_CompleteIdent (OPT_Object obj) void OPC_TypeOf (OPT_Object ap) { - int16 i; + INT16 i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if ((int16)ap->mnolev != OPM_level) { + if ((INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1700,7 +1700,7 @@ void OPC_TypeOf (OPT_Object ap) } } -void OPC_Cmp (int16 rel) +void OPC_Cmp (INT16 rel) { switch (rel) { case 9: @@ -1729,7 +1729,7 @@ void OPC_Cmp (int16 rel) } } -static void OPC_CharacterLiteral (int64 c) +static void OPC_CharacterLiteral (INT64 c) { if (c < 32 || c > 126) { OPM_WriteString((CHAR*)"0x", 3); @@ -1744,15 +1744,15 @@ static void OPC_CharacterLiteral (int64 c) } } -static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) +static void OPC_StringLiteral (CHAR *s, LONGINT s__len, INT32 l) { - int32 i; - int16 c; + INT32 i; + INT16 c; __DUP(s, s__len, CHAR); OPM_Write('"'); i = 0; while (i < l) { - c = (int16)s[__X(i, s__len)]; + c = (INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1772,7 +1772,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, int32 l) __DEL(s); } -void OPC_Case (int64 caseVal, int16 form) +void OPC_Case (INT64 caseVal, INT16 form) { CHAR ch; OPM_WriteString((CHAR*)"case ", 6); @@ -1810,15 +1810,15 @@ void OPC_Increment (BOOLEAN decrement) } } -void OPC_Halt (int32 n) +void OPC_Halt (INT32 n) { OPC_Str1((CHAR*)"__HALT(#)", 10, n); } -void OPC_IntLiteral (int64 n, int32 size) +void OPC_IntLiteral (INT64 n, INT32 size) { if ((((size > 4 && n <= 2147483647)) && n > (-2147483647-1))) { - OPM_WriteString((CHAR*)"((int", 6); + OPM_WriteString((CHAR*)"((INT", 6); OPM_WriteInt(__ASHL(size, 3)); OPM_WriteString((CHAR*)")(", 3); OPM_WriteInt(n); @@ -1828,7 +1828,7 @@ void OPC_IntLiteral (int64 n, int32 size) } } -void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) +void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim) { if (array->comp == 3) { OPC_CompleteIdent(obj); @@ -1845,11 +1845,11 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim) } } -void OPC_Constant (OPT_Const con, int16 form) +void OPC_Constant (OPT_Const con, INT16 form) { - int16 i; - uint64 s; - int64 hex; + INT16 i; + UINT64 s; + INT64 hex; BOOLEAN skipLeading; switch (form) { case 1: @@ -1908,7 +1908,7 @@ void OPC_Constant (OPT_Const con, int16 form) } static struct InitKeywords__46 { - int8 *n; + INT8 *n; struct InitKeywords__46 *lnk; } *InitKeywords__46_s; @@ -1916,18 +1916,18 @@ static void Enter__47 (CHAR *s, LONGINT s__len); static void Enter__47 (CHAR *s, LONGINT s__len) { - int16 h; + INT16 h; __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } static void OPC_InitKeywords (void) { - int8 n, i; + INT8 n, i; struct InitKeywords__46 _s; _s.n = &n; _s.lnk = InitKeywords__46_s; @@ -1938,7 +1938,24 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } + Enter__47((CHAR*)"ADDRESS", 8); + Enter__47((CHAR*)"INT16", 6); + Enter__47((CHAR*)"INT32", 6); + Enter__47((CHAR*)"INT64", 6); + Enter__47((CHAR*)"INT8", 5); + Enter__47((CHAR*)"UINT16", 7); + Enter__47((CHAR*)"UINT32", 7); + Enter__47((CHAR*)"UINT64", 7); + Enter__47((CHAR*)"UINT8", 6); Enter__47((CHAR*)"address", 8); + Enter__47((CHAR*)"int16", 6); + Enter__47((CHAR*)"int32", 6); + Enter__47((CHAR*)"int64", 6); + Enter__47((CHAR*)"int8", 5); + Enter__47((CHAR*)"uint16", 7); + Enter__47((CHAR*)"uint32", 7); + Enter__47((CHAR*)"uint64", 7); + Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); @@ -1960,10 +1977,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"if", 3); Enter__47((CHAR*)"import", 7); Enter__47((CHAR*)"int", 4); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); Enter__47((CHAR*)"long", 5); Enter__47((CHAR*)"register", 9); Enter__47((CHAR*)"return", 7); @@ -1975,10 +1988,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"struct", 7); Enter__47((CHAR*)"switch", 7); Enter__47((CHAR*)"typedef", 8); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"union", 6); Enter__47((CHAR*)"unsigned", 9); Enter__47((CHAR*)"void", 5); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index bbfd1911..f7fc51f9 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h @@ -13,10 +13,10 @@ import void OPC_Andent (OPT_Struct typ); import OPT_Object OPC_BaseTProc (OPT_Object obj); import void OPC_BegBlk (void); import void OPC_BegStat (void); -import void OPC_Case (int64 caseVal, int16 form); -import void OPC_Cmp (int16 rel); +import void OPC_Case (INT64 caseVal, INT16 form); +import void OPC_Cmp (INT16 rel); import void OPC_CompleteIdent (OPT_Object obj); -import void OPC_Constant (OPT_Const con, int16 form); +import void OPC_Constant (OPT_Const con, INT16 form); import void OPC_DefineInter (OPT_Object proc); import void OPC_EndBlk (void); import void OPC_EndBlk0 (void); @@ -29,19 +29,19 @@ import void OPC_GenBdy (OPT_Node n); import void OPC_GenEnumPtrs (OPT_Object var); import void OPC_GenHdr (OPT_Node n); import void OPC_GenHdrIncludes (void); -import void OPC_Halt (int32 n); +import void OPC_Halt (INT32 n); import void OPC_Ident (OPT_Object obj); import void OPC_Increment (BOOLEAN decrement); -import void OPC_Indent (int16 count); +import void OPC_Indent (INT16 count); import void OPC_Init (void); import void OPC_InitTDesc (OPT_Struct typ); -import void OPC_IntLiteral (int64 n, int32 size); -import void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim); +import void OPC_IntLiteral (INT64 n, INT32 size); +import void OPC_Len (OPT_Object obj, OPT_Struct array, INT64 dim); import BOOLEAN OPC_NeedsRetval (OPT_Object proc); -import int32 OPC_NofPtrs (OPT_Struct typ); +import INT32 OPC_NofPtrs (OPT_Struct typ); import void OPC_SetInclude (BOOLEAN exclude); import void OPC_TDescDecl (OPT_Struct typ); -import void OPC_TypeDefs (OPT_Object obj, int16 vis); +import void OPC_TypeDefs (OPT_Object obj, INT16 vis); import void OPC_TypeOf (OPT_Object ap); import void *OPC__init(void); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5b67d672..46b6c33e 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -22,81 +22,81 @@ typedef static CHAR OPM_SourceFileName[256]; static CHAR OPM_GlobalModel[10]; export CHAR OPM_Model[10]; -static int16 OPM_GlobalAddressSize; -export int16 OPM_AddressSize; -static int16 OPM_GlobalAlignment; -export int16 OPM_Alignment; -export uint32 OPM_GlobalOptions, OPM_Options; -export int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -export int64 OPM_MaxIndex; +static INT16 OPM_GlobalAddressSize; +export INT16 OPM_AddressSize; +static INT16 OPM_GlobalAlignment; +export INT16 OPM_Alignment; +export UINT32 OPM_GlobalOptions, OPM_Options; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; -export int32 OPM_curpos, OPM_errpos, OPM_breakpc; -export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +export INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +export INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; -static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; +static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; -static int16 OPM_S; +static INT16 OPM_S; export CHAR OPM_ResourceDir[1024]; -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F); +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F); export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); -export void OPM_FPrint (int32 *fp, int64 val); -export void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -export void OPM_FPrintReal (int32 *fp, REAL real); -export void OPM_FPrintSet (int32 *fp, uint64 set); -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos); +export void OPM_FPrint (INT32 *fp, INT64 val); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +export void OPM_FPrintReal (INT32 *fp, REAL real); +export void OPM_FPrintSet (INT32 *fp, UINT64 set); +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); -export int16 OPM_Integer (int64 n); -static void OPM_LogErrMsg (int16 n); +export INT16 OPM_Integer (INT64 n); +static void OPM_LogErrMsg (INT16 n); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); -export void OPM_LogWNum (int64 i, int64 len); +export void OPM_LogWNum (INT64 i, INT64 len); export void OPM_LogWStr (CHAR *s, LONGINT s__len); -export int32 OPM_Longint (int64 n); +export INT32 OPM_Longint (INT64 n); static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len); -export void OPM_Mark (int16 n, int32 pos); +export void OPM_Mark (INT16 n, INT32 pos); export void OPM_NewSym (CHAR *modName, LONGINT modName__len); export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); export BOOLEAN OPM_OpenPar (void); export void OPM_RegisterNewSym (void); static void OPM_ScanOptions (CHAR *s, LONGINT s__len); -static void OPM_ShowLine (int64 pos); -export int64 OPM_SignedMaximum (int32 bytecount); -export int64 OPM_SignedMinimum (int32 bytecount); +static void OPM_ShowLine (INT64 pos); +export INT64 OPM_SignedMaximum (INT32 bytecount); +export INT64 OPM_SignedMinimum (INT32 bytecount); export void OPM_SymRCh (CHAR *ch); -export int32 OPM_SymRInt (void); -export int64 OPM_SymRInt64 (void); +export INT32 OPM_SymRInt (void); +export INT64 OPM_SymRInt64 (void); export void OPM_SymRLReal (LONGREAL *lr); export void OPM_SymRReal (REAL *r); -export void OPM_SymRSet (uint64 *s); +export void OPM_SymRSet (UINT64 *s); export void OPM_SymWCh (CHAR ch); -export void OPM_SymWInt (int64 i); +export void OPM_SymWInt (INT64 i); export void OPM_SymWLReal (LONGREAL lr); export void OPM_SymWReal (REAL r); -export void OPM_SymWSet (uint64 s); +export void OPM_SymWSet (UINT64 s); static void OPM_VerboseListSizes (void); export void OPM_Write (CHAR ch); -export void OPM_WriteHex (int64 i); -export void OPM_WriteInt (int64 i); +export void OPM_WriteHex (INT64 i); +export void OPM_WriteInt (INT64 i); export void OPM_WriteLn (void); export void OPM_WriteReal (LONGREAL r, CHAR suffx); export void OPM_WriteString (CHAR *s, LONGINT s__len); export void OPM_WriteStringVar (CHAR *s, LONGINT s__len); export BOOLEAN OPM_eofSF (void); -export void OPM_err (int16 n); +export void OPM_err (INT16 n); #define OPM_GetAlignment(a) struct {char c; long long l;} _s; *a = (char*)&_s.l - (char*)&_s @@ -112,7 +112,7 @@ void OPM_LogWStr (CHAR *s, LONGINT s__len) __DEL(s); } -void OPM_LogWNum (int64 i, int64 len) +void OPM_LogWNum (INT64 i, INT64 len) { Out_Int(i, len); } @@ -122,32 +122,32 @@ void OPM_LogWLn (void) Out_Ln(); } -int64 OPM_SignedMaximum (int32 bytecount) +INT64 OPM_SignedMaximum (INT32 bytecount) { - int64 result; + INT64 result; result = 1; result = __LSH(result, __ASHL(bytecount, 3) - 1, 64); return result - 1; } -int64 OPM_SignedMinimum (int32 bytecount) +INT64 OPM_SignedMinimum (INT32 bytecount) { return -OPM_SignedMaximum(bytecount) - 1; } -int32 OPM_Longint (int64 n) +INT32 OPM_Longint (INT64 n) { - return __VAL(int32, n); + return __VAL(INT32, n); } -int16 OPM_Integer (int64 n) +INT16 OPM_Integer (INT64 n) { - return __VAL(int16, n); + return __VAL(INT16, n); } static void OPM_ScanOptions (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 1; while (s[__X(i, s__len)] != 0x00) { @@ -213,23 +213,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41); OPM_LogWLn(); } else { - OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48; - OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i + 1, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i + 2, s__len)] - 48; i += 2; } break; case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48; + OPM_IntegerSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_AddressSize = (int16)s[__X(i, s__len)] - 48; + OPM_AddressSize = (INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = (int16)s[__X(i, s__len)] - 48; + OPM_Alignment = (INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0); @@ -465,7 +465,7 @@ void OPM_InitOptions (void) void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len) { Texts_Text T = NIL; - int32 beg, end, time; + INT32 beg, end, time; CHAR s[256]; *done = 0; OPM_curpos = 0; @@ -513,7 +513,7 @@ void OPM_Get (CHAR *ch) static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len) { - int16 i, j; + INT16 i, j; CHAR ch; __DUP(ext, ext__len, CHAR); i = 0; @@ -535,12 +535,12 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN __DEL(ext); } -static void OPM_LogErrMsg (int16 n) +static void OPM_LogErrMsg (INT16 n) { Texts_Scanner S; Texts_Text T = NIL; CHAR ch; - int16 i; + INT16 i; CHAR buf[1024]; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { @@ -565,21 +565,21 @@ static void OPM_LogErrMsg (int16 n) OPM_LogWStr(errors_errors[__X(n, 350)], 128); } -static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos) +static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) { CHAR ch, cheol; - if (pos < (int64)OPM_ErrorLineStartPos) { + if (pos < (INT64)OPM_ErrorLineStartPos) { OPM_ErrorLineStartPos = 0; OPM_ErrorLineLimitPos = 0; OPM_ErrorLineNumber = 0; } - if (pos < (int64)OPM_ErrorLineLimitPos) { + if (pos < (INT64)OPM_ErrorLineLimitPos) { Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); return; } Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos); Files_Read(&*r, r__typ, (void*)&ch); - while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { + while (((INT64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) { OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos; OPM_ErrorLineNumber += 1; while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) { @@ -597,12 +597,12 @@ static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 p Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos); } -static void OPM_ShowLine (int64 pos) +static void OPM_ShowLine (INT64 pos) { Files_File f = NIL; Files_Rider r; CHAR line[1023]; - int16 i; + INT16 i; CHAR ch; f = Files_Old(OPM_SourceFileName, 256); OPM_FindLine(f, &r, Files_Rider__typ, pos); @@ -621,10 +621,10 @@ static void OPM_ShowLine (int64 pos) OPM_LogWStr(line, 1023); OPM_LogWLn(); OPM_LogWStr((CHAR*)" ", 7); - if (pos >= (int64)OPM_ErrorLineLimitPos) { + if (pos >= (INT64)OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos); + i = (INT16)OPM_Longint(pos - (INT64)OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -639,7 +639,7 @@ static void OPM_ShowLine (int64 pos) Files_Close(f); } -void OPM_Mark (int16 n, int32 pos) +void OPM_Mark (INT16 n, INT32 pos) { if (pos == -1) { pos = 0; @@ -691,34 +691,34 @@ void OPM_Mark (int16 n, int32 pos) } } -void OPM_err (int16 n) +void OPM_err (INT16 n) { OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (int32 *fp, int64 val) +void OPM_FPrint (INT32 *fp, INT64 val) { - *fp = __ROTL((int32)((uint32)*fp ^ __VAL(uint32, val)), 1, 32); + *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); } -void OPM_FPrintSet (int32 *fp, uint64 set) +void OPM_FPrintSet (INT32 *fp, UINT64 set) { - OPM_FPrint(&*fp, __VAL(int32, set)); + OPM_FPrint(&*fp, __VAL(INT32, set)); } -void OPM_FPrintReal (int32 *fp, REAL real) +void OPM_FPrintReal (INT32 *fp, REAL real) { - int16 i; - int32 l; - __GET((address)&real, l, int32); + INT16 i; + INT32 l; + __GET((address)&real, l, INT32); OPM_FPrint(&*fp, l); } -void OPM_FPrintLReal (int32 *fp, LONGREAL lr) +void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { - int32 l, h; - __GET((address)&lr, l, int32); - __GET((address)&lr + 4, h, int32); + INT32 l, h; + __GET((address)&lr, l, INT32); + __GET((address)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } @@ -728,21 +728,21 @@ void OPM_SymRCh (CHAR *ch) Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch); } -int32 OPM_SymRInt (void) +INT32 OPM_SymRInt (void) { - int32 k; + INT32 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 4); return k; } -int64 OPM_SymRInt64 (void) +INT64 OPM_SymRInt64 (void) { - int64 k; + INT64 k; Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&k, 8); return k; } -void OPM_SymRSet (uint64 *s) +void OPM_SymRSet (UINT64 *s) { Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (void*)&*s, 8); } @@ -790,14 +790,14 @@ void OPM_SymWCh (CHAR ch) Files_Write(&OPM_newSF, Files_Rider__typ, ch); } -void OPM_SymWInt (int64 i) +void OPM_SymWInt (INT64 i) { Files_WriteNum(&OPM_newSF, Files_Rider__typ, i); } -void OPM_SymWSet (uint64 s) +void OPM_SymWSet (UINT64 s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (INT64)s); } void OPM_SymWReal (REAL r) @@ -841,7 +841,7 @@ void OPM_Write (CHAR ch) void OPM_WriteString (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -851,7 +851,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len) void OPM_WriteStringVar (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { i += 1; @@ -859,17 +859,17 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len) Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i); } -void OPM_WriteHex (int64 i) +void OPM_WriteHex (INT64 i) { CHAR s[3]; - int32 digit; - digit = __ASHR((int32)i, 4); + INT32 digit; + digit = __ASHR((INT32)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK((int32)i, -16); + digit = __MASK((INT32)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { @@ -879,10 +879,10 @@ void OPM_WriteHex (int64 i) OPM_WriteString(s, 3); } -void OPM_WriteInt (int64 i) +void OPM_WriteInt (INT64 i) { CHAR s[24]; - int64 i1, k; + INT64 i1, k; if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) { OPM_Write('('); OPM_WriteInt(i + 1); @@ -915,14 +915,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx) Texts_Reader R; CHAR s[32]; CHAR ch; - int16 i; - if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) { + INT16 i; + if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((INT32)__ENTIER(r)))) { if (suffx == 'f') { OPM_WriteString((CHAR*)"(REAL)", 7); } else { OPM_WriteString((CHAR*)"(LONGREAL)", 11); } - OPM_WriteInt((int32)__ENTIER(r)); + OPM_WriteInt((INT32)__ENTIER(r)); } else { Texts_OpenWriter(&W, Texts_Writer__typ); if (suffx == 'f') { @@ -960,7 +960,7 @@ void OPM_WriteLn (void) Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a); } -static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F) +static void OPM_Append (Files_Rider *R, ADDRESS *R__typ, Files_File F) { Files_Rider R1; CHAR buffer[4096]; @@ -1003,7 +1003,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len) void OPM_CloseFiles (void) { CHAR FName[32]; - int16 res; + INT16 res; if (OPM_noerr) { OPM_LogWStr((CHAR*)" ", 3); OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0); diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index be9e98bd..42866571 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -7,14 +7,14 @@ import CHAR OPM_Model[10]; -import int16 OPM_AddressSize, OPM_Alignment; -import uint32 OPM_GlobalOptions, OPM_Options; -import int16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; -import int64 OPM_MaxIndex; +import INT16 OPM_AddressSize, OPM_Alignment; +import UINT32 OPM_GlobalOptions, OPM_Options; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; -import int32 OPM_curpos, OPM_errpos, OPM_breakpc; -import int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; +import INT32 OPM_curpos, OPM_errpos, OPM_breakpc; +import INT16 OPM_currFile, OPM_level, OPM_pc, OPM_entno; import CHAR OPM_modName[32]; import CHAR OPM_objname[64]; import CHAR OPM_ResourceDir[1024]; @@ -23,47 +23,47 @@ import CHAR OPM_ResourceDir[1024]; import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); -import void OPM_FPrint (int32 *fp, int64 val); -import void OPM_FPrintLReal (int32 *fp, LONGREAL lr); -import void OPM_FPrintReal (int32 *fp, REAL real); -import void OPM_FPrintSet (int32 *fp, uint64 set); +import void OPM_FPrint (INT32 *fp, INT64 val); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); +import void OPM_FPrintReal (INT32 *fp, REAL real); +import void OPM_FPrintSet (INT32 *fp, UINT64 set); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); -import int16 OPM_Integer (int64 n); +import INT16 OPM_Integer (INT64 n); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); -import void OPM_LogWNum (int64 i, int64 len); +import void OPM_LogWNum (INT64 i, INT64 len); import void OPM_LogWStr (CHAR *s, LONGINT s__len); -import int32 OPM_Longint (int64 n); -import void OPM_Mark (int16 n, int32 pos); +import INT32 OPM_Longint (INT64 n); +import void OPM_Mark (INT16 n, INT32 pos); import void OPM_NewSym (CHAR *modName, LONGINT modName__len); import void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done); import void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len); import BOOLEAN OPM_OpenPar (void); import void OPM_RegisterNewSym (void); -import int64 OPM_SignedMaximum (int32 bytecount); -import int64 OPM_SignedMinimum (int32 bytecount); +import INT64 OPM_SignedMaximum (INT32 bytecount); +import INT64 OPM_SignedMinimum (INT32 bytecount); import void OPM_SymRCh (CHAR *ch); -import int32 OPM_SymRInt (void); -import int64 OPM_SymRInt64 (void); +import INT32 OPM_SymRInt (void); +import INT64 OPM_SymRInt64 (void); import void OPM_SymRLReal (LONGREAL *lr); import void OPM_SymRReal (REAL *r); -import void OPM_SymRSet (uint64 *s); +import void OPM_SymRSet (UINT64 *s); import void OPM_SymWCh (CHAR ch); -import void OPM_SymWInt (int64 i); +import void OPM_SymWInt (INT64 i); import void OPM_SymWLReal (LONGREAL lr); import void OPM_SymWReal (REAL r); -import void OPM_SymWSet (uint64 s); +import void OPM_SymWSet (UINT64 s); import void OPM_Write (CHAR ch); -import void OPM_WriteHex (int64 i); -import void OPM_WriteInt (int64 i); +import void OPM_WriteHex (INT64 i); +import void OPM_WriteInt (INT64 i); import void OPM_WriteLn (void); import void OPM_WriteReal (LONGREAL r, CHAR suffx); import void OPM_WriteString (CHAR *s, LONGINT s__len); import void OPM_WriteStringVar (CHAR *s, LONGINT s__len); import BOOLEAN OPM_eofSF (void); -import void OPM_err (int16 n); +import void OPM_err (INT16 n); import void *OPM__init(void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 615109df..3eabde0b 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPB.h" @@ -12,38 +12,38 @@ #include "OPT.h" struct OPP__1 { - int32 low, high; + INT32 low, high; }; typedef struct OPP__1 OPP_CaseTable[128]; -static int8 OPP_sym, OPP_level; -static int16 OPP_LoopLevel; +static INT8 OPP_sym, OPP_level; +static INT16 OPP_LoopLevel; static OPT_Node OPP_TDinit, OPP_lastTDinit; -static int16 OPP_nofFwdPtr; +static INT16 OPP_nofFwdPtr; static OPT_Struct OPP_FwdPtr[64]; -export address *OPP__1__typ; +export ADDRESS *OPP__1__typ; static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar); static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq); -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab); -static void OPP_CheckMark (int8 *vis); -static void OPP_CheckSym (int16 s); -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_); +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab); +static void OPP_CheckMark (INT8 *vis); +static void OPP_CheckSym (INT16 s); +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_); static void OPP_ConstExpression (OPT_Node *x); static void OPP_Element (OPT_Node *x); static void OPP_Expression (OPT_Node *x); static BOOLEAN OPP_Extends (OPT_Struct x, OPT_Struct b); static void OPP_Factor (OPT_Node *x); static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp); -export void OPP_Module (OPT_Node *prog, uint32 opt); +export void OPP_Module (OPT_Node *prog, UINT32 opt); static void OPP_PointerType (OPT_Struct *typ); static void OPP_ProcedureDeclaration (OPT_Node *x); -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec); static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned); static void OPP_Sets (OPT_Node *x); static void OPP_SimpleExpression (OPT_Node *x); @@ -52,19 +52,19 @@ static void OPP_StatSeq (OPT_Node *stat); static void OPP_Term (OPT_Node *x); static void OPP_Type (OPT_Struct *typ, OPT_Struct *banned); static void OPP_TypeDecl (OPT_Struct *typ, OPT_Struct *banned); -static void OPP_err (int16 n); +static void OPP_err (INT16 n); static void OPP_qualident (OPT_Object *id); static void OPP_selector (OPT_Node *x); -static void OPP_err (int16 n) +static void OPP_err (INT16 n) { OPM_err(n); } -static void OPP_CheckSym (int16 s) +static void OPP_CheckSym (INT16 s) { - if ((int16)OPP_sym == s) { + if ((INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -74,7 +74,7 @@ static void OPP_CheckSym (int16 s) static void OPP_qualident (OPT_Object *id) { OPT_Object obj = NIL; - int8 lev; + INT8 lev; OPT_Find(&obj); OPS_Get(&OPP_sym); if ((((OPP_sym == 18 && obj != NIL)) && obj->mode == 11)) { @@ -114,7 +114,7 @@ static void OPP_ConstExpression (OPT_Node *x) } } -static void OPP_CheckMark (int8 *vis) +static void OPP_CheckMark (INT8 *vis) { OPS_Get(&OPP_sym); if (OPP_sym == 1 || OPP_sym == 7) { @@ -132,10 +132,10 @@ static void OPP_CheckMark (int8 *vis) } } -static void OPP_CheckSysFlag (int16 *sysflag, int16 default_) +static void OPP_CheckSysFlag (INT16 *sysflag, INT16 default_) { OPT_Node x = NIL; - int64 sf; + INT64 sf; if (OPP_sym == 31) { OPS_Get(&OPP_sym); if (!OPT_SYSimported) { @@ -163,7 +163,7 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Object fld = NIL, first = NIL, last = NIL, base = NIL; OPT_Struct ftyp = NIL; - int16 sysflag; + INT16 sysflag; *typ = OPT_NewStr(13, 4); (*typ)->BaseTyp = NIL; OPP_CheckSysFlag(&sysflag, -1); @@ -255,8 +255,8 @@ static void OPP_RecordType (OPT_Struct *typ, OPT_Struct *banned) static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) { OPT_Node x = NIL; - int64 n; - int16 sysflag; + INT64 n; + INT16 sysflag; OPP_CheckSysFlag(&sysflag, 0); if (OPP_sym == 25) { *typ = OPT_NewStr(13, 3); @@ -348,7 +348,7 @@ static void OPP_PointerType (OPT_Struct *typ) static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) { - int8 mode; + INT8 mode; OPT_Object par = NIL, first = NIL, last = NIL, res = NIL; OPT_Struct typ = NIL; first = NIL; @@ -629,9 +629,9 @@ static void OPP_ActualParameters (OPT_Node *aparlist, OPT_Object fpar) static void OPP_StandProcCall (OPT_Node *x) { OPT_Node y = NIL; - int8 m; - int16 n; - m = (int8)((int16)(*x)->obj->adr); + INT8 m; + INT16 n; + m = (INT8)((INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -790,7 +790,7 @@ static void OPP_Factor (OPT_Node *x) static void OPP_Term (OPT_Node *x) { OPT_Node y = NIL; - int8 mulop; + INT8 mulop; OPP_Factor(&*x); while ((1 <= OPP_sym && OPP_sym <= 5)) { mulop = OPP_sym; @@ -803,7 +803,7 @@ static void OPP_Term (OPT_Node *x) static void OPP_SimpleExpression (OPT_Node *x) { OPT_Node y = NIL; - int8 addop; + INT8 addop; if (OPP_sym == 7) { OPS_Get(&OPP_sym); OPP_Term(&*x); @@ -827,7 +827,7 @@ static void OPP_Expression (OPT_Node *x) { OPT_Node y = NIL; OPT_Object obj = NIL; - int8 relation; + INT8 relation; OPP_SimpleExpression(&*x); if ((9 <= OPP_sym && OPP_sym <= 14)) { relation = OPP_sym; @@ -853,7 +853,7 @@ static void OPP_Expression (OPT_Node *x) } } -static void OPP_Receiver (int8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) +static void OPP_Receiver (INT8 *mode, OPS_Name name, OPT_Struct *typ, OPT_Struct *rec) { OPT_Object obj = NIL; *typ = OPT_undftyp; @@ -917,7 +917,7 @@ static struct ProcedureDeclaration__16 { OPT_Node *x; OPT_Object *proc, *fwd; OPS_Name *name; - int8 *mode, *vis; + INT8 *mode, *vis; BOOLEAN *forward; struct ProcedureDeclaration__16 *lnk; } *ProcedureDeclaration__16_s; @@ -930,8 +930,8 @@ static void TProcDecl__23 (void); static void GetCode__19 (void) { OPT_ConstExt ext = NIL; - int16 n; - int64 c; + INT16 n; + INT64 c; ext = OPT_NewExt(); (*ProcedureDeclaration__16_s->proc)->conval->ext = ext; n = 0; @@ -995,7 +995,7 @@ static void GetParams__21 (void) static void Body__17 (void) { OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; c = OPM_errpos; (*ProcedureDeclaration__16_s->proc)->conval->setval |= __SETOF(1,64); OPP_CheckSym(39); @@ -1018,7 +1018,7 @@ static void TProcDecl__23 (void) { OPT_Object baseProc = NIL; OPT_Struct objTyp = NIL, recTyp = NIL; - int8 objMode; + INT8 objMode; OPS_Name objName; OPS_Get(&OPP_sym); *ProcedureDeclaration__16_s->mode = 13; @@ -1090,7 +1090,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) { OPT_Object proc = NIL, fwd = NIL; OPS_Name name; - int8 mode, vis; + INT8 mode, vis; BOOLEAN forward; struct ProcedureDeclaration__16 _s; _s.x = x; @@ -1167,11 +1167,11 @@ static void OPP_ProcedureDeclaration (OPT_Node *x) ProcedureDeclaration__16_s = _s.lnk; } -static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP_CaseTable tab) +static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INT16 *n, OPP_CaseTable tab) { OPT_Node x = NIL, y = NIL, lastlab = NIL; - int16 i, f; - int32 xval, yval; + INT16 i, f; + INT32 xval, yval; *lab = NIL; lastlab = NIL; for (;;) { @@ -1187,14 +1187,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP if (!(LabelTyp->form == 4) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if ((int16)LabelTyp->form != f) { + } else if ((INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = OPM_Longint(y->conval->intval); - if (((int16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { + if (((INT16)y->typ->form != f && !((f == 4 && y->typ->form == 4)))) { OPP_err(60); } if (yval < xval) { @@ -1238,7 +1238,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, int16 *n, OPP } static struct StatSeq__30 { - int32 *pos; + INT32 *pos; struct StatSeq__30 *lnk; } *StatSeq__30_s; @@ -1248,8 +1248,8 @@ static void SetPos__35 (OPT_Node x); static void CasePart__31 (OPT_Node *x) { - int16 n; - int32 low, high; + INT16 n; + INT32 low, high; BOOLEAN e; OPP_CaseTable tab; OPT_Node cases = NIL, lab = NIL, y = NIL, lastcase = NIL; @@ -1332,7 +1332,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPT_Struct idtyp = NIL; BOOLEAN e; OPT_Node s = NIL, x = NIL, y = NIL, z = NIL, apar = NIL, last = NIL, lastif = NIL; - int32 pos; + INT32 pos; OPS_Name name; struct StatSeq__30 _s; _s.pos = &pos; @@ -1625,7 +1625,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPT_Struct typ = NIL; OPT_Object obj = NIL, first = NIL, last = NIL; OPT_Node x = NIL, lastdec = NIL; - int16 i; + INT16 i; first = NIL; last = NIL; OPP_nofFwdPtr = 0; @@ -1774,11 +1774,11 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq) OPP_CheckSym(41); } -void OPP_Module (OPT_Node *prog, uint32 opt) +void OPP_Module (OPT_Node *prog, UINT32 opt) { OPS_Name impName, aliasName; OPT_Node procdec = NIL, statseq = NIL; - int32 c; + INT32 c; BOOLEAN done; OPS_Init(); OPP_LoopLevel = 0; diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index de0e599a..cb3aabc8 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h @@ -9,7 +9,7 @@ -import void OPP_Module (OPT_Node *prog, uint32 opt); +import void OPP_Module (OPT_Node *prog, UINT32 opt); import void *OPP__init(void); diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5a34663d..5d7b776f 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -17,29 +17,29 @@ typedef export OPS_Name OPS_name; export OPS_String OPS_str; -export int16 OPS_numtyp; -export int64 OPS_intval; +export INT16 OPS_numtyp; +export INT64 OPS_intval; export REAL OPS_realval; export LONGREAL OPS_lrlval; static CHAR OPS_ch; -export void OPS_Get (int8 *sym); -static void OPS_Identifier (int8 *sym); +export void OPS_Get (INT8 *sym); +static void OPS_Identifier (INT8 *sym); export void OPS_Init (void); static void OPS_Number (void); -static void OPS_Str (int8 *sym); -static void OPS_err (int16 n); +static void OPS_Str (INT8 *sym); +static void OPS_err (INT16 n); -static void OPS_err (int16 n) +static void OPS_err (INT16 n) { OPM_err(n); } -static void OPS_Str (int8 *sym) +static void OPS_Str (INT8 *sym) { - int16 i; + INT16 i; CHAR och; i = 0; och = OPS_ch; @@ -65,15 +65,15 @@ static void OPS_Str (int8 *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = (int16)OPS_str[0]; + OPS_intval = (INT16)OPS_str[0]; } else { *sym = 37; } } -static void OPS_Identifier (int8 *sym) +static void OPS_Identifier (INT8 *sym) { - int16 i; + INT16 i; i = 0; do { OPS_name[i] = OPS_ch; @@ -92,10 +92,10 @@ static struct Number__6 { struct Number__6 *lnk; } *Number__6_s; -static int16 Ord__7 (CHAR ch, BOOLEAN hex); -static LONGREAL Ten__9 (int16 e); +static INT16 Ord__7 (CHAR ch, BOOLEAN hex); +static LONGREAL Ten__9 (INT16 e); -static LONGREAL Ten__9 (int16 e) +static LONGREAL Ten__9 (INT16 e) { LONGREAL x, p; x = (LONGREAL)1; @@ -112,12 +112,12 @@ static LONGREAL Ten__9 (int16 e) return x; } -static int16 Ord__7 (CHAR ch, BOOLEAN hex) +static INT16 Ord__7 (CHAR ch, BOOLEAN hex) { if (ch <= '9') { - return (int16)ch - 48; + return (INT16)ch - 48; } else if (hex) { - return ((int16)ch - 65) + 10; + return ((INT16)ch - 65) + 10; } else { OPS_err(2); return 0; @@ -127,7 +127,7 @@ static int16 Ord__7 (CHAR ch, BOOLEAN hex) static void OPS_Number (void) { - int16 i, m, n, d, e; + INT16 i, m, n, d, e; CHAR dig[24]; LONGREAL f; CHAR expCh; @@ -173,7 +173,7 @@ static void OPS_Number (void) OPS_numtyp = 1; if (n <= 2) { while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -187,7 +187,7 @@ static void OPS_Number (void) OPS_intval = -1; } while (i < n) { - OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1); + OPS_intval = __ASHL(OPS_intval, 4) + (INT64)Ord__7(dig[i], 1); i += 1; } } else { @@ -198,8 +198,8 @@ static void OPS_Number (void) while (i < n) { d = Ord__7(dig[i], 0); i += 1; - if (OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) { - OPS_intval = OPS_intval * 10 + (int64)d; + if (OPS_intval <= __DIV(9223372036854775807 - (INT64)d, 10)) { + OPS_intval = OPS_intval * 10 + (INT64)d; } else { OPS_err(203); } @@ -308,9 +308,9 @@ static void Comment__2 (void) } } -void OPS_Get (int8 *sym) +void OPS_Get (INT8 *sym) { - int8 s; + INT8 s; struct Get__1 _s; _s.lnk = Get__1_s; Get__1_s = &_s; diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index a452da84..01ffbd17 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h @@ -14,13 +14,13 @@ typedef import OPS_Name OPS_name; import OPS_String OPS_str; -import int16 OPS_numtyp; -import int64 OPS_intval; +import INT16 OPS_numtyp; +import INT64 OPS_intval; import REAL OPS_realval; import LONGREAL OPS_lrlval; -import void OPS_Get (int8 *sym); +import void OPS_Get (INT8 *sym); import void OPS_Init (void); import void *OPS__init(void); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 48352c94..e1405ce9 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPM.h" @@ -18,18 +18,18 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; typedef struct OPT_ExpCtxt { - int32 reffp; - int16 ref; - int8 nofm; - int8 locmno[64]; + INT32 reffp; + INT16 ref; + INT8 nofm; + INT8 locmno[64]; } OPT_ExpCtxt; typedef @@ -40,13 +40,13 @@ typedef typedef struct OPT_ImpCtxt { - int32 nextTag, reffp; - int16 nofr, minr, nofm; + INT32 nextTag, reffp; + INT16 nofr, minr, nofm; BOOLEAN self; OPT_Struct ref[255]; OPT_Object old[255]; - int32 pvfp[255]; - int8 glbmno[64]; + INT32 pvfp[255]; + INT8 glbmno[64]; } OPT_ImpCtxt; typedef @@ -55,7 +55,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -67,22 +67,22 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused, fpdone, idfpdone; - int32 idfp, pbfp, pvfp; + INT32 idfp, pbfp, pvfp; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; @@ -91,80 +91,80 @@ typedef export OPT_Object OPT_topScope; export OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -export int8 OPT_nofGmod; +export INT8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; -static int32 OPT_nofhdfld; +static INT32 OPT_nofhdfld; static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew; -static int32 OPT_recno; +static INT32 OPT_recno; -export address *OPT_ConstDesc__typ; -export address *OPT_ObjDesc__typ; -export address *OPT_StrDesc__typ; -export address *OPT_NodeDesc__typ; -export address *OPT_ImpCtxt__typ; -export address *OPT_ExpCtxt__typ; +export ADDRESS *OPT_ConstDesc__typ; +export ADDRESS *OPT_ObjDesc__typ; +export ADDRESS *OPT_StrDesc__typ; +export ADDRESS *OPT_NodeDesc__typ; +export ADDRESS *OPT_ImpCtxt__typ; +export ADDRESS *OPT_ExpCtxt__typ; -export void OPT_Align (int32 *adr, int32 base); -export int32 OPT_BaseAlignment (OPT_Struct typ); +export void OPT_Align (INT32 *adr, INT32 base); +export INT32 OPT_BaseAlignment (OPT_Struct typ); export void OPT_Close (void); export void OPT_CloseScope (void); static void OPT_DebugStruct (OPT_Struct btyp); -static void OPT_EnterBoolConst (OPS_Name name, int32 value); -static void OPT_EnterProc (OPS_Name name, int16 num); -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterBoolConst (OPS_Name name, INT32 value); +static void OPT_EnterProc (OPS_Name name, INT16 num); +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res); static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -export void OPT_FPrintErr (OPT_Object obj, int16 errcode); -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); +export void OPT_FPrintErr (OPT_Object obj, INT16 errcode); +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len); export void OPT_FPrintObj (OPT_Object obj); -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par); +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par); export void OPT_FPrintStr (OPT_Struct typ); export void OPT_Find (OPT_Object *res); export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); export void OPT_FindImport (OPT_Object mod, OPT_Object *res); export void OPT_IdFPrint (OPT_Struct typ); export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -static void OPT_InConstant (int32 f, OPT_Const conval); +static void OPT_InConstant (INT32 f, OPT_Const conval); static OPT_Object OPT_InFld (void); -static void OPT_InMod (int8 *mno); +static void OPT_InMod (INT8 *mno); static void OPT_InName (CHAR *name, LONGINT name__len); -static OPT_Object OPT_InObj (int8 mno); -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par); +static OPT_Object OPT_InObj (INT8 mno); +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par); static void OPT_InStruct (OPT_Struct *typ); -static OPT_Object OPT_InTProc (int8 mno); -static OPT_Struct OPT_InTyp (int32 tag); -export void OPT_Init (OPS_Name name, uint32 opt); +static OPT_Object OPT_InTProc (INT8 mno); +static OPT_Struct OPT_InTyp (INT32 tag); +export void OPT_Init (OPS_Name name, UINT32 opt); export void OPT_InitRecno (void); -static void OPT_InitStruct (OPT_Struct *typ, int8 form); +static void OPT_InitStruct (OPT_Struct *typ, INT8 form); export void OPT_Insert (OPS_Name name, OPT_Object *obj); export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -export int16 OPT_IntSize (int64 n); -export OPT_Struct OPT_IntType (int32 size); +export INT16 OPT_IntSize (INT64 n); +export OPT_Struct OPT_IntType (INT32 size); export OPT_Const OPT_NewConst (void); export OPT_ConstExt OPT_NewExt (void); -export OPT_Node OPT_NewNode (int8 class); +export OPT_Node OPT_NewNode (INT8 class); export OPT_Object OPT_NewObj (void); -export OPT_Struct OPT_NewStr (int8 form, int8 comp); -export void OPT_OpenScope (int8 level, OPT_Object owner); +export OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +export void OPT_OpenScope (INT8 level, OPT_Object owner); static void OPT_OutConstant (OPT_Object obj); -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible); -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr); -static void OPT_OutMod (int16 mno); +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr); +static void OPT_OutMod (INT16 mno); static void OPT_OutName (CHAR *name, LONGINT name__len); static void OPT_OutObj (OPT_Object obj); static void OPT_OutSign (OPT_Struct result, OPT_Object par); static void OPT_OutStr (OPT_Struct typ); static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj); -export OPT_Struct OPT_SetType (int32 size); -export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -export int32 OPT_SizeAlignment (int32 size); +export OPT_Struct OPT_SetType (INT32 size); +export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +export INT32 OPT_SizeAlignment (INT32 size); export void OPT_TypSize (OPT_Struct typ); -static void OPT_err (int16 n); +static void OPT_err (INT16 n); void OPT_InitRecno (void) @@ -172,14 +172,14 @@ void OPT_InitRecno (void) OPT_recno = 0; } -static void OPT_err (int16 n) +static void OPT_err (INT16 n) { OPM_err(n); } -int16 OPT_IntSize (int64 n) +INT16 OPT_IntSize (INT64 n) { - int16 bytes; + INT16 bytes; if (n < 0) { n = -(n + 1); } @@ -190,7 +190,7 @@ int16 OPT_IntSize (int64 n) return bytes; } -OPT_Struct OPT_IntType (int32 size) +OPT_Struct OPT_IntType (INT32 size) { if (size <= OPT_int8typ->size) { return OPT_int8typ; @@ -204,7 +204,7 @@ OPT_Struct OPT_IntType (int32 size) return OPT_int64typ; } -OPT_Struct OPT_SetType (int32 size) +OPT_Struct OPT_SetType (INT32 size) { if (size == OPT_set32typ->size) { return OPT_set32typ; @@ -212,9 +212,9 @@ OPT_Struct OPT_SetType (int32 size) return OPT_set64typ; } -OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) +OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir) { - int16 i; + INT16 i; __ASSERT(x->form == 4, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); __ASSERT(dir == 1 || dir == -1, 0); @@ -244,7 +244,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) __RETCHK; } -void OPT_Align (int32 *adr, int32 base) +void OPT_Align (INT32 *adr, INT32 base) { switch (base) { case 2: @@ -264,9 +264,9 @@ void OPT_Align (int32 *adr, int32 base) } } -int32 OPT_SizeAlignment (int32 size) +INT32 OPT_SizeAlignment (INT32 size) { - int32 alignment; + INT32 alignment; if (size < OPM_Alignment) { alignment = 1; while (alignment < size) { @@ -278,9 +278,9 @@ int32 OPT_SizeAlignment (int32 size) return alignment; } -int32 OPT_BaseAlignment (OPT_Struct typ) +INT32 OPT_BaseAlignment (OPT_Struct typ) { - int32 alignment; + INT32 alignment; if (typ->form == 13) { if (typ->comp == 4) { alignment = __MASK(typ->align, -65536); @@ -295,8 +295,8 @@ int32 OPT_BaseAlignment (OPT_Struct typ) void OPT_TypSize (OPT_Struct typ) { - int16 f, c; - int32 offset, size, base, fbase, off0; + INT16 f, c; + INT32 offset, size, base, fbase, off0; OPT_Object fld = NIL; OPT_Struct btyp = NIL; if (typ == OPT_undftyp) { @@ -339,7 +339,7 @@ void OPT_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + (int16)__ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPT_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -378,7 +378,7 @@ OPT_Object OPT_NewObj (void) return obj; } -OPT_Struct OPT_NewStr (int8 form, int8 comp) +OPT_Struct OPT_NewStr (INT8 form, INT8 comp) { OPT_Struct typ = NIL; __NEW(typ, OPT_StrDesc); @@ -393,7 +393,7 @@ OPT_Struct OPT_NewStr (int8 form, int8 comp) return typ; } -OPT_Node OPT_NewNode (int8 class) +OPT_Node OPT_NewNode (INT8 class) { OPT_Node node = NIL; __NEW(node, OPT_NodeDesc); @@ -404,11 +404,11 @@ OPT_Node OPT_NewNode (int8 class) OPT_ConstExt OPT_NewExt (void) { OPT_ConstExt ext = NIL; - ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256))); + ext = __NEWARR(NIL, 1, 1, 1, 0, ((INT64)(256))); return ext; } -void OPT_OpenScope (int8 level, OPT_Object owner) +void OPT_OpenScope (INT8 level, OPT_Object owner) { OPT_Object head = NIL; head = OPT_NewObj(); @@ -429,7 +429,7 @@ void OPT_CloseScope (void) OPT_topScope = OPT_topScope->left; } -void OPT_Init (OPS_Name name, uint32 opt) +void OPT_Init (OPS_Name name, UINT32 opt) { OPT_topScope = OPT_universe; OPT_OpenScope(0, NIL); @@ -446,7 +446,7 @@ void OPT_Init (OPS_Name name, uint32 opt) void OPT_Close (void) { - int16 i; + INT16 i; OPT_CloseScope(); i = 0; while (i < 64) { @@ -538,7 +538,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) { OPT_Object ob0 = NIL, ob1 = NIL; BOOLEAN left; - int8 mnolev; + INT8 mnolev; ob0 = OPT_topScope; ob1 = ob0->right; left = 0; @@ -576,14 +576,14 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj) *obj = ob1; } -static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len) +static void OPT_FPrintName (INT32 *fp, CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, (int16)ch); + OPM_FPrint(&*fp, (INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -621,7 +621,7 @@ static void OPT_DebugStruct (OPT_Struct btyp) OPM_LogWLn(); } -static void OPT_FPrintSign (int32 *fp, OPT_Struct result, OPT_Object par) +static void OPT_FPrintSign (INT32 *fp, OPT_Struct result, OPT_Object par) { OPT_IdFPrint(result); OPM_FPrint(&*fp, result->idfp); @@ -637,8 +637,8 @@ void OPT_IdFPrint (OPT_Struct typ) { OPT_Struct btyp = NIL; OPT_Object strobj = NIL; - int32 idfp; - int16 f, c; + INT32 idfp; + INT16 f, c; if (!typ->idfpdone) { typ->idfpdone = 1; idfp = 0; @@ -667,17 +667,17 @@ void OPT_IdFPrint (OPT_Struct typ) } static struct FPrintStr__15 { - int32 *pbfp, *pvfp; + INT32 *pbfp, *pvfp; struct FPrintStr__15 *lnk; } *FPrintStr__15_s; -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible); +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr); static void FPrintTProcs__20 (OPT_Object obj); -static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { FPrintFlds__16(typ->link, adr, 0); @@ -707,7 +707,7 @@ static void FPrintHdFld__18 (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void FPrintFlds__16 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__16 (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -742,10 +742,10 @@ static void FPrintTProcs__20 (OPT_Object obj) void OPT_FPrintStr (OPT_Struct typ) { - int16 f, c; + INT16 f, c; OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; - int32 pbfp, pvfp; + INT32 pbfp, pvfp; struct FPrintStr__15 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; @@ -806,8 +806,8 @@ void OPT_FPrintStr (OPT_Struct typ) void OPT_FPrintObj (OPT_Object obj) { - int32 fprint; - int16 f, m; + INT32 fprint; + INT16 f, m; REAL rval; OPT_ConstExt ext = NIL; if (!obj->fpdone) { @@ -849,11 +849,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (int16)(*ext)[0]; + m = (INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (int16)(*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -864,9 +864,9 @@ void OPT_FPrintObj (OPT_Object obj) } } -void OPT_FPrintErr (OPT_Object obj, int16 errcode) +void OPT_FPrintErr (OPT_Object obj, INT16 errcode) { - int16 i, j; + INT16 i, j; CHAR ch; if (obj->mnolev != 0) { __COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64); @@ -956,7 +956,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old) static void OPT_InName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -966,12 +966,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_InMod (int8 *mno) +static void OPT_InMod (INT8 *mno) { OPT_Object head = NIL; OPS_Name name; - int32 mn; - int8 i; + INT32 mn; + INT8 i; mn = OPM_SymRInt(); if (mn == 0) { *mno = OPT_impCtxt.glbmno[0]; @@ -1008,16 +1008,16 @@ static void OPT_InMod (int8 *mno) } } -static void OPT_InConstant (int32 f, OPT_Const conval) +static void OPT_InConstant (INT32 f, OPT_Const conval) { CHAR ch; - int16 i; + INT16 i; OPT_ConstExt ext = NIL; REAL rval; switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = (int16)ch; + conval->intval = (INT16)ch; break; case 4: conval->intval = OPM_SymRInt(); @@ -1057,10 +1057,10 @@ static void OPT_InConstant (int32 f, OPT_Const conval) } } -static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) +static void OPT_InSign (INT8 mno, OPT_Struct *res, OPT_Object *par) { OPT_Object last = NIL, new = NIL; - int32 tag; + INT32 tag; OPT_InStruct(&*res); tag = OPM_SymRInt(); last = NIL; @@ -1087,7 +1087,7 @@ static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par) static OPT_Object OPT_InFld (void) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1115,9 +1115,9 @@ static OPT_Object OPT_InFld (void) return obj; } -static OPT_Object OPT_InTProc (int8 mno) +static OPT_Object OPT_InTProc (INT8 mno) { - int32 tag; + INT32 tag; OPT_Object obj = NIL; tag = OPT_impCtxt.nextTag; obj = OPT_NewObj(); @@ -1141,7 +1141,7 @@ static OPT_Object OPT_InTProc (int8 mno) return obj; } -static OPT_Struct OPT_InTyp (int32 tag) +static OPT_Struct OPT_InTyp (INT32 tag) { if (tag == 4) { return OPT_IntType(OPM_SymRInt()); @@ -1155,9 +1155,9 @@ static OPT_Struct OPT_InTyp (int32 tag) static void OPT_InStruct (OPT_Struct *typ) { - int8 mno; - int16 ref; - int32 tag; + INT8 mno; + INT16 ref; + INT32 tag; OPS_Name name; OPT_Struct t = NIL; OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL; @@ -1213,7 +1213,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = (int16)OPM_SymRInt(); + (*typ)->sysflag = (INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1335,13 +1335,13 @@ static void OPT_InStruct (OPT_Struct *typ) } } -static OPT_Object OPT_InObj (int8 mno) +static OPT_Object OPT_InObj (INT8 mno) { - int16 i, s; + INT16 i, s; CHAR ch; OPT_Object obj = NIL, old = NIL; OPT_Struct typ = NIL; - int32 tag; + INT32 tag; OPT_ConstExt ext = NIL; tag = OPT_impCtxt.nextTag; if (tag == 19) { @@ -1374,7 +1374,7 @@ static OPT_Object OPT_InObj (int8 mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = (int16)OPM_SymRInt(); + s = (INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static OPT_Object OPT_InObj (int8 mno) void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) { OPT_Object obj = NIL; - int8 mno; + INT8 mno; OPS_Name aliasName__copy; __DUPARR(aliasName, OPS_Name); if (__STRCMP(name, "SYSTEM") == 0) { @@ -1482,7 +1482,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done) static void OPT_OutName (CHAR *name, LONGINT name__len) { - int16 i; + INT16 i; CHAR ch; i = 0; do { @@ -1492,7 +1492,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len) } while (!(ch == 0x00)); } -static void OPT_OutMod (int16 mno) +static void OPT_OutMod (INT16 mno) { if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) { OPM_SymWInt(16); @@ -1504,9 +1504,9 @@ static void OPT_OutMod (int16 mno) } } -static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) +static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, INT32 adr) { - int32 i, j, n; + INT32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { OPT_OutFlds(typ->link, adr, 0); @@ -1536,7 +1536,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int32 adr) } } -static void OPT_OutFlds (OPT_Object fld, int32 adr, BOOLEAN visible) +static void OPT_OutFlds (OPT_Object fld, INT32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { @@ -1691,7 +1691,7 @@ static void OPT_OutStr (OPT_Struct typ) static void OPT_OutConstant (OPT_Object obj) { - int16 f; + INT16 f; REAL rval; f = obj->typ->form; OPM_SymWInt(f); @@ -1727,7 +1727,7 @@ static void OPT_OutConstant (OPT_Object obj) static void OPT_OutObj (OPT_Object obj) { - int16 i, j; + INT16 i, j; OPT_ConstExt ext = NIL; if (obj != NIL) { OPT_OutObj(obj->left); @@ -1794,7 +1794,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (int16)(*ext)[0]; + j = (INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1817,8 +1817,8 @@ static void OPT_OutObj (OPT_Object obj) void OPT_Export (BOOLEAN *ext, BOOLEAN *new) { - int16 i; - int8 nofmod; + INT16 i; + INT8 nofmod; BOOLEAN done; OPT_symExtended = 0; OPT_symNew = 0; @@ -1857,7 +1857,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new) } } -static void OPT_InitStruct (OPT_Struct *typ, int8 form) +static void OPT_InitStruct (OPT_Struct *typ, INT8 form) { *typ = OPT_NewStr(form, 1); (*typ)->ref = form; @@ -1871,7 +1871,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form) (*typ)->idfpdone = 1; } -static void OPT_EnterBoolConst (OPS_Name name, int32 value) +static void OPT_EnterBoolConst (OPS_Name name, INT32 value) { OPT_Object obj = NIL; OPS_Name name__copy; @@ -1883,7 +1883,7 @@ static void OPT_EnterBoolConst (OPS_Name name, int32 value) obj->conval->intval = value; } -static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) +static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) { OPT_Object obj = NIL; OPT_Struct typ = NIL; @@ -1918,7 +1918,7 @@ static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) *res = obj; } -static void OPT_EnterProc (OPS_Name name, int16 num) +static void OPT_EnterProc (OPS_Name name, INT16 num) { OPT_Object obj = NIL; OPS_Name name__copy; diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 38cd17c7..66f25d3d 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -15,9 +15,9 @@ typedef typedef struct OPT_ConstDesc { OPT_ConstExt ext; - int64 intval; - int32 intval2; - uint64 setval; + INT64 intval; + INT32 intval2; + UINT64 setval; LONGREAL realval; } OPT_ConstDesc; @@ -33,7 +33,7 @@ typedef typedef struct OPT_NodeDesc { OPT_Node left, right, link; - int8 class, subcl; + INT8 class, subcl; BOOLEAN readonly; OPT_Struct typ; OPT_Object obj; @@ -45,20 +45,20 @@ typedef OPT_Object left, right, link, scope; OPS_Name name; BOOLEAN leaf; - int8 mode, mnolev, vis, history; + INT8 mode, mnolev, vis, history; BOOLEAN used, fpdone; - int32 fprint; + INT32 fprint; OPT_Struct typ; OPT_Const conval; - int32 adr, linkadr; - int16 x; + INT32 adr, linkadr; + INT16 x; } OPT_ObjDesc; typedef struct OPT_StrDesc { - int8 form, comp, mno, extlev; - int16 ref, sysflag; - int32 n, size, align, txtpos; + INT8 form, comp, mno, extlev; + INT16 ref, sysflag; + INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; char _prvt0[16]; OPT_Struct BaseTyp; @@ -69,22 +69,22 @@ typedef import OPT_Object OPT_topScope; import OPT_Struct OPT_undftyp, OPT_niltyp, OPT_notyp, OPT_bytetyp, OPT_cpbytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_settyp, OPT_set32typ, OPT_set64typ, OPT_realtyp, OPT_lrltyp, OPT_stringtyp, OPT_adrtyp, OPT_sysptrtyp; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj, OPT_setobj; -import int8 OPT_nofGmod; +import INT8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; import BOOLEAN OPT_SYSimported; -import address *OPT_ConstDesc__typ; -import address *OPT_ObjDesc__typ; -import address *OPT_StrDesc__typ; -import address *OPT_NodeDesc__typ; +import ADDRESS *OPT_ConstDesc__typ; +import ADDRESS *OPT_ObjDesc__typ; +import ADDRESS *OPT_StrDesc__typ; +import ADDRESS *OPT_NodeDesc__typ; -import void OPT_Align (int32 *adr, int32 base); -import int32 OPT_BaseAlignment (OPT_Struct typ); +import void OPT_Align (INT32 *adr, INT32 base); +import INT32 OPT_BaseAlignment (OPT_Struct typ); import void OPT_Close (void); import void OPT_CloseScope (void); import void OPT_Export (BOOLEAN *ext, BOOLEAN *new); -import void OPT_FPrintErr (OPT_Object obj, int16 errcode); +import void OPT_FPrintErr (OPT_Object obj, INT16 errcode); import void OPT_FPrintObj (OPT_Object obj); import void OPT_FPrintStr (OPT_Struct typ); import void OPT_Find (OPT_Object *res); @@ -92,21 +92,21 @@ import void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res); import void OPT_FindImport (OPT_Object mod, OPT_Object *res); import void OPT_IdFPrint (OPT_Struct typ); import void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done); -import void OPT_Init (OPS_Name name, uint32 opt); +import void OPT_Init (OPS_Name name, UINT32 opt); import void OPT_InitRecno (void); import void OPT_Insert (OPS_Name name, OPT_Object *obj); import void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old); -import int16 OPT_IntSize (int64 n); -import OPT_Struct OPT_IntType (int32 size); +import INT16 OPT_IntSize (INT64 n); +import OPT_Struct OPT_IntType (INT32 size); import OPT_Const OPT_NewConst (void); import OPT_ConstExt OPT_NewExt (void); -import OPT_Node OPT_NewNode (int8 class); +import OPT_Node OPT_NewNode (INT8 class); import OPT_Object OPT_NewObj (void); -import OPT_Struct OPT_NewStr (int8 form, int8 comp); -import void OPT_OpenScope (int8 level, OPT_Object owner); -import OPT_Struct OPT_SetType (int32 size); -import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir); -import int32 OPT_SizeAlignment (int32 size); +import OPT_Struct OPT_NewStr (INT8 form, INT8 comp); +import void OPT_OpenScope (INT8 level, OPT_Object owner); +import OPT_Struct OPT_SetType (INT32 size); +import OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INT16 dir); +import INT32 OPT_SizeAlignment (INT32 size); import void OPT_TypSize (OPT_Struct typ); import void *OPT__init(void); diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 452a1182..ee84e643 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "OPC.h" @@ -13,42 +13,42 @@ typedef struct OPV_ExitInfo { - int16 level, label; + INT16 level, label; } OPV_ExitInfo; -static int16 OPV_stamp; +static INT16 OPV_stamp; static OPV_ExitInfo OPV_exit; -static int16 OPV_nofExitLabels; +static INT16 OPV_nofExitLabels; -export address *OPV_ExitInfo__typ; +export ADDRESS *OPV_ExitInfo__typ; static void OPV_ActualPar (OPT_Node n, OPT_Object fp); export void OPV_AdrAndSize (OPT_Object topScope); static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc); -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec); +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec); static void OPV_DefineTDescs (OPT_Node n); -static void OPV_Entier (OPT_Node n, int16 prec); +static void OPV_Entier (OPT_Node n, INT16 prec); static void OPV_GetTProcNum (OPT_Object obj); static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc); static BOOLEAN OPV_ImplicitReturn (OPT_Node n); -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim); +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim); export void OPV_Init (void); static void OPV_InitTDescs (OPT_Node n); -static void OPV_Len (OPT_Node n, int64 dim); +static void OPV_Len (OPT_Node n, INT64 dim); export void OPV_Module (OPT_Node prog); static void OPV_NewArr (OPT_Node d, OPT_Node x); -static void OPV_ParIntLiteral (int64 n, int32 size); -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp); +static void OPV_ParIntLiteral (INT64 n, INT32 size); +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp); static BOOLEAN OPV_SideEffects (OPT_Node n); -static void OPV_SizeCast (OPT_Node n, int32 to); +static void OPV_SizeCast (OPT_Node n, INT32 to); static void OPV_Stamp (OPS_Name s); static OPT_Object OPV_SuperProc (OPT_Node n); static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported); static void OPV_TraverseRecord (OPT_Struct typ); static void OPV_TypeOf (OPT_Node n); -static void OPV_design (OPT_Node n, int16 prec); -static void OPV_expr (OPT_Node n, int16 prec); +static void OPV_design (OPT_Node n, INT16 prec); +static void OPV_expr (OPT_Node n, INT16 prec); static void OPV_stat (OPT_Node n, OPT_Object outerProc); @@ -60,7 +60,7 @@ void OPV_Init (void) static void OPV_GetTProcNum (OPT_Object obj) { - int32 oldPos; + INT32 oldPos; OPT_Struct typ = NIL; OPT_Object redef = NIL; oldPos = OPM_errpos; @@ -96,7 +96,7 @@ static void OPV_TraverseRecord (OPT_Struct typ) static void OPV_Stamp (OPS_Name s) { - int16 i, j, k; + INT16 i, j, k; CHAR n[10]; OPV_stamp += 1; i = 0; @@ -126,7 +126,7 @@ static void OPV_Stamp (OPS_Name s) static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exported) { - int16 mode; + INT16 mode; OPT_Object scope = NIL; OPT_Struct typ = NIL; if (obj != NIL) { @@ -205,7 +205,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_sysptrtyp->strobj->linkadr = 2; } -static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp) +static INT16 OPV_Precedence (INT16 class, INT16 subclass, INT16 form, INT16 comp) { switch (class) { case 7: case 0: case 2: case 4: case 9: @@ -315,7 +315,7 @@ static int16 OPV_Precedence (int16 class, int16 subclass, int16 form, int16 comp __RETCHK; } -static void OPV_Len (OPT_Node n, int64 dim) +static void OPV_Len (OPT_Node n, INT64 dim) { while ((n->class == 4 && n->typ->comp == 3)) { dim += 1; @@ -341,7 +341,7 @@ static BOOLEAN OPV_SideEffects (OPT_Node n) __RETCHK; } -static void OPV_Entier (OPT_Node n, int16 prec) +static void OPV_Entier (OPT_Node n, INT16 prec) { if (__IN(n->typ->form, 0x60, 32)) { OPM_WriteString((CHAR*)"__ENTIER(", 10); @@ -352,7 +352,7 @@ static void OPV_Entier (OPT_Node n, int16 prec) } } -static void OPV_SizeCast (OPT_Node n, int32 to) +static void OPV_SizeCast (OPT_Node n, INT32 to) { if ((to < n->typ->size && __IN(2, OPM_Options, 32))) { OPM_WriteString((CHAR*)"__SHORT", 8); @@ -366,16 +366,16 @@ static void OPV_SizeCast (OPT_Node n, int32 to) OPM_Write(')'); } else { if ((n->typ->size != to && (n->typ->size > 4 || to != 4))) { - OPM_WriteString((CHAR*)"(int", 5); + OPM_WriteString((CHAR*)"(INT", 5); OPM_WriteInt(__ASHL(to, 3)); OPM_WriteString((CHAR*)")", 2); } } } -static void OPV_Convert (OPT_Node n, OPT_Struct newtype, int16 prec) +static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INT16 prec) { - int16 from, to; + INT16 from, to; from = n->typ->form; to = newtype->form; if (to == 7) { @@ -432,7 +432,7 @@ static void OPV_TypeOf (OPT_Node n) } } -static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) +static void OPV_Index (OPT_Node n, OPT_Node d, INT16 prec, INT16 dim) { if (!__IN(0, OPM_Options, 32) || (n->right->class == 7 && (n->right->conval->intval == 0 || n->left->typ->comp != 3))) { OPV_expr(n->right, prec); @@ -449,18 +449,18 @@ static void OPV_Index (OPT_Node n, OPT_Node d, int16 prec, int16 dim) } } -static void OPV_design (OPT_Node n, int16 prec) +static void OPV_design (OPT_Node n, INT16 prec) { OPT_Object obj = NIL; OPT_Struct typ = NIL; - int16 class, designPrec, comp; + INT16 class, designPrec, comp; OPT_Node d = NIL, x = NIL; - int16 dims, i, _for__26; + INT16 dims, i, _for__26; comp = n->typ->comp; obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && (int16)obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -559,7 +559,7 @@ static void OPV_design (OPT_Node n, int16 prec) if (__IN(3, OPM_Options, 32)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if ((int16)obj->mnolev != OPM_level) { + if ((INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -628,7 +628,7 @@ static void OPV_design (OPT_Node n, int16 prec) } } -static void OPV_ParIntLiteral (int64 n, int32 size) +static void OPV_ParIntLiteral (INT64 n, INT32 size) { OPM_WriteInt(n); } @@ -636,7 +636,7 @@ static void OPV_ParIntLiteral (int64 n, int32 size) static void OPV_ActualPar (OPT_Node n, OPT_Object fp) { OPT_Struct typ = NIL, aptyp = NIL; - int16 comp, form, mode, prec, dim; + INT16 comp, form, mode, prec, dim; OPM_Write('('); while (n != NIL) { typ = fp->typ; @@ -726,9 +726,9 @@ static OPT_Object OPV_SuperProc (OPT_Node n) return obj; } -static void OPV_expr (OPT_Node n, int16 prec) +static void OPV_expr (OPT_Node n, INT16 prec) { - int16 class, subclass, form, exprPrec; + INT16 class, subclass, form, exprPrec; OPT_Struct typ = NIL; OPT_Node l = NIL, r = NIL; OPT_Object proc = NIL; @@ -1050,7 +1050,7 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) OPT_Node if_ = NIL; OPT_Object obj = NIL; OPT_Struct typ = NIL; - int32 adr; + INT32 adr; if_ = n->left; while (if_ != NIL) { OPM_WriteString((CHAR*)"if ", 4); @@ -1100,8 +1100,8 @@ static void OPV_IfStat (OPT_Node n, BOOLEAN withtrap, OPT_Object outerProc) static void OPV_CaseStat (OPT_Node n, OPT_Object outerProc) { OPT_Node switchCase = NIL, label = NIL; - int64 low, high; - int16 form, i; + INT64 low, high; + INT16 form, i; OPM_WriteString((CHAR*)"switch ", 8); OPV_expr(n->left, 12); OPM_Write(' '); @@ -1166,7 +1166,7 @@ static BOOLEAN OPV_ImplicitReturn (OPT_Node n) static void OPV_NewArr (OPT_Node d, OPT_Node x) { OPT_Struct typ = NIL, base = NIL; - int16 nofdim, nofdyn; + INT16 nofdim, nofdyn; typ = d->typ->BaseTyp; base = typ; nofdim = 0; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 2fa9186d..513d8dfa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6098e568..03213c6a 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,37 +1,37 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Platform.h" static CHAR Out_buf[128]; -static int16 Out_in; +static INT16 Out_in; export void Out_Char (CHAR ch); export void Out_Flush (void); -export void Out_Int (int64 x, int64 n); -static int32 Out_Length (CHAR *s, LONGINT s__len); +export void Out_Int (INT64 x, INT64 n); +static INT32 Out_Length (CHAR *s, LONGINT s__len); export void Out_Ln (void); -export void Out_LongReal (LONGREAL x, int16 n); +export void Out_LongReal (LONGREAL x, INT16 n); export void Out_Open (void); -export void Out_Real (REAL x, int16 n); -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_); +export void Out_Real (REAL x, INT16 n); +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_); export void Out_String (CHAR *str, LONGINT str__len); -export LONGREAL Out_Ten (int16 e); -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i); -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i); +export LONGREAL Out_Ten (INT16 e); +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); #define Out_Entier64(x) (int64)(x) void Out_Flush (void) { - int16 error; + INT16 error; if (Out_in > 0) { error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); } @@ -54,9 +54,9 @@ void Out_Char (CHAR ch) } } -static int32 Out_Length (CHAR *s, LONGINT s__len) +static INT32 Out_Length (CHAR *s, LONGINT s__len) { - int32 l; + INT32 l; l = 0; while ((l < s__len && s[__X(l, s__len)] != 0x00)) { l += 1; @@ -66,8 +66,8 @@ static int32 Out_Length (CHAR *s, LONGINT s__len) void Out_String (CHAR *str, LONGINT str__len) { - int32 l; - int16 error; + INT32 l; + INT16 error; __DUP(str, str__len, CHAR); l = Out_Length((void*)str, str__len); if (Out_in + l > 128) { @@ -77,15 +77,15 @@ void Out_String (CHAR *str, LONGINT str__len) error = Platform_Write(Platform_StdOut, (address)str, l); } else { __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); - Out_in += (int16)l; + Out_in += (INT16)l; } __DEL(str); } -void Out_Int (int64 x, int64 n) +void Out_Int (INT64 x, INT64 n) { CHAR s[22]; - int16 i; + INT16 i; BOOLEAN negative; negative = x < 0; if (x == (-9223372036854775807-1)) { @@ -108,7 +108,7 @@ void Out_Int (int64 x, int64 n) s[__X(i, 22)] = '-'; i += 1; } - while (n > (int64)i) { + while (n > (INT64)i) { Out_Char(' '); n -= 1; } @@ -124,22 +124,22 @@ void Out_Ln (void) Out_Flush(); } -static void Out_digit (int64 n, CHAR *s, LONGINT s__len, int16 *i) +static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i) { *i -= 1; s[__X(*i, s__len)] = (CHAR)(__MOD(n, 10) + 48); } -static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 *i) +static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i) { - int16 j; - int32 l; + INT16 j; + INT32 l; __DUP(t, t__len, CHAR); l = Out_Length((void*)t, t__len); if (l > *i) { l = *i; } - *i -= (int16)l; + *i -= (INT16)l; j = 0; while (j < l) { s[__X(*i + j, s__len)] = t[__X(j, t__len)]; @@ -148,7 +148,7 @@ static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, int16 __DEL(t); } -LONGREAL Out_Ten (int16 e) +LONGREAL Out_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -163,19 +163,19 @@ LONGREAL Out_Ten (int16 e) return r; } -static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) +static void Out_RealP (LONGREAL x, INT16 n, BOOLEAN long_) { - int16 e; - int64 f; + INT16 e; + INT64 f; CHAR s[30]; - int16 i, el; + INT16 i, el; LONGREAL x0; BOOLEAN nn, en; - int64 m; - int16 d, dr; - e = (int16)__MASK(__ASHR((__VAL(int64, x)), 52), -2048); - f = __MASK((__VAL(int64, x)), -4503599627370496); - nn = (__VAL(int64, x) < 0 && !((e == 2047 && f != 0))); + INT64 m; + INT16 d, dr; + e = (INT16)__MASK(__ASHR((__VAL(INT64, x)), 52), -2048); + f = __MASK((__VAL(INT64, x)), -4503599627370496); + nn = (__VAL(INT64, x) < 0 && !((e == 2047 && f != 0))); if (nn) { n -= 1; } @@ -221,7 +221,7 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) if (nn) { x = -x; } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Out_Ten(e); } else { @@ -291,12 +291,12 @@ static void Out_RealP (LONGREAL x, int16 n, BOOLEAN long_) } } -void Out_Real (REAL x, int16 n) +void Out_Real (REAL x, INT16 n) { Out_RealP(x, n, 0); } -void Out_LongReal (LONGREAL x, int16 n) +void Out_LongReal (LONGREAL x, INT16 n) { Out_RealP(x, n, 1); } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fbaed75f..a685b291 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h @@ -10,13 +10,13 @@ import void Out_Char (CHAR ch); import void Out_Flush (void); -import void Out_Int (int64 x, int64 n); +import void Out_Int (INT64 x, INT64 n); import void Out_Ln (void); -import void Out_LongReal (LONGREAL x, int16 n); +import void Out_LongReal (LONGREAL x, INT16 n); import void Out_Open (void); -import void Out_Real (REAL x, int16 n); +import void Out_Real (REAL x, INT16 n); import void Out_String (CHAR *str, LONGINT str__len); -import LONGREAL Out_Ten (int16 e); +import LONGREAL Out_Ten (INT16 e); import void *Out__init(void); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 9eee96c2..c154f33b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -14,92 +14,92 @@ typedef Platform_ArgPtr (*Platform_ArgVec)[1024]; typedef - int64 (*Platform_ArgVecPtr)[1]; + INT64 (*Platform_ArgVecPtr)[1]; typedef CHAR (*Platform_EnvPtr)[1024]; typedef struct Platform_FileIdentity { - int32 volume, indexhigh, indexlow, mtimehigh, mtimelow; + INT32 volume, indexhigh, indexlow, mtimehigh, mtimelow; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame; -export int32 Platform_HaltCode; -export int16 Platform_PID; +export INT64 Platform_MainStackFrame; +export INT32 Platform_HaltCode; +export INT16 Platform_PID; export CHAR Platform_CWD[4096]; -export int16 Platform_ArgCount; -export int64 Platform_ArgVector; +export INT16 Platform_ArgCount; +export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; -static int32 Platform_TimeStart; -export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +static INT32 Platform_TimeStart; +export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; -export address *Platform_FileIdentity__typ; +export ADDRESS *Platform_FileIdentity__typ; -export BOOLEAN Platform_Absent (int16 e); -export int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (int32 code); -export int16 Platform_Chdir (CHAR *n, LONGINT n__len); -export int16 Platform_Close (int32 h); -export BOOLEAN Platform_ConnectionFailed (int16 e); -export void Platform_Delay (int32 ms); -export BOOLEAN Platform_DifferentFilesystems (int16 e); -static void Platform_DisplayHaltCode (int32 code); -export int16 Platform_Error (void); -export void Platform_Exit (int16 code); -export void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -export void Platform_GetClock (int32 *t, int32 *d); +export BOOLEAN Platform_Absent (INT16 e); +export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +export void Platform_AssertFail (INT32 code); +export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +export INT16 Platform_Close (INT32 h); +export BOOLEAN Platform_ConnectionFailed (INT16 e); +export void Platform_Delay (INT32 ms); +export BOOLEAN Platform_DifferentFilesystems (INT16 e); +static void Platform_DisplayHaltCode (INT32 code); +export INT16 Platform_Error (void); +export void Platform_Exit (INT16 code); +export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -export void Platform_GetIntArg (int16 n, int32 *val); -export void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -export void Platform_Halt (int32 code); -export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int32 argc, int64 argvadr); -export BOOLEAN Platform_Interrupted (int16 e); -export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); -export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +export void Platform_GetIntArg (INT16 n, INT32 *val); +export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +export void Platform_Halt (INT32 code); +export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export BOOLEAN Platform_Inaccessible (INT16 e); +export void Platform_Init (INT32 argc, INT64 argvadr); +export BOOLEAN Platform_Interrupted (INT16 e); +export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export BOOLEAN Platform_NoSuchDirectory (INT16 e); +export INT64 Platform_OSAllocate (INT64 size); +export void Platform_OSFree (INT64 address); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export int16 Platform_Seek (int32 h, int32 o, int16 r); +export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); -export void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -export int16 Platform_Size (int32 h, int32 *l); -export int16 Platform_Sync (int32 h); -export int16 Platform_System (CHAR *cmd, LONGINT cmd__len); +export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +export INT16 Platform_Size (INT32 h, INT32 *l); +export INT16 Platform_Sync (INT32 h); +export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); -export int32 Platform_Time (void); -export BOOLEAN Platform_TimedOut (int16 e); -export BOOLEAN Platform_TooManyFiles (int16 e); -export int16 Platform_Truncate (int32 h, int32 limit); -export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int64 p, int32 l); -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d); +export INT32 Platform_Time (void); +export BOOLEAN Platform_TimedOut (INT16 e); +export BOOLEAN Platform_TooManyFiles (INT16 e); +export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); -static void Platform_errint (int32 l); +static void Platform_errint (INT32 l); static void Platform_errln (void); -static void Platform_errposint (int32 l); +static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -118,11 +118,11 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() +#define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) -#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -130,44 +130,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,63 +182,63 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) -BOOLEAN Platform_TooManyFiles (int16 e) +BOOLEAN Platform_TooManyFiles (INT16 e) { return e == Platform_ERRORTOOMANYOPENFILES(); } -BOOLEAN Platform_NoSuchDirectory (int16 e) +BOOLEAN Platform_NoSuchDirectory (INT16 e) { return e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_DifferentFilesystems (int16 e) +BOOLEAN Platform_DifferentFilesystems (INT16 e) { return e == Platform_ERRORNOTSAMEDEVICE(); } -BOOLEAN Platform_Inaccessible (int16 e) +BOOLEAN Platform_Inaccessible (INT16 e) { return ((e == Platform_ERRORACCESSDENIED() || e == Platform_ERRORWRITEPROTECT()) || e == Platform_ERRORNOTREADY()) || e == Platform_ERRORSHARINGVIOLATION(); } -BOOLEAN Platform_Absent (int16 e) +BOOLEAN Platform_Absent (INT16 e) { return e == Platform_ERRORFILENOTFOUND() || e == Platform_ERRORPATHNOTFOUND(); } -BOOLEAN Platform_TimedOut (int16 e) +BOOLEAN Platform_TimedOut (INT16 e) { return e == Platform_ETIMEDOUT(); } -BOOLEAN Platform_ConnectionFailed (int16 e) +BOOLEAN Platform_ConnectionFailed (INT16 e) { return ((e == Platform_ECONNREFUSED() || e == Platform_ECONNABORTED()) || e == Platform_ENETUNREACH()) || e == Platform_EHOSTUNREACH(); } -BOOLEAN Platform_Interrupted (int16 e) +BOOLEAN Platform_Interrupted (INT16 e) { return e == Platform_EINTR(); } -int64 Platform_OSAllocate (int64 size) +INT64 Platform_OSAllocate (INT64 size) { return Platform_allocate(size); } -void Platform_OSFree (int64 address) +void Platform_OSFree (INT64 address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (INT32 argc, INT64 argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; - Platform_ArgCount = __VAL(int16, argc); + Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; @@ -248,7 +248,7 @@ void Platform_Init (int32 argc, int64 argvadr) BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) { CHAR buf[4096]; - int16 res; + INT16 res; __DUP(var, var__len, CHAR); res = Platform_getenv(var, var__len, (void*)buf, 4096); if ((res > 0 && res < 4096)) { @@ -271,7 +271,7 @@ void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len) __DEL(var); } -void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) +void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { @@ -280,10 +280,10 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) } } -void Platform_GetIntArg (int16 n, int32 *val) +void Platform_GetIntArg (INT16 n, INT32 *val) { CHAR s[64]; - int32 k, d, i; + INT32 k, d, i; s[0] = 0x00; Platform_GetArg(n, (void*)s, 64); i = 0; @@ -291,11 +291,11 @@ void Platform_GetIntArg (int16 n, int32 *val) i = 1; } k = 0; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = (int16)s[__X(i, 64)] - 48; + d = (INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; @@ -306,9 +306,9 @@ void Platform_GetIntArg (int16 n, int32 *val) } } -int16 Platform_ArgPos (CHAR *s, LONGINT s__len) +INT16 Platform_ArgPos (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; CHAR arg[256]; __DUP(s, s__len, CHAR); i = 0; @@ -325,26 +325,26 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler) { } -static void Platform_YMDHMStoClock (int16 ye, int16 mo, int16 da, int16 ho, int16 mi, int16 se, int32 *t, int32 *d) +static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d) { *d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL((mo + 1), 5)) + da; *t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se; } -void Platform_GetClock (int32 *t, int32 *d) +void Platform_GetClock (INT32 *t, INT32 *d) { Platform_getLocalTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int32 Platform_Time (void) +INT32 Platform_Time (void) { - int32 ms; + INT32 ms; ms = Platform_GetTickCount(); return (int)__MOD(ms - Platform_TimeStart, 2147483647); } -void Platform_Delay (int32 ms) +void Platform_Delay (INT32 ms) { while (ms > 30000) { Platform_sleep(30000); @@ -355,7 +355,7 @@ void Platform_Delay (int32 ms) } } -void Platform_GetTimeOfDay (int32 *sec, int32 *usec) +void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec) { Platform_getLocalTime(); Platform_stToFt(); @@ -365,9 +365,9 @@ void Platform_GetTimeOfDay (int32 *sec, int32 *usec) *usec = Platform_uluSec(); } -int16 Platform_System (CHAR *cmd, LONGINT cmd__len) +INT16 Platform_System (CHAR *cmd, LONGINT cmd__len) { - int16 result; + INT16 result; __DUP(cmd, cmd__len, CHAR); result = 127; Platform_startupInfo(); @@ -382,14 +382,14 @@ int16 Platform_System (CHAR *cmd, LONGINT cmd__len) return __ASHL(result, 8); } -int16 Platform_Error (void) +INT16 Platform_Error (void) { return Platform_err(); } -int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +400,9 @@ int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +413,9 @@ int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) { - int32 fd; + INT32 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +426,7 @@ int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h) __RETCHK; } -int16 Platform_Close (int32 h) +INT16 Platform_Close (INT32 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +436,7 @@ int16 Platform_Close (int32 h) __RETCHK; } -int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -450,10 +450,10 @@ int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *iden return 0; } -int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ) +INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - int32 h; - int16 e, i; + INT32 h; + INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); if (e != 0) { @@ -476,20 +476,20 @@ BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i return (i1.mtimehigh == i2.mtimehigh && i1.mtimelow == i2.mtimelow); } -void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source) +void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source) { (*target).mtimehigh = source.mtimehigh; (*target).mtimelow = source.mtimelow; } -void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d) +void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) { Platform_identityToFileTime(i); Platform_fileTimeToSysTime(); Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -int16 Platform_Size (int32 h, int32 *l) +INT16 Platform_Size (INT32 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,10 +499,10 @@ int16 Platform_Size (int32 h, int32 *l) return 0; } -int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) +INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, p, l, &lengthread); if (result == 0) { *n = 0; @@ -514,10 +514,10 @@ int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - int16 result; - int32 lengthread; + INT16 result; + INT32 lengthread; result = Platform_readfile(h, (address)b, b__len, &lengthread); if (result == 0) { *n = 0; @@ -529,7 +529,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int64 p, int32 l) +INT16 Platform_Write (INT32 h, INT64 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +539,7 @@ int16 Platform_Write (int32 h, int64 p, int32 l) __RETCHK; } -int16 Platform_Sync (int32 h) +INT16 Platform_Sync (INT32 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,9 +549,9 @@ int16 Platform_Sync (int32 h) __RETCHK; } -int16 Platform_Seek (int32 h, int32 o, int16 r) +INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) { - int16 rc; + INT16 rc; Platform_largeInteger(); Platform_setFilePointerEx(h, o, r, &rc); if (rc == 0) { @@ -562,10 +562,10 @@ int16 Platform_Seek (int32 h, int32 o, int16 r) __RETCHK; } -int16 Platform_Truncate (int32 h, int32 limit) +INT16 Platform_Truncate (INT32 h, INT32 limit) { - int16 rc; - int32 oldpos; + INT16 rc; + INT32 oldpos; Platform_largeInteger(); Platform_getFilePos(h, &oldpos, &rc); if (rc == 0) { @@ -585,7 +585,7 @@ int16 Platform_Truncate (int32 h, int32 limit) return 0; } -int16 Platform_Unlink (CHAR *n, LONGINT n__len) +INT16 Platform_Unlink (CHAR *n, LONGINT n__len) { if (Platform_deleteFile(n, n__len) == 0) { return Platform_err(); @@ -595,9 +595,9 @@ int16 Platform_Unlink (CHAR *n, LONGINT n__len) __RETCHK; } -int16 Platform_Chdir (CHAR *n, LONGINT n__len) +INT16 Platform_Chdir (CHAR *n, LONGINT n__len) { - int16 r; + INT16 r; r = Platform_setCurrentDirectory(n, n__len); if (r == 0) { return Platform_err(); @@ -606,7 +606,7 @@ int16 Platform_Chdir (CHAR *n, LONGINT n__len) return 0; } -int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) +INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) { if (Platform_moveFile(o, o__len, n, n__len) == 0) { return Platform_err(); @@ -616,7 +616,7 @@ int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (int16 code) +void Platform_Exit (INT16 code) { Platform_exit(code); } @@ -632,7 +632,7 @@ static void Platform_errln (void) Platform_errch(0x0a); } -static void Platform_errposint (int32 l) +static void Platform_errposint (INT32 l) { if (l > 10) { Platform_errposint(__DIV(l, 10)); @@ -640,7 +640,7 @@ static void Platform_errposint (int32 l) Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); } -static void Platform_errint (int32 l) +static void Platform_errint (INT32 l) { if (l < 0) { Platform_errch('-'); @@ -649,11 +649,11 @@ static void Platform_errint (int32 l) Platform_errposint(l); } -static void Platform_DisplayHaltCode (int32 code) +static void Platform_DisplayHaltCode (INT32 code) { switch (code) { case -1: - Platform_errstring((CHAR*)"Rider ReadBuf/WriteBuf transfer size longer than buffer.", 57); + Platform_errstring((CHAR*)"Assertion failure.", 19); break; case -2: Platform_errstring((CHAR*)"Index out of range.", 20); @@ -705,7 +705,7 @@ static void Platform_DisplayHaltCode (int32 code) } } -void Platform_Halt (int32 code) +void Platform_Halt (INT32 code) { Platform_HaltCode = code; if (Platform_HaltHandler != NIL) { @@ -718,10 +718,10 @@ void Platform_Halt (int32 code) Platform_DisplayHaltCode(code); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } -void Platform_AssertFail (int32 code) +void Platform_AssertFail (INT32 code) { Platform_errstring((CHAR*)"Assertion failure.", 19); if (code != 0) { @@ -730,7 +730,7 @@ void Platform_AssertFail (int32 code) Platform_errstring((CHAR*)".", 2); } Platform_errln(); - Platform_exit(__VAL(int16, code)); + Platform_exit(__VAL(INT16, code)); } void Platform_SetHalt (Platform_HaltProcedure p) @@ -740,7 +740,7 @@ void Platform_SetHalt (Platform_HaltProcedure p) static void Platform_TestLittleEndian (void) { - int16 i; + INT16 i; i = 1; __GET((address)&i, Platform_LittleEndian, BOOLEAN); } diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 809c60fc..e67b2ca0 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -7,80 +7,80 @@ typedef struct Platform_FileIdentity { - int32 _prvt0; + INT32 _prvt0; char _prvt1[16]; } Platform_FileIdentity; typedef - void (*Platform_HaltProcedure)(int32); + void (*Platform_HaltProcedure)(INT32); typedef - void (*Platform_SignalHandler)(int32); + void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame; -import int32 Platform_HaltCode; -import int16 Platform_PID; +import INT64 Platform_MainStackFrame; +import INT32 Platform_HaltCode; +import INT16 Platform_PID; import CHAR Platform_CWD[4096]; -import int16 Platform_ArgCount; -import int64 Platform_ArgVector; -import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT16 Platform_ArgCount; +import INT64 Platform_ArgVector; +import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; +import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; -import address *Platform_FileIdentity__typ; +import ADDRESS *Platform_FileIdentity__typ; -import BOOLEAN Platform_Absent (int16 e); -import int16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (int32 code); -import int16 Platform_Chdir (CHAR *n, LONGINT n__len); -import int16 Platform_Close (int32 h); -import BOOLEAN Platform_ConnectionFailed (int16 e); -import void Platform_Delay (int32 ms); -import BOOLEAN Platform_DifferentFilesystems (int16 e); -import int16 Platform_Error (void); -import void Platform_Exit (int16 code); -import void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len); -import void Platform_GetClock (int32 *t, int32 *d); +import BOOLEAN Platform_Absent (INT16 e); +import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); +import void Platform_AssertFail (INT32 code); +import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); +import INT16 Platform_Close (INT32 h); +import BOOLEAN Platform_ConnectionFailed (INT16 e); +import void Platform_Delay (INT32 ms); +import BOOLEAN Platform_DifferentFilesystems (INT16 e); +import INT16 Platform_Error (void); +import void Platform_Exit (INT16 code); +import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); +import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); -import void Platform_GetIntArg (int16 n, int32 *val); -import void Platform_GetTimeOfDay (int32 *sec, int32 *usec); -import void Platform_Halt (int32 code); -import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, address *identity__typ); -import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, address *identity__typ); -import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int32 argc, int64 argvadr); -import BOOLEAN Platform_Interrupted (int16 e); -import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); -import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); -import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); -import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int64 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); -import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); +import void Platform_GetIntArg (INT16 n, INT32 *val); +import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); +import void Platform_Halt (INT32 code); +import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import BOOLEAN Platform_Inaccessible (INT16 e); +import void Platform_Init (INT32 argc, INT64 argvadr); +import BOOLEAN Platform_Interrupted (INT16 e); +import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import BOOLEAN Platform_NoSuchDirectory (INT16 e); +import INT64 Platform_OSAllocate (INT64 size); +import void Platform_OSFree (INT64 address); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import int16 Platform_Seek (int32 h, int32 o, int16 r); +import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); -import void Platform_SetMTime (Platform_FileIdentity *target, address *target__typ, Platform_FileIdentity source); -import int16 Platform_Size (int32 h, int32 *l); -import int16 Platform_Sync (int32 h); -import int16 Platform_System (CHAR *cmd, LONGINT cmd__len); -import int32 Platform_Time (void); -import BOOLEAN Platform_TimedOut (int16 e); -import BOOLEAN Platform_TooManyFiles (int16 e); -import int16 Platform_Truncate (int32 h, int32 limit); -import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int64 p, int32 l); +import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); +import INT16 Platform_Size (INT32 h, INT32 *l); +import INT16 Platform_Sync (INT32 h); +import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); +import INT32 Platform_Time (void); +import BOOLEAN Platform_TimedOut (INT16 e); +import BOOLEAN Platform_TooManyFiles (INT16 e); +import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); +import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) #endif // Platform diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0aca5733..d6788751 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -11,19 +11,19 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); -export void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +export void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -export void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -export int16 Reals_Expo (REAL x); -export int16 Reals_ExpoL (LONGREAL x); -export void Reals_SetExpo (REAL *x, int16 ex); -export REAL Reals_Ten (int16 e); -export LONGREAL Reals_TenL (int16 e); -static CHAR Reals_ToHex (int16 i); +export void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +export INT16 Reals_Expo (REAL x); +export INT16 Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INT16 ex); +export REAL Reals_Ten (INT16 e); +export LONGREAL Reals_TenL (INT16 e); +static CHAR Reals_ToHex (INT16 i); -REAL Reals_Ten (int16 e) +REAL Reals_Ten (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -38,7 +38,7 @@ REAL Reals_Ten (int16 e) return r; } -LONGREAL Reals_TenL (int16 e) +LONGREAL Reals_TenL (INT16 e) { LONGREAL r, power; r = (LONGREAL)1; @@ -56,39 +56,39 @@ LONGREAL Reals_TenL (int16 e) __RETCHK; } -int16 Reals_Expo (REAL x) +INT16 Reals_Expo (REAL x) { - int16 i; - __GET((address)&x + 2, i, int16); + INT16 i; + __GET((address)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } -void Reals_SetExpo (REAL *x, int16 ex) +void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } -int16 Reals_ExpoL (LONGREAL x) +INT16 Reals_ExpoL (LONGREAL x) { - int16 i; - __GET((address)&x + 6, i, int16); + INT16 i; + __GET((address)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } -void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len) { - int32 i, j, k; + INT32 i, j, k; if (x < (LONGREAL)0) { x = -x; } k = 0; if (n > 9) { - i = (int32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); - j = (int32)__ENTIER(x - i * (LONGREAL)1000000000); + i = (INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000); + j = (INT32)__ENTIER(x - i * (LONGREAL)1000000000); if (j < 0) { j = 0; } @@ -98,7 +98,7 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) k += 1; } } else { - i = (int32)__ENTIER(x); + i = (INT32)__ENTIER(x); } while (k < n) { d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48); @@ -107,12 +107,12 @@ void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len) } } -void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len) +void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len) { Reals_ConvertL(x, n, (void*)d, d__len); } -static CHAR Reals_ToHex (int16 i) +static CHAR Reals_ToHex (INT16 i) { if (i < 10) { return (CHAR)(i + 48); @@ -124,15 +124,15 @@ static CHAR Reals_ToHex (int16 i) static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - int16 i; - int32 l; + INT16 i; + INT32 l; CHAR by; i = 0; l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int16)by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int16)by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 664fe2ec..07688e3c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h @@ -8,15 +8,15 @@ -import void Reals_Convert (REAL x, int16 n, CHAR *d, LONGINT d__len); +import void Reals_Convert (REAL x, INT16 n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); -import void Reals_ConvertL (LONGREAL x, int16 n, CHAR *d, LONGINT d__len); -import int16 Reals_Expo (REAL x); -import int16 Reals_ExpoL (LONGREAL x); -import void Reals_SetExpo (REAL *x, int16 ex); -import REAL Reals_Ten (int16 e); -import LONGREAL Reals_TenL (int16 e); +import void Reals_ConvertL (LONGREAL x, INT16 n, CHAR *d, LONGINT d__len); +import INT16 Reals_Expo (REAL x); +import INT16 Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INT16 ex); +import REAL Reals_Ten (INT16 e); +import LONGREAL Reals_TenL (INT16 e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 104a0fb7..141a9976 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" @@ -12,18 +12,18 @@ export void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); export void Strings_Cap (CHAR *s, LONGINT s__len); -export void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -export void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -export void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -export int16 Strings_Length (CHAR *s, LONGINT s__len); +export void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +export void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +export void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Length (CHAR *s, LONGINT s__len); export BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -export int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -export void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +export INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +export void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); -int16 Strings_Length (CHAR *s, LONGINT s__len) +INT16 Strings_Length (CHAR *s, LONGINT s__len) { - int32 i; + INT32 i; __DUP(s, s__len, CHAR); i = 0; while ((i < s__len && s[__X(i, s__len)] != 0x00)) { @@ -31,7 +31,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) } if (i <= 32767) { __DEL(s); - return (int16)i; + return (INT16)i; } else { __DEL(s); return 32767; @@ -41,7 +41,7 @@ int16 Strings_Length (CHAR *s, LONGINT s__len) void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(extra, extra__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(extra, extra__len); @@ -56,9 +56,9 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__ __DEL(extra); } -void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { - int16 n1, n2, i; + INT16 n1, n2, i; __DUP(source, source__len, CHAR); n1 = Strings_Length(dest, dest__len); n2 = Strings_Length(source, source__len); @@ -87,9 +87,9 @@ void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, L __DEL(source); } -void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) +void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n) { - int16 len, i; + INT16 len, i; len = Strings_Length(s, s__len); if (pos < 0) { pos = 0; @@ -110,7 +110,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n) } } -void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len) +void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len) { __DUP(source, source__len, CHAR); Strings_Delete((void*)dest, dest__len, pos, pos + Strings_Length(source, source__len)); @@ -118,12 +118,12 @@ void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, __DEL(source); } -void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len) +void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len) { - int16 len, destLen, i; + INT16 len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = (int16)dest__len - 1; + destLen = (INT16)dest__len - 1; if (pos < 0) { pos = 0; } @@ -143,9 +143,9 @@ void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHA __DEL(source); } -int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos) +INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos) { - int16 n1, n2, i, j; + INT16 n1, n2, i, j; __DUP(pattern, pattern__len, CHAR); __DUP(s, s__len, CHAR); n1 = Strings_Length(s, s__len); @@ -177,7 +177,7 @@ int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, void Strings_Cap (CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; i = 0; while (s[__X(i, s__len)] != 0x00) { if (('a' <= s[__X(i, s__len)] && s[__X(i, s__len)] <= 'z')) { @@ -191,9 +191,9 @@ static struct Match__7 { struct Match__7 *lnk; } *Match__7_s; -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m); +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m); -static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, int16 n, int16 m) +static BOOLEAN M__8 (CHAR *name, LONGINT name__len, CHAR *mask, LONGINT mask__len, INT16 n, INT16 m) { while ((((n >= 0 && m >= 0)) && mask[__X(m, mask__len)] != '*')) { if (name[__X(n, name__len)] != mask[__X(m, mask__len)]) { diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 24f35c02..4319e8c8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h @@ -10,13 +10,13 @@ import void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__len); import void Strings_Cap (CHAR *s, LONGINT s__len); -import void Strings_Delete (CHAR *s, LONGINT s__len, int16 pos, int16 n); -import void Strings_Extract (CHAR *source, LONGINT source__len, int16 pos, int16 n, CHAR *dest, LONGINT dest__len); -import void Strings_Insert (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); -import int16 Strings_Length (CHAR *s, LONGINT s__len); +import void Strings_Delete (CHAR *s, LONGINT s__len, INT16 pos, INT16 n); +import void Strings_Extract (CHAR *source, LONGINT source__len, INT16 pos, INT16 n, CHAR *dest, LONGINT dest__len); +import void Strings_Insert (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Length (CHAR *s, LONGINT s__len); import BOOLEAN Strings_Match (CHAR *string, LONGINT string__len, CHAR *pattern, LONGINT pattern__len); -import int16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, int16 pos); -import void Strings_Replace (CHAR *source, LONGINT source__len, int16 pos, CHAR *dest, LONGINT dest__len); +import INT16 Strings_Pos (CHAR *pattern, LONGINT pattern__len, CHAR *s, LONGINT s__len, INT16 pos); +import void Strings_Replace (CHAR *source, LONGINT source__len, INT16 pos, CHAR *dest, LONGINT dest__len); import void *Strings__init(void); diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index e84157d1..3b932ce7 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Files.h" @@ -19,9 +19,9 @@ typedef typedef struct Texts_RunDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; } Texts_RunDesc; @@ -34,7 +34,7 @@ typedef } Texts_ElemMsg; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_TextDesc *Texts_Text; @@ -42,26 +42,26 @@ typedef typedef struct Texts_ElemDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; } Texts_ElemDesc; struct Texts__1 { /* Texts_ElemDesc */ Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; - int32 W, H; + INT32 W, H; Texts_Handler handle; Texts_Text base; Files_File file; - int32 org, span; + INT32 org, span; CHAR mod[32], proc[32]; }; @@ -70,7 +70,7 @@ typedef typedef struct Texts_BufDesc { - int32 len; + INT32 len; Texts_Run head; } Texts_BufDesc; @@ -84,8 +84,8 @@ typedef typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -100,7 +100,7 @@ typedef } Texts_IdentifyMsg; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_PieceDesc *Texts_Piece; @@ -108,57 +108,57 @@ typedef typedef struct Texts_PieceDesc { Texts_Run prev, next; - int32 len; + INT32 len; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; BOOLEAN ascii; Files_File file; - int32 org; + INT32 org; } Texts_PieceDesc; typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; } Texts_Reader; typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; Files_Rider rider; Texts_Run run; - int32 org, off; + INT32 org, off; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; Texts_Run head, cache; - int32 corg; + INT32 corg; } Texts_TextDesc; typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Files_Rider rider; Files_File file; } Texts_Writer; @@ -168,68 +168,68 @@ export Texts_Elem Texts_new; static Texts_Buffer Texts_del; static Texts_FontsFont Texts_FontsDefault; -export address *Texts_FontDesc__typ; -export address *Texts_RunDesc__typ; -export address *Texts_PieceDesc__typ; -export address *Texts_ElemMsg__typ; -export address *Texts_ElemDesc__typ; -export address *Texts_FileMsg__typ; -export address *Texts_CopyMsg__typ; -export address *Texts_IdentifyMsg__typ; -export address *Texts_BufDesc__typ; -export address *Texts_TextDesc__typ; -export address *Texts_Reader__typ; -export address *Texts_Scanner__typ; -export address *Texts_Writer__typ; -export address *Texts__1__typ; +export ADDRESS *Texts_FontDesc__typ; +export ADDRESS *Texts_RunDesc__typ; +export ADDRESS *Texts_PieceDesc__typ; +export ADDRESS *Texts_ElemMsg__typ; +export ADDRESS *Texts_ElemDesc__typ; +export ADDRESS *Texts_FileMsg__typ; +export ADDRESS *Texts_CopyMsg__typ; +export ADDRESS *Texts_IdentifyMsg__typ; +export ADDRESS *Texts_BufDesc__typ; +export ADDRESS *Texts_TextDesc__typ; +export ADDRESS *Texts_Reader__typ; +export ADDRESS *Texts_Scanner__typ; +export ADDRESS *Texts_Writer__typ; +export ADDRESS *Texts__1__typ; export void Texts_Append (Texts_Text T, Texts_Buffer B); -export void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +export void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); static Texts_Elem Texts_CloneElem (Texts_Elem e); static Texts_Piece Texts_ClonePiece (Texts_Piece p); export void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); export void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -export void Texts_Delete (Texts_Text T, int32 beg, int32 end); +export void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); export Texts_Text Texts_ElemBase (Texts_Elem E); -export int32 Texts_ElemPos (Texts_Elem E); -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off); +export INT32 Texts_ElemPos (Texts_Elem E); +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len); -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ); -export void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -export void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T); +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ); +export void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +export void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); static void Texts_Merge (Texts_Text T, Texts_Run u, Texts_Run *v); export void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); export void Texts_OpenBuf (Texts_Buffer B); -export void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -export void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -export void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -export int32 Texts_Pos (Texts_Reader *R, address *R__typ); -export void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -export void Texts_ReadElem (Texts_Reader *R, address *R__typ); -export void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +export void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +export void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +export void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +export INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +export void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +export void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); export void Texts_Recall (Texts_Buffer *B); -export void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -export void Texts_Scan (Texts_Scanner *S, address *S__typ); -export void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -export void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -export void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); +export void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +export void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +export void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +export void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +export void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); static void Texts_Splice (Texts_Run un, Texts_Run v, Texts_Run w, Texts_Text base); -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un); -export void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -export void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -export void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -export void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -export void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -export void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -export void Texts_WriteLn (Texts_Writer *W, address *W__typ); -export void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -export void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -export void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -export void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -export void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -export void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un); +export void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +export void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +export void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +export void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +export void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +export void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +export void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +export void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +export void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +export void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +export void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +export void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +export void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) @@ -240,10 +240,10 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len) return F; } -static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int32 *off) +static void Texts_Find (Texts_Text T, INT32 *pos, Texts_Run *u, INT32 *org, INT32 *off) { Texts_Run v = NIL; - int32 m; + INT32 m; if (*pos >= T->len) { *pos = T->len; *u = T->head; @@ -273,7 +273,7 @@ static void Texts_Find (Texts_Text T, int32 *pos, Texts_Run *u, int32 *org, int3 } } -static void Texts_Split (int32 off, Texts_Run *u, Texts_Run *un) +static void Texts_Split (INT32 off, Texts_Run *u, Texts_Run *un) { Texts_Piece p = NIL, U = NIL; if (off == 0) { @@ -366,10 +366,10 @@ Texts_Text Texts_ElemBase (Texts_Elem E) return E->base; } -int32 Texts_ElemPos (Texts_Elem E) +INT32 Texts_ElemPos (Texts_Elem E) { Texts_Run u = NIL; - int32 pos; + INT32 pos; u = E->base->head->next; pos = 0; while (u != (void *) E) { @@ -379,11 +379,11 @@ int32 Texts_ElemPos (Texts_Elem E) return pos; } -static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, address *msg__typ) +static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, ADDRESS *msg__typ) { Texts_Alien e = NIL; Files_Rider r; - int32 i; + INT32 i; CHAR ch; if (__ISP(E, Texts__1, 2)) { if (__IS(msg__typ, Texts_CopyMsg, 1)) { @@ -459,10 +459,10 @@ void Texts_Recall (Texts_Buffer *B) Texts_del = NIL; } -void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) +void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B) { Texts_Run u = NIL, v = NIL, w = NIL, wn = NIL; - int32 uo, ud, vo, vd; + INT32 uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Find(T, &end, &v, &vo, &vd); w = B->head->prev; @@ -493,11 +493,11 @@ void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B) B->len += end - beg; } -void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) +void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B) { Texts_Run u = NIL, un = NIL, v = NIL; Texts_Piece p = NIL, q = NIL; - int32 uo, ud, len; + INT32 uo, ud, len; Texts_Find(T, &pos, &u, &uo, &ud); Texts_Split(ud, &u, &un); len = B->len; @@ -516,7 +516,7 @@ void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B) void Texts_Append (Texts_Text T, Texts_Buffer B) { Texts_Run v = NIL; - int32 pos, len; + INT32 pos, len; pos = T->len; len = B->len; v = B->head->next; @@ -531,10 +531,10 @@ void Texts_Append (Texts_Text T, Texts_Buffer B) } } -void Texts_Delete (Texts_Text T, int32 beg, int32 end) +void Texts_Delete (Texts_Text T, INT32 beg, INT32 end) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -556,10 +556,10 @@ void Texts_Delete (Texts_Text T, int32 beg, int32 end) } } -void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff) +void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff) { Texts_Run c = NIL, u = NIL, un = NIL, v = NIL, vn = NIL; - int32 co, uo, ud, vo, vd; + INT32 co, uo, ud, vo, vd; Texts_Find(T, &beg, &u, &uo, &ud); Texts_Split(ud, &u, &un); c = T->cache; @@ -595,7 +595,7 @@ void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_Fo } } -void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos) +void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos) { Texts_Run u = NIL; if (pos >= T->len) { @@ -609,10 +609,10 @@ void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos } } -void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) +void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch) { Texts_Run u = NIL; - int32 pos; + INT32 pos; CHAR nextch; u = (*R).run; (*R).fnt = u->fnt; @@ -654,7 +654,7 @@ void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch) } } -void Texts_ReadElem (Texts_Reader *R, address *R__typ) +void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL, un = NIL; u = (*R).run; @@ -682,7 +682,7 @@ void Texts_ReadElem (Texts_Reader *R, address *R__typ) } } -void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) +void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ) { Texts_Run u = NIL; u = (*R).run->prev; @@ -704,12 +704,12 @@ void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ) } } -int32 Texts_Pos (Texts_Reader *R, address *R__typ) +INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ) { return (*R).org + (*R).off; } -void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos) +void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos) { Texts_OpenReader((void*)&*S, S__typ, T, pos); (*S).line = 0; @@ -718,10 +718,10 @@ void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 p static struct Scan__31 { Texts_Scanner *S; - address *S__typ; + ADDRESS *S__typ; CHAR *ch; BOOLEAN *negE; - int16 *e; + INT16 *e; struct Scan__31 *lnk; } *Scan__31_s; @@ -740,18 +740,18 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + (int16)*Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } -void Texts_Scan (Texts_Scanner *S, address *S__typ) +void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ) { CHAR ch, term; BOOLEAN neg, negE, hex; - int8 i, j, h; - int16 e; - int32 k; + INT8 i, j, h; + INT16 e; + INT32 k; REAL x, f; LONGREAL y, g; CHAR d[32]; @@ -812,10 +812,10 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)((int16)ch - 7); + ch = (CHAR)((INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)((int16)ch - 39); + ch = (CHAR)((INT16)ch - 39); } else { break; } @@ -827,13 +827,13 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) if (i - j > 8) { j = i - 8; } - k = (int16)d[__X(j, 32)] - 48; + k = (INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + ((int16)d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -854,12 +854,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + ((int16)d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = ((int16)d[__X(j, 32)] - 48) * g + y; + y = ((INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -886,12 +886,12 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + ((int16)d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = ((int16)d[__X(j, 32)] - 48) * f + x; + x = ((INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -923,7 +923,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + ((int16)d[__X(j, 32)] - 48); + k = k * 10 + ((INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -951,7 +951,7 @@ void Texts_Scan (Texts_Scanner *S, address *S__typ) Scan__31_s = _s.lnk; } -void Texts_OpenWriter (Texts_Writer *W, address *W__typ) +void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ) { __NEW((*W).buf, Texts_BufDesc); Texts_OpenBuf((*W).buf); @@ -962,22 +962,22 @@ void Texts_OpenWriter (Texts_Writer *W, address *W__typ) Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0); } -void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt) +void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt) { (*W).fnt = fnt; } -void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col) +void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col) { (*W).col = col; } -void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff) +void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff) { (*W).voff = voff; } -void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) +void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; @@ -1003,7 +1003,7 @@ void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch) } } -void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) +void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e) { Texts_Run u = NIL, un = NIL; if (e->base != NIL) { @@ -1022,14 +1022,14 @@ void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e) un->prev = (Texts_Run)e; } -void Texts_WriteLn (Texts_Writer *W, address *W__typ) +void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ) { Texts_Write(&*W, W__typ, 0x0d); } -void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len) +void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len) { - int16 i; + INT16 i; __DUP(s, s__len, CHAR); i = 0; while (s[__X(i, s__len)] >= ' ') { @@ -1039,10 +1039,10 @@ void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__le __DEL(s); } -void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) +void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n) { - int16 i; - int64 x0; + INT16 i; + INT64 x0; CHAR a[24]; i = 0; if (x < 0) { @@ -1061,7 +1061,7 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) x0 = __DIV(x0, 10); i += 1; } while (!(x0 == 0)); - while (n > (int64)i) { + while (n > (INT64)i) { Texts_Write(&*W, W__typ, ' '); n -= 1; } @@ -1074,10 +1074,10 @@ void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n) } while (!(i == 0)); } -void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) +void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x) { - int16 i; - int32 y; + INT16 i; + INT32 y; CHAR a[20]; i = 0; Texts_Write(&*W, W__typ, ' '); @@ -1097,9 +1097,9 @@ void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x) } while (!(i == 0)); } -void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) +void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n) { - int16 e; + INT16 e; REAL x0; CHAR d[9]; e = Reals_Expo(x); @@ -1169,16 +1169,16 @@ void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n) static struct WriteRealFix__53 { Texts_Writer *W; - address *W__typ; - int16 *i; + ADDRESS *W__typ; + INT16 *i; CHAR (*d)[9]; struct WriteRealFix__53 *lnk; } *WriteRealFix__53_s; -static void dig__54 (int16 n); -static void seq__56 (CHAR ch, int16 n); +static void dig__54 (INT16 n); +static void seq__56 (CHAR ch, INT16 n); -static void seq__56 (CHAR ch, int16 n) +static void seq__56 (CHAR ch, INT16 n) { while (n > 0) { Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, ch); @@ -1186,7 +1186,7 @@ static void seq__56 (CHAR ch, int16 n) } } -static void dig__54 (int16 n) +static void dig__54 (INT16 n) { while (n > 0) { *WriteRealFix__53_s->i -= 1; @@ -1195,9 +1195,9 @@ static void dig__54 (int16 n) } } -void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k) +void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k) { - int16 e, i; + INT16 e, i; CHAR sign; REAL x0; CHAR d[9]; @@ -1267,9 +1267,9 @@ void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int1 WriteRealFix__53_s = _s.lnk; } -void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) +void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x) { - int16 i; + INT16 i; CHAR d[8]; Reals_ConvertH(x, (void*)d, 8); i = 0; @@ -1279,9 +1279,9 @@ void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x) } while (!(i == 8)); } -void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) +void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n) { - int16 e; + INT16 e; LONGREAL x0; CHAR d[16]; e = Reals_ExpoL(x); @@ -1313,7 +1313,7 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } else { Texts_Write(&*W, W__typ, ' '); } - e = (int16)__ASHR((e - 1023) * 77, 8); + e = (INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { @@ -1351,9 +1351,9 @@ void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n) } } -void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) +void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x) { - int16 i; + INT16 i; CHAR d[16]; Reals_ConvertHL(x, (void*)d, 16); i = 0; @@ -1365,20 +1365,20 @@ void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x) static struct WriteDate__43 { Texts_Writer *W; - address *W__typ; + ADDRESS *W__typ; struct WriteDate__43 *lnk; } *WriteDate__43_s; -static void WritePair__44 (CHAR ch, int32 x); +static void WritePair__44 (CHAR ch, INT32 x); -static void WritePair__44 (CHAR ch, int32 x) +static void WritePair__44 (CHAR ch, INT32 x) { Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48)); Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48)); } -void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) +void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d) { struct WriteDate__43 _s; _s.W = W; _s.W__typ = W__typ; @@ -1395,22 +1395,22 @@ void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d) static struct Load0__16 { Texts_Text *T; - int8 *ecnt; + INT8 *ecnt; Files_File *f; Texts_FileMsg *msg; CHAR (*mods)[64][32], (*procs)[64][32]; struct Load0__16 *lnk; } *Load0__16_s; -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e); +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e); -static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span, Texts_Elem *e) +static void LoadElem__17 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, INT32 span, Texts_Elem *e) { Modules_Module M = NIL; Modules_Command Cmd; Texts_Alien a = NIL; - int32 org, ew, eh; - int8 eno; + INT32 org, ew, eh; + INT8 eno; Texts_new = NIL; Files_ReadLInt(&*r, r__typ, &ew); Files_ReadLInt(&*r, r__typ, &eh); @@ -1455,13 +1455,13 @@ static void LoadElem__17 (Files_Rider *r, address *r__typ, int32 pos, int32 span } } -static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) +static void Texts_Load0 (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Texts_Run u = NIL, un = NIL; Texts_Piece p = NIL; Texts_Elem e = NIL; - int32 org, pos, hlen, plen; - int8 ecnt, fcnt, fno, col, voff; + INT32 org, pos, hlen, plen; + INT8 ecnt, fcnt, fno, col, voff; Files_File f = NIL; Texts_FileMsg msg; CHAR mods[64][32], procs[64][32]; @@ -1529,9 +1529,9 @@ static void Texts_Load0 (Files_Rider *r, address *r__typ, Texts_Text T) Load0__16_s = _s.lnk; } -void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { - int16 tag; + INT16 tag; Files_ReadInt(&*r, r__typ, &tag); if (tag != -4095) { Files_Set(&*r, r__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ) - 2); @@ -1546,7 +1546,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) Texts_Run u = NIL; Texts_Piece p = NIL; CHAR tag, version; - int32 hlen; + INT32 hlen; __DUP(name, name__len, CHAR); f = Files_Old(name, name__len); if (f == NIL) { @@ -1596,20 +1596,20 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len) } static struct Store__39 { - int8 *ecnt; + INT8 *ecnt; Texts_FileMsg *msg; Texts_IdentifyMsg *iden; CHAR (*mods)[64][32], (*procs)[64][32]; struct Store__39 *lnk; } *Store__39_s; -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e); +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e); -static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Elem e) +static void StoreElem__40 (Files_Rider *r, ADDRESS *r__typ, INT32 pos, Texts_Elem e) { Files_Rider r1; - int32 org, span; - int8 eno; + INT32 org, span; + INT8 eno; __COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32); __COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32); eno = 1; @@ -1635,15 +1635,15 @@ static void StoreElem__40 (Files_Rider *r, address *r__typ, int32 pos, Texts_Ele Files_WriteLInt(&r1, Files_Rider__typ, e->H); } -void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T) +void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T) { Files_Rider r1; Texts_Run u = NIL, un = NIL; Texts_Elem e = NIL; - int32 org, pos, delta, hlen, rlen; - int8 ecnt, fcnt; + INT32 org, pos, delta, hlen, rlen; + INT8 ecnt, fcnt; CHAR ch; - int8 fno; + INT8 fno; Texts_FileMsg msg; Texts_IdentifyMsg iden; CHAR mods[64][32], procs[64][32]; @@ -1759,7 +1759,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len) { Files_File f = NIL; Files_Rider r; - int16 i, res; + INT16 i, res; CHAR bak[64]; __DUP(name, name__len, CHAR); f = Files_New(name, name__len); diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 1d663861..bff9cc72 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h @@ -8,8 +8,8 @@ typedef struct Texts_BufDesc { - int32 len; - int64 _prvt0; + INT32 len; + INT64 _prvt0; } Texts_BufDesc; typedef @@ -30,26 +30,26 @@ typedef typedef struct Texts_RunDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[27]; } Texts_RunDesc; typedef - void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, address *); + void (*Texts_Handler)(Texts_Elem, Texts_ElemMsg*, ADDRESS *); typedef struct Texts_ElemDesc { - int64 _prvt0; + INT64 _prvt0; char _prvt1[28]; - int32 W, H; + INT32 W, H; Texts_Handler handle; char _prvt2[8]; } Texts_ElemDesc; typedef struct Texts_FileMsg { /* Texts_ElemMsg */ - int16 id; - int32 pos; + INT16 id; + INT32 pos; Files_Rider r; } Texts_FileMsg; @@ -70,13 +70,13 @@ typedef struct Texts_TextDesc *Texts_Text; typedef - void (*Texts_Notifier)(Texts_Text, int16, int32, int32); + void (*Texts_Notifier)(Texts_Text, INT16, INT32, INT32); typedef struct Texts_Reader { BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; } Texts_Reader; @@ -85,22 +85,22 @@ typedef struct Texts_Scanner { /* Texts_Reader */ BOOLEAN eot; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; Texts_Elem elem; char _prvt0[40]; CHAR nextCh; - int16 line, class; - int32 i; + INT16 line, class; + INT32 i; REAL x; LONGREAL y; CHAR c; - int8 len; + INT8 len; CHAR s[64]; } Texts_Scanner; typedef struct Texts_TextDesc { - int32 len; + INT32 len; Texts_Notifier notify; char _prvt0[20]; } Texts_TextDesc; @@ -109,64 +109,64 @@ typedef struct Texts_Writer { Texts_Buffer buf; Texts_FontsFont fnt; - int8 col, voff; + INT8 col, voff; char _prvt0[38]; } Texts_Writer; import Texts_Elem Texts_new; -import address *Texts_FontDesc__typ; -import address *Texts_RunDesc__typ; -import address *Texts_ElemMsg__typ; -import address *Texts_ElemDesc__typ; -import address *Texts_FileMsg__typ; -import address *Texts_CopyMsg__typ; -import address *Texts_IdentifyMsg__typ; -import address *Texts_BufDesc__typ; -import address *Texts_TextDesc__typ; -import address *Texts_Reader__typ; -import address *Texts_Scanner__typ; -import address *Texts_Writer__typ; +import ADDRESS *Texts_FontDesc__typ; +import ADDRESS *Texts_RunDesc__typ; +import ADDRESS *Texts_ElemMsg__typ; +import ADDRESS *Texts_ElemDesc__typ; +import ADDRESS *Texts_FileMsg__typ; +import ADDRESS *Texts_CopyMsg__typ; +import ADDRESS *Texts_IdentifyMsg__typ; +import ADDRESS *Texts_BufDesc__typ; +import ADDRESS *Texts_TextDesc__typ; +import ADDRESS *Texts_Reader__typ; +import ADDRESS *Texts_Scanner__typ; +import ADDRESS *Texts_Writer__typ; import void Texts_Append (Texts_Text T, Texts_Buffer B); -import void Texts_ChangeLooks (Texts_Text T, int32 beg, int32 end, uint32 sel, Texts_FontsFont fnt, int8 col, int8 voff); +import void Texts_ChangeLooks (Texts_Text T, INT32 beg, INT32 end, UINT32 sel, Texts_FontsFont fnt, INT8 col, INT8 voff); import void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_Copy (Texts_Buffer SB, Texts_Buffer DB); import void Texts_CopyElem (Texts_Elem SE, Texts_Elem DE); -import void Texts_Delete (Texts_Text T, int32 beg, int32 end); +import void Texts_Delete (Texts_Text T, INT32 beg, INT32 end); import Texts_Text Texts_ElemBase (Texts_Elem E); -import int32 Texts_ElemPos (Texts_Elem E); -import void Texts_Insert (Texts_Text T, int32 pos, Texts_Buffer B); -import void Texts_Load (Files_Rider *r, address *r__typ, Texts_Text T); +import INT32 Texts_ElemPos (Texts_Elem E); +import void Texts_Insert (Texts_Text T, INT32 pos, Texts_Buffer B); +import void Texts_Load (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); import void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len); import void Texts_OpenBuf (Texts_Buffer B); -import void Texts_OpenReader (Texts_Reader *R, address *R__typ, Texts_Text T, int32 pos); -import void Texts_OpenScanner (Texts_Scanner *S, address *S__typ, Texts_Text T, int32 pos); -import void Texts_OpenWriter (Texts_Writer *W, address *W__typ); -import int32 Texts_Pos (Texts_Reader *R, address *R__typ); -import void Texts_Read (Texts_Reader *R, address *R__typ, CHAR *ch); -import void Texts_ReadElem (Texts_Reader *R, address *R__typ); -import void Texts_ReadPrevElem (Texts_Reader *R, address *R__typ); +import void Texts_OpenReader (Texts_Reader *R, ADDRESS *R__typ, Texts_Text T, INT32 pos); +import void Texts_OpenScanner (Texts_Scanner *S, ADDRESS *S__typ, Texts_Text T, INT32 pos); +import void Texts_OpenWriter (Texts_Writer *W, ADDRESS *W__typ); +import INT32 Texts_Pos (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_Read (Texts_Reader *R, ADDRESS *R__typ, CHAR *ch); +import void Texts_ReadElem (Texts_Reader *R, ADDRESS *R__typ); +import void Texts_ReadPrevElem (Texts_Reader *R, ADDRESS *R__typ); import void Texts_Recall (Texts_Buffer *B); -import void Texts_Save (Texts_Text T, int32 beg, int32 end, Texts_Buffer B); -import void Texts_Scan (Texts_Scanner *S, address *S__typ); -import void Texts_SetColor (Texts_Writer *W, address *W__typ, int8 col); -import void Texts_SetFont (Texts_Writer *W, address *W__typ, Texts_FontsFont fnt); -import void Texts_SetOffset (Texts_Writer *W, address *W__typ, int8 voff); -import void Texts_Store (Files_Rider *r, address *r__typ, Texts_Text T); -import void Texts_Write (Texts_Writer *W, address *W__typ, CHAR ch); -import void Texts_WriteDate (Texts_Writer *W, address *W__typ, int32 t, int32 d); -import void Texts_WriteElem (Texts_Writer *W, address *W__typ, Texts_Elem e); -import void Texts_WriteHex (Texts_Writer *W, address *W__typ, int32 x); -import void Texts_WriteInt (Texts_Writer *W, address *W__typ, int64 x, int64 n); -import void Texts_WriteLn (Texts_Writer *W, address *W__typ); -import void Texts_WriteLongReal (Texts_Writer *W, address *W__typ, LONGREAL x, int16 n); -import void Texts_WriteLongRealHex (Texts_Writer *W, address *W__typ, LONGREAL x); -import void Texts_WriteReal (Texts_Writer *W, address *W__typ, REAL x, int16 n); -import void Texts_WriteRealFix (Texts_Writer *W, address *W__typ, REAL x, int16 n, int16 k); -import void Texts_WriteRealHex (Texts_Writer *W, address *W__typ, REAL x); -import void Texts_WriteString (Texts_Writer *W, address *W__typ, CHAR *s, LONGINT s__len); +import void Texts_Save (Texts_Text T, INT32 beg, INT32 end, Texts_Buffer B); +import void Texts_Scan (Texts_Scanner *S, ADDRESS *S__typ); +import void Texts_SetColor (Texts_Writer *W, ADDRESS *W__typ, INT8 col); +import void Texts_SetFont (Texts_Writer *W, ADDRESS *W__typ, Texts_FontsFont fnt); +import void Texts_SetOffset (Texts_Writer *W, ADDRESS *W__typ, INT8 voff); +import void Texts_Store (Files_Rider *r, ADDRESS *r__typ, Texts_Text T); +import void Texts_Write (Texts_Writer *W, ADDRESS *W__typ, CHAR ch); +import void Texts_WriteDate (Texts_Writer *W, ADDRESS *W__typ, INT32 t, INT32 d); +import void Texts_WriteElem (Texts_Writer *W, ADDRESS *W__typ, Texts_Elem e); +import void Texts_WriteHex (Texts_Writer *W, ADDRESS *W__typ, INT32 x); +import void Texts_WriteInt (Texts_Writer *W, ADDRESS *W__typ, INT64 x, INT64 n); +import void Texts_WriteLn (Texts_Writer *W, ADDRESS *W__typ); +import void Texts_WriteLongReal (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x, INT16 n); +import void Texts_WriteLongRealHex (Texts_Writer *W, ADDRESS *W__typ, LONGREAL x); +import void Texts_WriteReal (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n); +import void Texts_WriteRealFix (Texts_Writer *W, ADDRESS *W__typ, REAL x, INT16 n, INT16 k); +import void Texts_WriteRealHex (Texts_Writer *W, ADDRESS *W__typ, REAL x); +import void Texts_WriteString (Texts_Writer *W, ADDRESS *W__typ, CHAR *s, LONGINT s__len); import void *Texts__init(void); diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index c3a9491f..b5067d33 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Out.h" @@ -14,36 +14,36 @@ export CHAR VT100_CSI[5]; static CHAR VT100_tmpstr[32]; -export void VT100_CHA (int16 n); -export void VT100_CNL (int16 n); -export void VT100_CPL (int16 n); -export void VT100_CUB (int16 n); -export void VT100_CUD (int16 n); -export void VT100_CUF (int16 n); -export void VT100_CUP (int16 n, int16 m); -export void VT100_CUU (int16 n); +export void VT100_CHA (INT16 n); +export void VT100_CNL (INT16 n); +export void VT100_CPL (INT16 n); +export void VT100_CUB (INT16 n); +export void VT100_CUD (INT16 n); +export void VT100_CUF (INT16 n); +export void VT100_CUP (INT16 n, INT16 m); +export void VT100_CUU (INT16 n); export void VT100_DECTCEMh (void); export void VT100_DECTCEMl (void); -export void VT100_DSR (int16 n); -export void VT100_ED (int16 n); -export void VT100_EL (int16 n); -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len); +export void VT100_DSR (INT16 n); +export void VT100_ED (INT16 n); +export void VT100_EL (INT16 n); +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len); static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len); -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len); -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len); -export void VT100_HVP (int16 n, int16 m); -export void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len); +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len); +export void VT100_HVP (INT16 n, INT16 m); +export void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); export void VT100_RCP (void); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end); +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end); export void VT100_SCP (void); -export void VT100_SD (int16 n); -export void VT100_SGR (int16 n); -export void VT100_SGR2 (int16 n, int16 m); -export void VT100_SU (int16 n); +export void VT100_SD (INT16 n); +export void VT100_SGR (INT16 n); +export void VT100_SGR2 (INT16 n, INT16 m); +export void VT100_SU (INT16 n); export void VT100_SetAttr (CHAR *attr, LONGINT attr__len); -static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) +static void VT100_Reverse0 (CHAR *str, LONGINT str__len, INT16 start, INT16 end) { CHAR h; while (start < end) { @@ -55,11 +55,11 @@ static void VT100_Reverse0 (CHAR *str, LONGINT str__len, int16 start, int16 end) } } -void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len) +void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len) { CHAR b[21]; - int16 s, e; - int8 maxLength; + INT16 s, e; + INT8 maxLength; maxLength = 11; if (int_ == (-2147483647-1)) { __MOVE("-2147483648", b, 12); @@ -94,7 +94,7 @@ static void VT100_EscSeq0 (CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -107,7 +107,7 @@ static void VT100_EscSeq (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeqSwapped (INT16 n, CHAR *letter, LONGINT letter__len) { CHAR nstr[2]; CHAR cmd[7]; @@ -120,7 +120,7 @@ static void VT100_EscSeqSwapped (int16 n, CHAR *letter, LONGINT letter__len) __DEL(letter); } -static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) +static void VT100_EscSeq2 (INT16 n, INT16 m, CHAR *letter, LONGINT letter__len) { CHAR nstr[5], mstr[5]; CHAR cmd[12]; @@ -136,82 +136,82 @@ static void VT100_EscSeq2 (int16 n, int16 m, CHAR *letter, LONGINT letter__len) __DEL(letter); } -void VT100_CUU (int16 n) +void VT100_CUU (INT16 n) { VT100_EscSeq(n, (CHAR*)"A", 2); } -void VT100_CUD (int16 n) +void VT100_CUD (INT16 n) { VT100_EscSeq(n, (CHAR*)"B", 2); } -void VT100_CUF (int16 n) +void VT100_CUF (INT16 n) { VT100_EscSeq(n, (CHAR*)"C", 2); } -void VT100_CUB (int16 n) +void VT100_CUB (INT16 n) { VT100_EscSeq(n, (CHAR*)"D", 2); } -void VT100_CNL (int16 n) +void VT100_CNL (INT16 n) { VT100_EscSeq(n, (CHAR*)"E", 2); } -void VT100_CPL (int16 n) +void VT100_CPL (INT16 n) { VT100_EscSeq(n, (CHAR*)"F", 2); } -void VT100_CHA (int16 n) +void VT100_CHA (INT16 n) { VT100_EscSeq(n, (CHAR*)"G", 2); } -void VT100_CUP (int16 n, int16 m) +void VT100_CUP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"H", 2); } -void VT100_ED (int16 n) +void VT100_ED (INT16 n) { VT100_EscSeq(n, (CHAR*)"J", 2); } -void VT100_EL (int16 n) +void VT100_EL (INT16 n) { VT100_EscSeq(n, (CHAR*)"K", 2); } -void VT100_SU (int16 n) +void VT100_SU (INT16 n) { VT100_EscSeq(n, (CHAR*)"S", 2); } -void VT100_SD (int16 n) +void VT100_SD (INT16 n) { VT100_EscSeq(n, (CHAR*)"T", 2); } -void VT100_HVP (int16 n, int16 m) +void VT100_HVP (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"f", 2); } -void VT100_SGR (int16 n) +void VT100_SGR (INT16 n) { VT100_EscSeq(n, (CHAR*)"m", 2); } -void VT100_SGR2 (int16 n, int16 m) +void VT100_SGR2 (INT16 n, INT16 m) { VT100_EscSeq2(n, m, (CHAR*)"m", 2); } -void VT100_DSR (int16 n) +void VT100_DSR (INT16 n) { VT100_EscSeq(6, (CHAR*)"n", 2); } diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ee0408bb..d9aa6ab7 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h @@ -9,27 +9,27 @@ import CHAR VT100_CSI[5]; -import void VT100_CHA (int16 n); -import void VT100_CNL (int16 n); -import void VT100_CPL (int16 n); -import void VT100_CUB (int16 n); -import void VT100_CUD (int16 n); -import void VT100_CUF (int16 n); -import void VT100_CUP (int16 n, int16 m); -import void VT100_CUU (int16 n); +import void VT100_CHA (INT16 n); +import void VT100_CNL (INT16 n); +import void VT100_CPL (INT16 n); +import void VT100_CUB (INT16 n); +import void VT100_CUD (INT16 n); +import void VT100_CUF (INT16 n); +import void VT100_CUP (INT16 n, INT16 m); +import void VT100_CUU (INT16 n); import void VT100_DECTCEMh (void); import void VT100_DECTCEMl (void); -import void VT100_DSR (int16 n); -import void VT100_ED (int16 n); -import void VT100_EL (int16 n); -import void VT100_HVP (int16 n, int16 m); -import void VT100_IntToStr (int32 int_, CHAR *str, LONGINT str__len); +import void VT100_DSR (INT16 n); +import void VT100_ED (INT16 n); +import void VT100_EL (INT16 n); +import void VT100_HVP (INT16 n, INT16 m); +import void VT100_IntToStr (INT32 int_, CHAR *str, LONGINT str__len); import void VT100_RCP (void); import void VT100_SCP (void); -import void VT100_SD (int16 n); -import void VT100_SGR (int16 n); -import void VT100_SGR2 (int16 n, int16 m); -import void VT100_SU (int16 n); +import void VT100_SD (INT16 n); +import void VT100_SGR (INT16 n); +import void VT100_SGR2 (INT16 n, INT16 m); +import void VT100_SU (INT16 n); import void VT100_SetAttr (CHAR *attr, LONGINT attr__len); import void *VT100__init(void); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index cce1644f..2a1a7a02 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 9d34f721..5555899e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index d2dcce53..8ed00f14 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,9 +1,9 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ -#define SHORTINT int8 -#define INTEGER int16 -#define LONGINT int32 -#define SET uint32 +#define SHORTINT INT8 +#define INTEGER INT16 +#define LONGINT INT32 +#define SET UINT32 #include "SYSTEM.h" #include "Configuration.h" @@ -24,7 +24,7 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGINT cmd__len) { - int16 r, status, exitcode; + INT16 r, status, exitcode; __DUP(title, title__len, CHAR); __DUP(cmd, cmd__len, CHAR); if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 2e262037..ad76f7b6 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/10/28]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/doc/Features.md b/doc/Features.md index 6ed5d420..21ab306e 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -16,15 +16,15 @@ integer and set types, it is not. Some examples: it tries to store the flag value to a file using standard library functions. The Oakwood guidelines specify that INTEGER be stored in 16 bits on file regardless of it's size in memory*. - + - Code that assumes that INTEGER values wrap around at known values will fail. For example - i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on - systems with a larger SHORTINT representation. - + i: SHORTINT; ... i := 127; INC(i); will produce -128 on original systems, but +128 on + systems with a larger SHORTINT representation. + - Bit manipulation code that uses SYSTEM.VAL to access parts of values will access the wrong number of bits. For example, the implementation of REAL and LONGREAL library functions use SYSTEM.VAL(SET, realvalue) to access and change the sign, mantissa and exponent of REALs. - + Therefore we provide compilation options to select the representation of SHORTINT, INTEGER, LONGINT and SET. \* It makes sense for Oakwood to insist on fixed sizes for the standard types as this is a pre-requisite @@ -33,7 +33,7 @@ for stable file exchange between different builds of applications, and between d #### Compiler options for integer and set sizes. -The -O2 and -OC compiler options select nbetween the two most commonly used integer and set +The -O2 and -OC compiler options select between the two most commonly used integer and set type implementations. | Type | -O2 option (default) | -OC option | @@ -46,18 +46,22 @@ type implementations. The following Oberon types are independent of compiler size: -| Types | Size | -| ----- | -------| -| REAL | 32 bit | -| LONGREAL | 64 bit | -| HUGEINT* | 64 bit | -| CHAR** | 8 bit | +| Types | Size | +| ----- | ------- | +| REAL | 32 bit floating point | +| LONGREAL | 64 bit floating point | +| HUGEINT* | 64 bit signed integer | +| BYTE** | 8 bit signed integer (-OC model only) | +| CHAR*** | 8 bit character | \* The additional type HUGEINT is predefined as a 64 bit integer, providing 64 bit support even in -O2 compilations. -\** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. - - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. +\** The additional type BYTE is defined for -OC (Component Pascal) model only and is a *signed* +8 bit integer. + +\*** No built-in support is provided for the UTF-16 or UCS-2 Unicode encodings. UTF-8 is the recommended Unicode encoding for text. + - 16 bits has been insufficient for the Unicode character repetoire for at least 15 years. - Writing systems often require more than one unicode codepoint to represent a single character (and what constitutes a character can vary according to context). - UTF-8 is now widely used. @@ -89,11 +93,22 @@ In -O2, where LONGINT is 32 bits, LONG() now accepts a LONGINT value returning a In -OC, where SHORTINT is 16 bits, SHORT() now accepts a SHORTINT value returning a SYSTEM.INT8 value. +#### ASH() + +The Arithmetic shift function is defined by Oberon-2 as follows: + +| Name | Argument types | Result Type | Function | +| ---- | --- | --- | --- | +| ASH(*x*, *n*) | *x*, *n*: integer type | LONGINT | arithmetic shift (*x* * 2^*n*) | + +For compatability this definition is retained for all integer types up to LONGINT in size. +Additionally, when *x* is the new HUGEINT type, the result is HUGEINT. + #### Pointers and Addresses Most Oberon systems have implicitly or explicitly assumed that LONGINT is large enough to hold -machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no +machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no longer possible. The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index ba59ef22..5670546e 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -39,7 +39,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 50, 9 OF CHAR; + keytab: ARRAY 60 (*50*), 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -112,9 +112,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form IN {OPT.Int, OPT.Set}) THEN - IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") + IF obj.typ = OPT.adrtyp THEN OPM.WriteString("ADDRESS") ELSE - IF obj.typ.form = OPT.Int THEN OPM.WriteString("int") ELSE OPM.WriteString("uint") END; + IF obj.typ.form = OPT.Int THEN OPM.WriteString("INT") ELSE OPM.WriteString("UINT") END; OPM.WriteInt(obj.typ.size*8) END ELSE @@ -568,9 +568,9 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) DEC(gap, (adr - off) + align); BegStat; CASE align OF - |2: OPM.WriteString("int16") - |4: OPM.WriteString("int32") - |8: OPM.WriteString("int64") + |2: OPM.WriteString("INT16") + |4: OPM.WriteString("INT32") + |8: OPM.WriteString("INT64") ELSE OPM.LogWLn; OPM.LogWStr("Unexpected enclosing alignment in FillGap.") END; Str1(" _prvt#", n); INC(n); EndStat; @@ -659,7 +659,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString("LONGINT "); LenList(obj, FALSE, TRUE) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN EndStat; BegStat; - OPM.WriteString("address *"); Ident(obj); OPM.WriteString(TagExt); + OPM.WriteString("ADDRESS *"); Ident(obj); OPM.WriteString(TagExt); base := NIL ELSIF (OPM.ptrinit IN OPM.Options) & (vis = 0) & (obj^.mnolev > 0) & (obj^.typ^.form = OPT.Pointer) THEN OPM.WriteString(" = NIL") @@ -687,7 +687,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString(", LONGINT "); LenList(obj, TRUE, showParamNames) ELSIF (obj^.mode = OPT.VarPar) & (obj^.typ^.comp = OPT.Record) THEN - OPM.WriteString(", address *"); + OPM.WriteString(", ADDRESS *"); IF showParamNames THEN Ident(obj); OPM.WriteString(TagExt) END END ; IF (obj^.link = NIL) OR (obj^.link.mode = OPT.TProc) THEN EXIT END ; @@ -751,7 +751,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) ELSIF (typ^.strobj # NIL) & (typ^.strobj^.mnolev > 0) THEN OPM.WriteString('static ') ELSE OPM.WriteString(Export) END ; - OPM.WriteString("address *"); Andent(typ); OPM.WriteString(DynTypExt); + OPM.WriteString("ADDRESS *"); Andent(typ); OPM.WriteString(DynTypExt); EndStat END ; n := n^.link @@ -823,10 +823,10 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteLn; (* Define model dependent type sizes *) - OPM.WriteString("#define SHORTINT int"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define INTEGER int"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define LONGINT int"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; - OPM.WriteString("#define SET uint"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SHORTINT INT"); OPM.WriteInt(OPT.sinttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define INTEGER INT"); OPM.WriteInt(OPT.inttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define LONGINT INT"); OPM.WriteInt(OPT.linttyp.size*8); OPM.WriteLn; + OPM.WriteString("#define SET UINT"); OPM.WriteInt(OPT.settyp.size*8); OPM.WriteLn; OPM.WriteLn; Include(BasicIncludeFile); @@ -1204,7 +1204,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) PROCEDURE IntLiteral*(n: SYSTEM.INT64; size: LONGINT); BEGIN IF (size > OPM.CIntSize) & (n <= OPM.CIntMax) & (n > OPM.CIntMin) THEN - OPM.WriteString("((int"); OPM.WriteInt(size*8); OPM.WriteString(")("); + OPM.WriteString("((INT"); OPM.WriteInt(size*8); OPM.WriteString(")("); OPM.WriteInt(n); OPM.WriteString("))") ELSE OPM.WriteInt(n) @@ -1264,8 +1264,27 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) END Enter; BEGIN n := 0; - FOR i := 0 TO 104 DO hashtab[i] := -1 END ; + FOR i := 0 TO LEN(hashtab)-1 DO hashtab[i] := -1 END ; + Enter("ADDRESS"); (* pseudo keyword used by voc *) + Enter("INT16"); (* pseudo keyword used by voc *) + Enter("INT32"); (* pseudo keyword used by voc *) + Enter("INT64"); (* pseudo keyword used by voc *) + Enter("INT8"); (* pseudo keyword used by voc *) + Enter("UINT16"); (* pseudo keyword used by voc *) + Enter("UINT32"); (* pseudo keyword used by voc *) + Enter("UINT64"); (* pseudo keyword used by voc *) + Enter("UINT8"); (* pseudo keyword used by voc *) + Enter("address"); (* pseudo keyword used by voc *) + Enter("int16"); (* pseudo keyword used by voc *) + Enter("int32"); (* pseudo keyword used by voc *) + Enter("int64"); (* pseudo keyword used by voc *) + Enter("int8"); (* pseudo keyword used by voc *) + Enter("uint16"); (* pseudo keyword used by voc *) + Enter("uint32"); (* pseudo keyword used by voc *) + Enter("uint64"); (* pseudo keyword used by voc *) + Enter("uint8"); (* pseudo keyword used by voc *) + Enter("asm"); Enter("auto"); Enter("break"); @@ -1287,10 +1306,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("if"); Enter("import"); (* pseudo keyword used by voc *) Enter("int"); - Enter("int16"); (* pseudo keyword used by voc *) - Enter("int32"); (* pseudo keyword used by voc *) - Enter("int64"); (* pseudo keyword used by voc *) - Enter("int8"); (* pseudo keyword used by voc *) Enter("long"); Enter("register"); Enter("return"); @@ -1302,10 +1317,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); - Enter("uint16"); (* pseudo keyword used by voc *) - Enter("uint32"); (* pseudo keyword used by voc *) - Enter("uint64"); (* pseudo keyword used by voc *) - Enter("uint8"); (* pseudo keyword used by voc *) Enter("union"); Enter("unsigned"); Enter("void"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index cc3c93ef..318a0847 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -240,7 +240,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteInt(OPM.SignedMaximum(to) + 1); OPM.Write(CloseParen) ELSE IF (n.typ.size # to) & ((n.typ.size > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN - OPM.WriteString("(int"); OPM.WriteInt(to*8); OPM.WriteString(")") + OPM.WriteString("(INT"); OPM.WriteInt(to*8); OPM.WriteString(")") END END END SizeCast; diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 5359a664..3ca44012 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -110,7 +110,7 @@ BEGIN RETURN e = EINTR() END Interrupted; (* OS memory allocaton *) -PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)malloc((size_t)size))"; PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; @@ -193,7 +193,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (ADDRESS)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -373,7 +373,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): LONGINT -"(LONGINT)read(fd, (void*)(address)(p), l)"; +"(LONGINT)read(fd, (void*)(ADDRESS)(p), l)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -390,7 +390,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): SYSTEM.ADDRESS -"write(fd, (void*)(address)(p), l)"; +"write(fd, (void*)(ADDRESS)(p), l)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; VAR written: SYSTEM.ADDRESS; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index bc9e4fd3..1ef34d49 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -108,7 +108,7 @@ BEGIN RETURN e = EINTR() END Interrupted; (* OS memory allocaton *) -PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; @@ -204,8 +204,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((ADDRESS)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((ADDRESS)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -236,7 +236,7 @@ BEGIN YMDHMStoClock(styear(), stmon(), stmday(), sthour(), stmin(), stsec(), t, d); END GetClock; -PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(uint32)GetTickCount()"; +PROCEDURE -GetTickCount(): LONGINT "(LONGINT)(UINT32)GetTickCount()"; PROCEDURE Time*(): LONGINT; VAR ms: LONGINT; @@ -297,16 +297,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(ADDRESS)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -417,7 +417,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)(address)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +"(INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -436,7 +436,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(address)fd, (void*)(p), (DWORD)l, 0,0)"; +"(INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(address)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -594,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(address)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/runtime/SYSTEM.c b/src/runtime/SYSTEM.c index b97144e7..a1b2cb14 100644 --- a/src/runtime/SYSTEM.c +++ b/src/runtime/SYSTEM.c @@ -24,7 +24,7 @@ -int64 SYSTEM_DIV(int64 x, int64 y) +INT64 SYSTEM_DIV(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -35,7 +35,7 @@ int64 SYSTEM_DIV(int64 x, int64 y) else {return (-x)/(-y);} } -int64 SYSTEM_MOD(int64 x, int64 y) +INT64 SYSTEM_MOD(INT64 x, INT64 y) { if (x == 0) return 0; if (x >= 0) @@ -46,31 +46,20 @@ int64 SYSTEM_MOD(int64 x, int64 y) else {return -((-x) % (-y));} } -// LONGINT SYSTEM_ENTIER(double x) -// { -// LONGINT y; -// if (x >= 0) -// return (LONGINT)x; -// else { -// y = (LONGINT)x; -// if (y <= x) return y; else return y - 1; -// } -// } - -int64 SYSTEM_ENTIER(double x) +INT64 SYSTEM_ENTIER(double x) { - int64 y; + INT64 y; if (x >= 0) - return (int64)x; + return (INT64)x; else { - y = (int64)x; + y = (INT64)x; if (y <= x) return y; else return y - 1; } } -void SYSTEM_INHERIT(address *t, address *t0) +void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0) { t -= __TPROC0OFF; t0 -= __TPROC0OFF; @@ -78,23 +67,23 @@ void SYSTEM_INHERIT(address *t, address *t0) } -void SYSTEM_ENUMP(void *adr, address n, void (*P)()) +void SYSTEM_ENUMP(void *adr, ADDRESS n, void (*P)()) { while (n > 0) { - P((address)(*((void**)(adr)))); + P((ADDRESS)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } } -void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) +void SYSTEM_ENUMR(void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()) { - address *t, off; + ADDRESS *t, off; typ++; while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(ADDRESS*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -103,19 +92,19 @@ void SYSTEM_ENUMR(void *adr, address *typ, address size, address n, void (*P)()) extern void Heap_Lock(); extern void Heap_Unlock(); -SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, int nofdyn, ...) +SYSTEM_PTR SYSTEM_NEWARR(ADDRESS *typ, ADDRESS elemsz, int elemalgn, int nofdim, int nofdyn, ...) { - address nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; + ADDRESS nofelems, size, dataoff, n, nptr, *x, *p, nofptrs, i, *ptab, off; va_list ap; va_start(ap, nofdyn); nofelems = 1; while (nofdim > 0) { - nofelems = nofelems * va_arg(ap, address); nofdim--; + nofelems = nofelems * va_arg(ap, ADDRESS); nofdim--; if (nofelems <= 0) __HALT(-20); } va_end(ap); - dataoff = nofdyn * sizeof(address); - if (elemalgn > sizeof(address)) { + dataoff = nofdyn * sizeof(ADDRESS); + if (elemalgn > sizeof(ADDRESS)) { n = dataoff % elemalgn; if (n != 0) dataoff += elemalgn - n; } @@ -125,37 +114,37 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, /* element typ does not contain pointers */ x = Heap_NEWBLK(size); } - else if (typ == (address*)POINTER__typ) { + else if (typ == (ADDRESS*)POINTER__typ) { /* element type is a pointer */ - x = Heap_NEWBLK(size + nofelems * sizeof(address)); - p = (address*)(address)x[-1]; + x = Heap_NEWBLK(size + nofelems * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ - while (n <= nofelems) {*p = n*sizeof(address); p++; n++;} - *p = - (nofelems + 1) * sizeof(address); /* sentinel */ - x[-1] -= nofelems * sizeof(address); + while (n <= nofelems) {*p = n*sizeof(ADDRESS); p++; n++;} + *p = - (nofelems + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nofelems * sizeof(ADDRESS); } else { /* element type is a record that contains pointers */ ptab = typ + 1; nofptrs = 0; while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ - x = Heap_NEWBLK(size + nptr * sizeof(address)); - p = (address*)(address)x[- 1]; + x = Heap_NEWBLK(size + nptr * sizeof(ADDRESS)); + p = (ADDRESS*)(ADDRESS)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; while (i < nofptrs) {*p = off + ptab[i]; p++; i++;} off += elemsz; n++; } - *p = - (nptr + 1) * sizeof(address); /* sentinel */ - x[-1] -= nptr * sizeof(address); + *p = - (nptr + 1) * sizeof(ADDRESS); /* sentinel */ + x[-1] -= nptr * sizeof(ADDRESS); } if (nofdyn != 0) { /* setup len vector for index checks */ va_start(ap, nofdyn); p = x; - while (nofdyn > 0) {*p = va_arg(ap, address); p++, nofdyn--;} + while (nofdyn > 0) {*p = va_arg(ap, ADDRESS); p++, nofdyn--;} va_end(ap); } Heap_Unlock(); @@ -165,7 +154,7 @@ SYSTEM_PTR SYSTEM_NEWARR(address *typ, address elemsz, int elemalgn, int nofdim, -typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler +typedef void (*SystemSignalHandler)(INT32); // = Platform_SignalHandler #ifndef _WIN32 @@ -177,7 +166,7 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, address h) { + void SystemSetHandler(int s, ADDRESS h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -216,12 +205,12 @@ typedef void (*SystemSignalHandler)(int32); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(address h) { + void SystemSetInterruptHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(address h) { + void SystemSetQuitHandler(ADDRESS h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 4600fe8b..481cded9 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -33,22 +33,22 @@ void *alloca(size_t size); #if defined (o__64) && !defined(_WIN64) // LP64 - typedef long int64; - typedef unsigned long uint64; + typedef long INT64; + typedef unsigned long UINT64; #else // ILP32 or LLP64 - typedef long long int64; - typedef unsigned long long uint64; + typedef long long INT64; + typedef unsigned long long UINT64; #endif -typedef int int32; -typedef unsigned int uint32; +typedef int INT32; +typedef unsigned int UINT32; -typedef short int int16; -typedef unsigned short int uint16; +typedef short int INT16; +typedef unsigned short int UINT16; -typedef signed char int8; -typedef unsigned char uint8; +typedef signed char INT8; +typedef unsigned char UINT8; // The compiler uses 'import' and 'export' which translate to 'extern' and @@ -63,29 +63,41 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((address*)(1)) // not NIL and not a valid type +#define POINTER__typ ((ADDRESS*)(1)) // not NIL and not a valid type // Oberon types -typedef int8 BOOLEAN; -typedef int8 SYSTEM_BYTE; -typedef uint8 CHAR; +typedef INT8 BOOLEAN; +typedef INT8 SYSTEM_BYTE; +typedef UINT8 CHAR; typedef float REAL; typedef double LONGREAL; typedef void* SYSTEM_PTR; -// 'address' is a synonym for an int of pointer size +// 'ADDRESS' is a synonym for an integer of pointer size #if defined (o__64) - #define address int64 + #define ADDRESS INT64 #else - #define address int32 + #define ADDRESS INT32 #endif +// Temporary build support - which changing lowercase int* and address to uppercase + +#define int8 INT8 +#define int16 INT16 +#define int32 INT32 +#define int64 INT64 +#define uint8 UINT8 +#define uint16 UINT16 +#define uint32 UINT32 +#define uint64 UINT64 +#define address ADDRESS + @@ -96,30 +108,30 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern address Platform_OSAllocate (address size); -extern void Platform_OSFree (address addr); +extern ADDRESS Platform_OSAllocate (ADDRESS size); +extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(int32 x); -extern void Platform_AssertFail(int32 x); +extern void Platform_Halt(INT32 x); +extern void Platform_AssertFail(INT32 x); #define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((int32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) // Index checking -static inline int64 __XF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-2);} return i;} +static inline INT64 __XF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-2);} return i;} #define __X(i, ub) (((i)<(ub))?i:(__HALT(-2),0)) // Range checking, and checked SHORT and CHR functions -static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return i;} +static inline INT64 __RF(UINT64 i, UINT64 ub) {if (i >= ub) {__HALT(-8);} return i;} #define __R(i, ub) (((i)<(ub))?i:(__HALT(-8),0)) -#define __SHORT(x, ub) ((int)((uint64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) +#define __SHORT(x, ub) ((int)((UINT64)(x)+(ub)<(ub)+(ub)?(x):(__HALT(-8),0))) #define __SHORTF(x, ub) ((int)(__RF((x)+(ub),(ub)+(ub))-(ub))) #define __CHR(x) ((CHAR)__R(x, 256)) #define __CHRF(x) ((CHAR)__RF(x, 256)) @@ -129,10 +141,10 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, address h); + extern void SystemSetHandler(int s, ADDRESS h); #else - extern void SystemSetInterruptHandler(address h); - extern void SystemSetQuitHandler (address h); + extern void SystemSetInterruptHandler(ADDRESS h); + extern void SystemSetQuitHandler (ADDRESS h); #endif @@ -140,7 +152,7 @@ static inline int64 __RF(uint64 i, uint64 ub) {if (i >= ub) {__HALT(-8);} return // String comparison static inline int __str_cmp(CHAR *x, CHAR *y){ - int64 i = 0; + INT64 i = 0; CHAR ch1, ch2; do {ch1 = x[i]; ch2 = y[i]; i++; if (!ch1) return -(int)ch2; @@ -164,8 +176,8 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x=*(t*)(address)(a) -#define __PUT(a, x, t) *(t*)(address)(a)=x +#define __GET(a, x, t) x=*(t*)(ADDRESS)(a) +#define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x #define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) #define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) @@ -175,33 +187,33 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) -#define __ASHL(x, n) ((int64)(x)<<(n)) -#define __ASHR(x, n) ((int64)(x)>>(n)) +#define __ASHL(x, n) ((INT64)(x)<<(n)) +#define __ASHR(x, n) ((INT64)(x)>>(n)) #define __ASH(x, n) ((n)>=0?__ASHL(x,n):__ASHR(x,-(n))) -static inline int64 SYSTEM_ASH(int64 x, int64 n) {return __ASH(x,n);} -#define __ASHF(x, n) SYSTEM_ASH((int64)(x), (int64)(n)) +static inline INT64 SYSTEM_ASH(INT64 x, INT64 n) {return __ASH(x,n);} +#define __ASHF(x, n) SYSTEM_ASH((INT64)(x), (INT64)(n)) -#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(ADDRESS)(d),(char*)(ADDRESS)(s),n) -extern int64 SYSTEM_DIV(int64 x, int64 y); +extern INT64 SYSTEM_DIV(INT64 x, INT64 y); #define __DIVF(x, y) SYSTEM_DIV(x, y) #define __DIV(x, y) (((x)>0 && (y)>0) ? (x)/(y) : __DIVF(x, y)) -extern int64 SYSTEM_MOD(int64 x, int64 y); +extern INT64 SYSTEM_MOD(INT64 x, INT64 y); #define __MODF(x, y) SYSTEM_MOD(x, y) #define __MOD(x, y) (((x)>0 && (y)>0) ? (x)%(y) : __MODF(x, y)) -extern int64 SYSTEM_ENTIER (double x); +extern INT64 SYSTEM_ENTIER (double x); #define __ENTIER(x) SYSTEM_ENTIER(x) #define __ABS(x) (((x)<0)?-(x):(x)) -static inline int32 SYSTEM_ABS64(int64 i) {return i >= 0 ? i : -i;} -static inline int64 SYSTEM_ABS32(int32 i) {return i >= 0 ? i : -i;} +static inline INT32 SYSTEM_ABS64(INT64 i) {return i >= 0 ? i : -i;} +static inline INT64 SYSTEM_ABS32(INT32 i) {return i >= 0 ? i : -i;} #define __ABSF(x) ((sizeof(x) <= 4) ? SYSTEM_ABS32(x) : SYSTEM_ABS64(x)) static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} @@ -216,7 +228,7 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) -#define __BIT(x, n) (*(uint64*)(x)>>(n)&1) +#define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) @@ -227,8 +239,8 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __WITHCHK __HALT(-7) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(address)typ##__typ) -#define __TYPEOF(p) (*(((address**)(p))-1)) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(ADDRESS)typ##__typ) +#define __TYPEOF(p) (*(((ADDRESS**)(p))-1)) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) @@ -257,67 +269,67 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(int32 argc, address argv); +extern void Platform_Init(INT32 argc, ADDRESS argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init(argc, (address)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init(argc, (ADDRESS)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (address size); -extern SYSTEM_PTR Heap_NEWREC (address tag); -extern SYSTEM_PTR SYSTEM_NEWARR(address*, address, int, int, int, ...); +extern SYSTEM_PTR Heap_NEWBLK (ADDRESS size); +extern SYSTEM_PTR Heap_NEWREC (ADDRESS tag); +extern SYSTEM_PTR SYSTEM_NEWARR(ADDRESS*, ADDRESS, int, int, int, ...); -#define __SYSNEW(p, len) p = Heap_NEWBLK((address)(len)) -#define __NEW(p, t) p = Heap_NEWREC((address)t##__typ) +#define __SYSNEW(p, len) p = Heap_NEWBLK((ADDRESS)(len)) +#define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ) #define __NEWARR SYSTEM_NEWARR /* Type handling */ -extern void SYSTEM_INHERIT(address *t, address *t0); -extern void SYSTEM_ENUMP (void *adr, address n, void (*P)()); -extern void SYSTEM_ENUMR (void *adr, address *typ, address size, address n, void (*P)()); +extern void SYSTEM_INHERIT(ADDRESS *t, ADDRESS *t0); +extern void SYSTEM_ENUMP (void *adr, ADDRESS n, void (*P)()); +extern void SYSTEM_ENUMR (void *adr, ADDRESS *typ, ADDRESS size, ADDRESS n, void (*P)()); #define __TDESC(t, m, n) \ static struct t##__desc { \ - address tproc[m]; /* Proc for each ptr field */ \ - address tag; \ - address next; /* Module table type list points here */ \ - address level; \ - address module; \ + ADDRESS tproc[m]; /* Proc for each ptr field */ \ + ADDRESS tag; \ + ADDRESS next; /* Module table type list points here */ \ + ADDRESS level; \ + ADDRESS module; \ char name[24]; \ - address basep[__MAXEXT]; /* List of bases this extends */ \ - address reserved; \ - address blksz; /* xxx_typ points here */ \ - address ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ + ADDRESS basep[__MAXEXT]; /* List of bases this extends */ \ + ADDRESS reserved; \ + ADDRESS blksz; /* xxx_typ points here */ \ + ADDRESS ptr[n+1]; /* Offsets of ptrs up to -ve sentinel */ \ } t##__desc #define __BASEOFF (__MAXEXT+1) // blksz as index to base. -#define __TPROC0OFF (__BASEOFF+24/sizeof(address)+5) // blksz as index to tproc IFF m=1. +#define __TPROC0OFF (__BASEOFF+24/sizeof(ADDRESS)+5) // blksz as index to tproc IFF m=1. #define __EOM 1 #define __TDFLDS(name, size) {__EOM}, 1, 0, 0, 0, name, {0}, 0, size -#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (address)(n), P) -#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (address)(size), (address)(n), P) +#define __ENUMP(adr, n, P) SYSTEM_ENUMP(adr, (ADDRESS)(n), P) +#define __ENUMR(adr, typ, size, n, P) SYSTEM_ENUMR(adr, typ, (ADDRESS)(size), (ADDRESS)(n), P) #define __INITYP(t, t0, level) \ - t##__typ = (address*)&t##__desc.blksz; \ - memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(address)); \ - t##__desc.basep[level] = (address)t##__typ; \ - t##__desc.module = (address)m; \ + t##__typ = (ADDRESS*)&t##__desc.blksz; \ + memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(ADDRESS)); \ + t##__desc.basep[level] = (ADDRESS)t##__typ; \ + t##__desc.module = (ADDRESS)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ - t##__desc.blksz = (t##__desc.blksz+5*sizeof(address)-1)/(4*sizeof(address))*(4*sizeof(address)); \ - Heap_REGTYP(m, (address)&t##__desc.next); \ + t##__desc.blksz = (t##__desc.blksz+5*sizeof(ADDRESS)-1)/(4*sizeof(ADDRESS))*(4*sizeof(ADDRESS)); \ + Heap_REGTYP(m, (ADDRESS)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(address)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(ADDRESS)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((ADDRESS)*(typ-(__TPROC0OFF+num))))parlist From a17c087a414391afef44197218b3fd18fab55f03 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 12:13:58 +0000 Subject: [PATCH 109/140] Uppercase internal SYSTEM.H types address, int*, uint*. Completed. --- bootstrap/SYSTEM.h | 28 +++++++--------------------- bootstrap/unix-44/Files.c | 22 +++++++++++----------- bootstrap/unix-44/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPC.c | 15 +++------------ bootstrap/unix-44/OPM.c | 6 +++--- bootstrap/unix-44/OPV.c | 6 +++--- bootstrap/unix-44/Out.c | 8 ++++---- bootstrap/unix-44/Platform.c | 10 +++++----- bootstrap/unix-44/Reals.c | 12 ++++++------ bootstrap/unix-48/Files.c | 22 +++++++++++----------- bootstrap/unix-48/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPC.c | 15 +++------------ bootstrap/unix-48/OPM.c | 6 +++--- bootstrap/unix-48/OPV.c | 6 +++--- bootstrap/unix-48/Out.c | 8 ++++---- bootstrap/unix-48/Platform.c | 10 +++++----- bootstrap/unix-48/Reals.c | 12 ++++++------ bootstrap/unix-88/Files.c | 22 +++++++++++----------- bootstrap/unix-88/Heap.c | 32 ++++++++++++++++---------------- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPC.c | 15 +++------------ bootstrap/unix-88/OPM.c | 6 +++--- bootstrap/unix-88/OPV.c | 6 +++--- bootstrap/unix-88/Out.c | 8 ++++---- bootstrap/unix-88/Platform.c | 10 +++++----- bootstrap/unix-88/Reals.c | 12 ++++++------ bootstrap/windows-48/Files.c | 22 +++++++++++----------- bootstrap/windows-48/Heap.c | 32 ++++++++++++++++---------------- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPC.c | 15 +++------------ bootstrap/windows-48/OPM.c | 6 +++--- bootstrap/windows-48/OPV.c | 6 +++--- bootstrap/windows-48/Out.c | 8 ++++---- bootstrap/windows-48/Platform.c | 8 ++++---- bootstrap/windows-48/Reals.c | 12 ++++++------ bootstrap/windows-88/Files.c | 22 +++++++++++----------- bootstrap/windows-88/Heap.c | 32 ++++++++++++++++---------------- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPC.c | 15 +++------------ bootstrap/windows-88/OPM.c | 6 +++--- bootstrap/windows-88/OPV.c | 6 +++--- bootstrap/windows-88/Out.c | 8 ++++---- bootstrap/windows-88/Platform.c | 8 ++++---- bootstrap/windows-88/Reals.c | 12 ++++++------ doc/Features.md | 5 ++++- src/compiler/OPC.Mod | 12 +----------- src/compiler/OPV.Mod | 6 +++--- src/runtime/Files.Mod | 2 +- src/runtime/Heap.Mod | 22 +++++++++++----------- src/runtime/Out.Mod | 2 +- src/runtime/Platformunix.Mod | 2 +- src/runtime/SYSTEM.h | 28 +++++++--------------------- src/tools/make/configure.c | 8 ++++---- src/tools/make/ignore | 2 +- 56 files changed, 299 insertions(+), 379 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 481cded9..fb88276c 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -86,20 +86,6 @@ typedef void* SYSTEM_PTR; #endif -// Temporary build support - which changing lowercase int* and address to uppercase - -#define int8 INT8 -#define int16 INT16 -#define int32 INT32 -#define int64 INT64 -#define uint8 UINT8 -#define uint16 UINT16 -#define uint32 UINT32 -#define uint64 UINT64 -#define address ADDRESS - - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -179,12 +165,12 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(ADDRESS)(a) #define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x -#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) -#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n))) +#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n))) #define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) -#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((INT64)(x)<<(n)) @@ -222,10 +208,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) // todo tested versions of SETOF and SETRNG: check that x, l and h fit size -#define __SETOF(x, size) ((uint##size)1<<(x)) -#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) +#define __SETOF(x, size) ((UINT##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) #define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 998a53d3..fc49744a 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f130d638..343fb141 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 998a53d3..fc49744a 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f130d638..343fb141 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT32 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index d5fefc27..2572b5cd 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a162ea04..efbba685 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 8); + return (SYSTEM_PTR)(ADDRESS)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (INT64 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT64 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((address)&blksz); - tag = ((INT64)(address)new + blksz) - 24; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT64)(ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, INT64); __PUT(tag, blksz, INT64); __PUT(tag + 8, -8, INT64); - __PUT((INT64)(address)new - 8, tag, INT64); + __PUT((INT64)(ADDRESS)new - 8, tag, INT64); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT64 q) __GET(tag, offset, INT64); fld = q + offset; __GET(fld, p, INT64); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT64); @@ -364,7 +364,7 @@ static void Heap_Mark (INT64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, INT64); __PUT(q - 8, tag + 1, INT64); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT64)(address)p); + Heap_Mark((INT64)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT64)(address)obj; + f->obj = (INT64)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 46b6c33e..d343241b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ee84e643..ac2e6fba 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 04b1e484..c435c944 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(1, (address)Out_buf, Out_in); + error = Platform_Write(1, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(1, (address)str, l); + error = Platform_Write(1, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 3e3c2992..c75a6d63 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -158,7 +158,7 @@ extern void Heap_InitHeap(); #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino #define Platform_statmtime() (LONGINT)s.st_mtime -#define Platform_statsize() (address)s.st_size +#define Platform_statsize() (ADDRESS)s.st_size #define Platform_structstats() struct stat s #define Platform_system(str, str__len) system((char*)str) #define Platform_tmhour() (LONGINT)time->tm_hour @@ -227,7 +227,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -258,7 +258,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -488,7 +488,7 @@ INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { - *n = Platform_readfile(h, (address)b, b__len); + *n = Platform_readfile(h, (ADDRESS)b, b__len); if (*n < 0) { *n = 0; return Platform_err(); @@ -696,7 +696,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-8}}; diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6a00f93e..5f08fc35 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index ca99053e..e8c720bb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(adr + 8, 0, INT32); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 4); + return (SYSTEM_PTR)(ADDRESS)(adr + 4); } SYSTEM_PTR Heap_NEWBLK (INT32 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT32 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((address)&blksz); - tag = ((INT32)(address)new + blksz) - 12; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT32)(ADDRESS)new + blksz) - 12; __PUT(tag - 4, 0, INT32); __PUT(tag, blksz, INT32); __PUT(tag + 4, -4, INT32); - __PUT((INT32)(address)new - 4, tag, INT32); + __PUT((INT32)(ADDRESS)new - 4, tag, INT32); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT32 q) __GET(tag, offset, INT32); fld = q + offset; __GET(fld, p, INT32); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT32); @@ -364,7 +364,7 @@ static void Heap_Mark (INT32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, INT32); __PUT(q - 4, tag + 1, INT32); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT32)(address)p); + Heap_Mark((INT32)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT32)(address)obj; + f->obj = (INT32)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index be4ec200..9b4663f5 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 8854dd67..f40a6104 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 03213c6a..ea8636f2 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + error = Platform_Write(Platform_StdOut, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(Platform_StdOut, (address)str, l); + error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a084fb4..baa90502 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -275,7 +275,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -518,7 +518,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; - result = Platform_readfile(h, (address)b, b__len, &lengthread); + result = Platform_readfile(h, (ADDRESS)b, b__len, &lengthread); if (result == 0) { *n = 0; return Platform_err(); @@ -742,7 +742,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index e7239705..28c9e997 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -109,7 +109,7 @@ export void Files_WriteSet (Files_Rider *R, ADDRESS *R__typ, UINT32 x); export void Files_WriteString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len); #define Files_IdxTrap() __HALT(-1) -#define Files_ToAdr(x) (address)x +#define Files_ToAdr(x) (ADDRESS)x static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INT16 errcode) { @@ -262,7 +262,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (address)buf->data, buf->size); + error = Platform_Write(f->fd, (ADDRESS)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -645,7 +645,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((address)buf->data + Files_ToAdr(offset), (address)x + Files_ToAdr(xpos), min); + __MOVE((ADDRESS)buf->data + Files_ToAdr(offset), (ADDRESS)x + Files_ToAdr(xpos), min); offset += min; (*r).offset = offset; xpos += min; @@ -703,7 +703,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((address)x + Files_ToAdr(xpos), (address)buf->data + Files_ToAdr(offset), min); + __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -760,15 +760,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT __DEL(new); return; } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (address)buf, n); + error = Platform_Write(fdnew, (ADDRESS)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (address)buf, 4096, &n); + error = Platform_Read(fdold, (ADDRESS)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -826,7 +826,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((address)src, (address)dest, src__len); + __MOVE((ADDRESS)src, (ADDRESS)dest, src__len); } } @@ -916,7 +916,7 @@ void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__ } q += (INT64)__ASH((__MASK(b, -64) - __ASHL(__ASHR(b, 6), 6)), s); __ASSERT(x__len <= 8, 0); - __MOVE((address)&q, (address)x, x__len); + __MOVE((ADDRESS)&q, (ADDRESS)x, x__len); } void Files_WriteBool (Files_Rider *R, ADDRESS *R__typ, BOOLEAN x) @@ -996,7 +996,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; INT32 res; - f = (Files_File)(address)o; + f = (Files_File)(ADDRESS)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1009,7 +1009,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((ADDRESS)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a162ea04..efbba685 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -105,8 +105,8 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern address Platform_MainStackFrame; -extern address Platform_OSAllocate(address size); +extern ADDRESS Platform_MainStackFrame; +extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -138,7 +138,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(address)Heap_modules; + m->next = (Heap_Module)(ADDRESS)Heap_modules; Heap_modules = (SYSTEM_PTR)m; return (void*)m; } @@ -313,7 +313,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(adr + 16, 0, INT64); Heap_allocated += blksz; Heap_Unlock(); - return (SYSTEM_PTR)(address)(adr + 8); + return (SYSTEM_PTR)(ADDRESS)(adr + 8); } SYSTEM_PTR Heap_NEWBLK (INT64 size) @@ -322,12 +322,12 @@ SYSTEM_PTR Heap_NEWBLK (INT64 size) SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((address)&blksz); - tag = ((INT64)(address)new + blksz) - 24; + new = Heap_NEWREC((ADDRESS)&blksz); + tag = ((INT64)(ADDRESS)new + blksz) - 24; __PUT(tag - 8, 0, INT64); __PUT(tag, blksz, INT64); __PUT(tag + 8, -8, INT64); - __PUT((INT64)(address)new - 8, tag, INT64); + __PUT((INT64)(ADDRESS)new - 8, tag, INT64); Heap_Unlock(); return new; } @@ -355,7 +355,7 @@ static void Heap_Mark (INT64 q) __GET(tag, offset, INT64); fld = q + offset; __GET(fld, p, INT64); - __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)n, SYSTEM_PTR); } else { fld = q + offset; __GET(fld, n, INT64); @@ -364,7 +364,7 @@ static void Heap_Mark (INT64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, INT64); __PUT(q - 8, tag + 1, INT64); - __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(ADDRESS)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -379,7 +379,7 @@ static void Heap_Mark (INT64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((INT64)(address)p); + Heap_Mark((INT64)(ADDRESS)p); } static void Heap_Scan (void) @@ -548,7 +548,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -567,7 +567,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(address)n->obj); + (*n->finalize)((SYSTEM_PTR)(ADDRESS)n->obj); } } @@ -584,9 +584,9 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (address)&frame; + sp = (ADDRESS)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (address)&align.p - (address)&align; + inc = (ADDRESS)&align.p - (ADDRESS)&align; if (sp > stack0) { inc = -inc; } @@ -617,7 +617,7 @@ void Heap_GC (BOOLEAN markStack) INT64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(address)Heap_modules; + m = (Heap_Module)(ADDRESS)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -694,7 +694,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (INT64)(address)obj; + f->obj = (INT64)(ADDRESS)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 60993ebe..4b7fe51c 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -215,7 +215,7 @@ static void OPB_SetIntType (OPT_Node node) static void OPB_SetSetType (OPT_Node node) { INT32 i32; - __GET((address)&node->conval->setval + 4, i32, INT32); + __GET((ADDRESS)&node->conval->setval + 4, i32, INT32); if (i32 == 0) { node->typ = OPT_set32typ; } else { diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0ed7bf75..19167eeb 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -13,7 +13,7 @@ static INT16 OPC_indentLevel; static INT8 OPC_hashtab[105]; -static CHAR OPC_keytab[60][9]; +static CHAR OPC_keytab[50][9]; static BOOLEAN OPC_GlbPtrs; static CHAR OPC_BodyNameExt[13]; @@ -187,7 +187,7 @@ void OPC_Ident (OPT_Object obj) OPM_WriteStringVar((void*)obj->name, 256); h = OPC_PerfectHash((void*)obj->name, 256); if (OPC_hashtab[__X(h, 105)] >= 0) { - if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 60)], obj->name) == 0) { + if (__STRCMP(OPC_keytab[__X(OPC_hashtab[__X(h, 105)], 50)], obj->name) == 0) { OPM_Write('_'); } } @@ -1920,7 +1920,7 @@ static void Enter__47 (CHAR *s, LONGINT s__len) __DUP(s, s__len, CHAR); h = OPC_PerfectHash((void*)s, s__len); OPC_hashtab[__X(h, 105)] = *InitKeywords__46_s->n; - __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 60)], 9); + __COPY(s, OPC_keytab[__X(*InitKeywords__46_s->n, 50)], 9); *InitKeywords__46_s->n += 1; __DEL(s); } @@ -1947,15 +1947,6 @@ static void OPC_InitKeywords (void) Enter__47((CHAR*)"UINT32", 7); Enter__47((CHAR*)"UINT64", 7); Enter__47((CHAR*)"UINT8", 6); - Enter__47((CHAR*)"address", 8); - Enter__47((CHAR*)"int16", 6); - Enter__47((CHAR*)"int32", 6); - Enter__47((CHAR*)"int64", 6); - Enter__47((CHAR*)"int8", 5); - Enter__47((CHAR*)"uint16", 7); - Enter__47((CHAR*)"uint32", 7); - Enter__47((CHAR*)"uint64", 7); - Enter__47((CHAR*)"uint8", 6); Enter__47((CHAR*)"asm", 4); Enter__47((CHAR*)"auto", 5); Enter__47((CHAR*)"break", 6); diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 46b6c33e..d343241b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -710,15 +710,15 @@ void OPM_FPrintReal (INT32 *fp, REAL real) { INT16 i; INT32 l; - __GET((address)&real, l, INT32); + __GET((ADDRESS)&real, l, INT32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) { INT32 l, h; - __GET((address)&lr, l, INT32); - __GET((address)&lr + 4, h, INT32); + __GET((ADDRESS)&lr, l, INT32); + __GET((ADDRESS)&lr + 4, h, INT32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ee84e643..ac2e6fba 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -814,7 +814,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -830,7 +830,7 @@ static void OPV_expr (OPT_Node n, INT16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800, 32) || __IN(l->typ->form, 0x1800, 32)) { - OPM_WriteString((CHAR*)"(address)", 10); + OPM_WriteString((CHAR*)"(ADDRESS)", 10); } OPV_expr(l, exprPrec); } else { @@ -1204,7 +1204,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_AddressSize); } else { - OPM_WriteString((CHAR*)"((address)(", 12); + OPM_WriteString((CHAR*)"((ADDRESS)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 03213c6a..ea8636f2 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -27,13 +27,13 @@ export LONGREAL Out_Ten (INT16 e); static void Out_digit (INT64 n, CHAR *s, LONGINT s__len, INT16 *i); static void Out_prepend (CHAR *t, LONGINT t__len, CHAR *s, LONGINT s__len, INT16 *i); -#define Out_Entier64(x) (int64)(x) +#define Out_Entier64(x) (INT64)(x) void Out_Flush (void) { INT16 error; if (Out_in > 0) { - error = Platform_Write(Platform_StdOut, (address)Out_buf, Out_in); + error = Platform_Write(Platform_StdOut, (ADDRESS)Out_buf, Out_in); } Out_in = 0; } @@ -74,9 +74,9 @@ void Out_String (CHAR *str, LONGINT str__len) Out_Flush(); } if (l > 128) { - error = Platform_Write(Platform_StdOut, (address)str, l); + error = Platform_Write(Platform_StdOut, (ADDRESS)str, l); } else { - __MOVE((address)str, (address)&Out_buf[__X(Out_in, 128)], l); + __MOVE((ADDRESS)str, (ADDRESS)&Out_buf[__X(Out_in, 128)], l); Out_in += (INT16)l; } __DEL(str); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c154f33b..2b9fd2c2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -239,7 +239,7 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = __VAL(INT16, argc); - av = (Platform_ArgVecPtr)(address)argvadr; + av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -275,7 +275,7 @@ void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(address)Platform_ArgVector; + av = (Platform_ArgVec)(ADDRESS)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -518,7 +518,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; - result = Platform_readfile(h, (address)b, b__len, &lengthread); + result = Platform_readfile(h, (ADDRESS)b, b__len, &lengthread); if (result == 0) { *n = 0; return Platform_err(); @@ -742,7 +742,7 @@ static void Platform_TestLittleEndian (void) { INT16 i; i = 1; - __GET((address)&i, Platform_LittleEndian, BOOLEAN); + __GET((ADDRESS)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-8}}; diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d6788751..432ce603 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -59,23 +59,23 @@ LONGREAL Reals_TenL (INT16 e) INT16 Reals_Expo (REAL x) { INT16 i; - __GET((address)&x + 2, i, INT16); + __GET((ADDRESS)&x + 2, i, INT16); return __MASK(__ASHR(i, 7), -256); } void Reals_SetExpo (REAL *x, INT16 ex) { CHAR c; - __GET((address)x + 3, c, CHAR); - __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((address)x + 2, c, CHAR); - __PUT((address)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((ADDRESS)x + 3, c, CHAR); + __PUT((ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((ADDRESS)x + 2, c, CHAR); + __PUT((ADDRESS)x + 2, (CHAR)(__MASK((INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INT16 Reals_ExpoL (LONGREAL x) { INT16 i; - __GET((address)&x + 6, i, INT16); + __GET((ADDRESS)&x + 6, i, INT16); return __MASK(__ASHR(i, 4), -2048); } diff --git a/doc/Features.md b/doc/Features.md index 21ab306e..e597732c 100644 --- a/doc/Features.md +++ b/doc/Features.md @@ -111,7 +111,10 @@ Most Oberon systems have implicitly or explicitly assumed that LONGINT is large machine addresses. With the requirement to support 32 bit LONGINT on 64 bit systems, this is no longer possible. -The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 according to the system address size. +The type SYSTEM.ADDRESS is added, a signed integer type equivalent to either SYSTEM.INT32 or SYSTEM.INT64 +according to the system address size. As a general purpose integer type it can be used not just to +store machine addresses, but also for any arithmetic purpose related to machine addresses, such as +lengths of memory objects or offsets into memory objects. The following SYSTEM module predefined functions and procedures now use SYSTEM.ADDRESS instead of LONGINT. diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index 5670546e..a8681e32 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -39,7 +39,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) VAR indentLevel: INTEGER; hashtab: ARRAY 105 OF SHORTINT; - keytab: ARRAY 60 (*50*), 9 OF CHAR; + keytab: ARRAY 50, 9 OF CHAR; GlbPtrs: BOOLEAN; BodyNameExt: ARRAY 13 OF CHAR; @@ -1275,16 +1275,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("UINT64"); (* pseudo keyword used by voc *) Enter("UINT8"); (* pseudo keyword used by voc *) - Enter("address"); (* pseudo keyword used by voc *) - Enter("int16"); (* pseudo keyword used by voc *) - Enter("int32"); (* pseudo keyword used by voc *) - Enter("int64"); (* pseudo keyword used by voc *) - Enter("int8"); (* pseudo keyword used by voc *) - Enter("uint16"); (* pseudo keyword used by voc *) - Enter("uint32"); (* pseudo keyword used by voc *) - Enter("uint64"); (* pseudo keyword used by voc *) - Enter("uint8"); (* pseudo keyword used by voc *) - Enter("asm"); Enter("auto"); Enter("break"); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 318a0847..cd3c649c 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -502,7 +502,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(address)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(ADDRESS)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -515,7 +515,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(address)") + OPM.WriteString("(ADDRESS)") END; expr(l, exprPrec) ELSE @@ -736,7 +736,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.AddressSize) - ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((ADDRESS)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index a8246ace..1daefc0b 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -73,7 +73,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE -IdxTrap "__HALT(-1)"; - PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(address)x"; + PROCEDURE -ToAdr(x: SYSTEM.INT64): SYSTEM.ADDRESS "(ADDRESS)x"; PROCEDURE^ Finalize(o: SYSTEM.PTR); diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index b05b218b..a74b4684 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -162,7 +162,7 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -ExternPlatformOSAllocate "extern ADDRESS Platform_OSAllocate(ADDRESS size);"; PROCEDURE -OSAllocate(size: S.ADDRESS): S.ADDRESS "Platform_OSAllocate(size)"; PROCEDURE NewChunk(blksz: S.ADDRESS): S.ADDRESS; @@ -317,25 +317,25 @@ MODULE Heap; VAR p, tag, offset, fld, n, tagbits: S.ADDRESS; BEGIN IF q # 0 THEN - S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) - IF ~ODD(tagbits) THEN (* If it has not already been marked *) + S.GET(q - SZA, tagbits); (* Load the tag for the record at q *) + IF ~ODD(tagbits) THEN (* If it has not already been marked *) S.PUT(q - SZA, tagbits + 1); (* Mark it *) p := 0; - tag := tagbits + SZA; (* Tag addresses first offset *) + tag := tagbits + SZA; (* Tag addresses first offset *) LOOP S.GET(tag, offset); (* Get next ptr field offset *) - IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) + IF offset < 0 THEN (* Sentinel reached: Value is -8*(#fields+1) *) S.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; n := q; q := p; S.GET(q - SZA, tag); DEC(tag, 1); S.GET(tag, offset); fld := q + offset; S.GET(fld, p); S.PUT(fld, S.VAL(S.PTR, n)) - ELSE (* offset references a ptr field *) - fld := q + offset; (* S.ADDRESS the pointer *) - S.GET(fld, n); (* Load the pointer *) - IF n # 0 THEN (* If pointer is not NIL *) - S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) + ELSE (* offset references a ptr field *) + fld := q + offset; (* S.ADDRESS the pointer *) + S.GET(fld, n); (* Load the pointer *) + IF n # 0 THEN (* If pointer is not NIL *) + S.GET(n - SZA, tagbits); (* Consider record pointed to by this field *) IF ~ODD(tagbits) THEN S.PUT(n - SZA, tagbits + 1); S.PUT(q - SZA, tag + 1); @@ -483,7 +483,7 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -ExternMainStackFrame "extern ADDRESS Platform_MainStackFrame;"; PROCEDURE -PlatformMainStackFrame(): S.ADDRESS "Platform_MainStackFrame"; PROCEDURE MarkStack(n: S.ADDRESS; VAR cand: ARRAY OF S.ADDRESS); diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index c6429527..0dc4ed27 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -93,7 +93,7 @@ BEGIN r := 1.0D0; power := 1.0D1; RETURN r END Ten; -PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(int64)(x)"; +PROCEDURE -Entier64(x: LONGREAL): SYSTEM.INT64 "(INT64)(x)"; PROCEDURE RealP(x: LONGREAL; n: INTEGER; long: BOOLEAN); diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 3ca44012..6f7dc4a0 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -320,7 +320,7 @@ PROCEDURE -structstats "struct stat s"; PROCEDURE -statdev(): LONGINT "(LONGINT)s.st_dev"; PROCEDURE -statino(): LONGINT "(LONGINT)s.st_ino"; PROCEDURE -statmtime(): LONGINT "(LONGINT)s.st_mtime"; -PROCEDURE -statsize(): LONGINT "(address)s.st_size"; +PROCEDURE -statsize(): LONGINT "(ADDRESS)s.st_size"; PROCEDURE Identify*(h: FileHandle; VAR identity: FileIdentity): ErrorCode; BEGIN diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 481cded9..fb88276c 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -86,20 +86,6 @@ typedef void* SYSTEM_PTR; #endif -// Temporary build support - which changing lowercase int* and address to uppercase - -#define int8 INT8 -#define int16 INT16 -#define int32 INT32 -#define int64 INT64 -#define uint8 UINT8 -#define uint16 UINT16 -#define uint32 UINT32 -#define uint64 UINT64 -#define address ADDRESS - - - // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- @@ -179,12 +165,12 @@ static inline int __str_cmp(CHAR *x, CHAR *y){ #define __GET(a, x, t) x=*(t*)(ADDRESS)(a) #define __PUT(a, x, t) *(t*)(ADDRESS)(a)=x -#define __LSHL(x, n, s) ((int##s)((uint##s)(x)<<(n))) -#define __LSHR(x, n, s) ((int##s)((uint##s)(x)>>(n))) +#define __LSHL(x, n, s) ((INT##s)((UINT##s)(x)<<(n))) +#define __LSHR(x, n, s) ((INT##s)((UINT##s)(x)>>(n))) #define __LSH(x, n, s) ((n)>=0? __LSHL(x, n, s): __LSHR(x, -(n), s)) -#define __ROTL(x, n, s) ((int##s)((uint##s)(x)<<(n)|(uint##s)(x)>>(s-(n)))) -#define __ROTR(x, n, s) ((int##s)((uint##s)(x)>>(n)|(uint##s)(x)<<(s-(n)))) +#define __ROTL(x, n, s) ((INT##s)((UINT##s)(x)<<(n)|(UINT##s)(x)>>(s-(n)))) +#define __ROTR(x, n, s) ((INT##s)((UINT##s)(x)>>(n)|(UINT##s)(x)<<(s-(n)))) #define __ROT(x, n, s) ((n)>=0? __ROTL(x, n, s): __ROTR(x, -(n), s)) #define __ASHL(x, n) ((INT64)(x)<<(n)) @@ -222,10 +208,10 @@ static inline double SYSTEM_ABSD(double i) {return i >= 0.0 ? i : -i;} #define __CAP(ch) ((CHAR)((ch)&0x5f)) #define __ODD(x) ((x)&1) -#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) +#define __IN(x, s, size) (((unsigned int)(x))>(x))&1)) // todo tested versions of SETOF and SETRNG: check that x, l and h fit size -#define __SETOF(x, size) ((uint##size)1<<(x)) -#define __SETRNG(l, h, size) ((~(uint##size)0<<(l))&~(uint##size)0>>(size-1-(h))) +#define __SETOF(x, size) ((UINT##size)1<<(x)) +#define __SETRNG(l, h, size) ((~(UINT##size)0<<(l))&~(UINT##size)0>>(size-1-(h))) #define __MASK(x, m) ((x)&~(m)) #define __BIT(x, n) (*(UINT64*)(x)>>(n)&1) diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 695fa0e2..183d1966 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -430,10 +430,10 @@ void writeConfigurationMod() { int main(int argc, char *argv[]) { // Make sure SYSTEM.h has set up our core data types correctly. - assert(sizeof(int8) == 1, "sizeof(int8) is not 1."); - assert(sizeof(int16) == 2, "sizeof(int16) is not 2."); - assert(sizeof(int32) == 4, "sizeof(int32) is not 4."); - assert(sizeof(int64) == 8, "sizeof(int64) is not 8."); + assert(sizeof(INT8) == 1, "sizeof(INT8) is not 1."); + assert(sizeof(INT16) == 2, "sizeof(INT16) is not 2."); + assert(sizeof(INT32) == 4, "sizeof(INT32) is not 4."); + assert(sizeof(INT64) == 8, "sizeof(INT64) is not 8."); oname = getenv("ONAME"); if (!oname) oname = macrotostring(O_NAME); diff --git a/src/tools/make/ignore b/src/tools/make/ignore index 1f2cafbe..42554f00 100644 --- a/src/tools/make/ignore +++ b/src/tools/make/ignore @@ -4,4 +4,4 @@ OPM_ResourceDir __MOVE.* cmd, OPM_(IntSize|PointerSize|Alignment) = Strings_Append.+void\*\)(cmd|OPM_OBERON|extTools_comp) -__COPY\("(gcc|clang|msc|i686-w64-mingw) +__COPY\("(gcc|clang|msc|i686-w64-mingw|x86_64-w64-mingw) From eeb168c0266ccfb4bee4be8de570c2f1e731efaf Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 18:37:15 +0000 Subject: [PATCH 110/140] Support Microsoft C make again following dual library (O2 and OC) support. --- ReadMe.md | 16 +- bootstrap/SYSTEM.h | 3 + bootstrap/unix-44/extTools.c | 1 + bootstrap/unix-48/extTools.c | 1 + bootstrap/unix-88/extTools.c | 1 + bootstrap/windows-48/extTools.c | 1 + bootstrap/windows-88/extTools.c | 1 + make.cmd | 463 ++++++++++++++++++-------------- src/compiler/extTools.Mod | 1 + src/runtime/SYSTEM.h | 3 + src/tools/make/configure.c | 5 +- src/tools/make/oberon.mk | 1 + 12 files changed, 285 insertions(+), 212 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 30d63d60..1330efb6 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,7 +11,7 @@ Oberon programs under Unix, Mac or Windows. Vishap Oberon includes libraries from the Ulm, oo2c and Ofront Oberon compilers, as well as default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. -#### Contents +### Contents     [**Installation**](#installation)
    [**A 'Hello' application**](#a-hello-application)
@@ -30,7 +30,7 @@ default libraries complying with the Oakwood Guidelines for Oberon-2 compilers. While pre-built packages are not provided, it is easy to install the Oberon compiler and libraries with the following simple steps. -###### 1. Install prerequisites +#### 1. Install prerequisites | Platform | Packages | | --------- | ------------ | @@ -42,7 +42,7 @@ with the following simple steps. More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). -###### 2. Build and install the compiler and libraries +#### 2. Build and install the compiler and libraries 1. `git clone https://github.com/vishaps/voc` 2. `cd voc` @@ -50,7 +50,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -###### 3. Stet your PATH environment variable +#### 3. Stet your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. @@ -143,7 +143,7 @@ For details, including how to add support for unrecognised systems, see Vishap Oberon supports the Oberon 2 programming language, including type-bound procedures. SYSTEM.Mod includes additional functionality and some changes for 64 bit support. -##### Integer and set type sizes: +#### Integer and set type sizes: | Type | -O2 option (default) | -OC option | | --- | --- | --- | @@ -152,7 +152,7 @@ Vishap Oberon supports the Oberon 2 programming language, including type-bound p | LONGINT | 32 bit | 64 bit | | SET | 32 bit | 64 bit | -##### Libraries +#### Libraries Included libraries ease porting of code from the major Oberon systems: @@ -186,7 +186,7 @@ David Brown has worked on adding support for more platforms incuding windows usi ## Origin of the name "Ñ´ishap Oberon" -###### Oberon +#### Oberon Oberon is a programming language, an operating system and a graphical user interface. Originally designed and implemented by by Niklaus Wirth and @@ -205,7 +205,7 @@ of Einstein and Antoine de Saint-Exupéry: > when there is no longer anything to take away. (Antoine de Saint-Exupéry, > translated by Lewis Galantière.) -###### Ñ´ishap +#### Ñ´ishap Vishaps are dragons inhabiting the Armenian Highlands. We decided to name the project “Vishap†because ties between compilers and dragons have ancient traditions. diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index fb88276c..3f3b6133 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -26,6 +26,9 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +#if defined _WIN32 +#define alloca _alloca +#endif void *alloca(size_t size); diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 8ed00f14..aa59dd88 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -104,6 +104,7 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023); Strings_Append((CHAR*)"-O", 3, (void*)cmd, 1023); Strings_Append(OPM_Model, 10, (void*)cmd, 1023); + Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023); __DEL(additionalopts); } diff --git a/make.cmd b/make.cmd index 5ff269df..80ab98d4 100644 --- a/make.cmd +++ b/make.cmd @@ -16,7 +16,7 @@ :: Create configuration and parameter files. -cl -nologo -Isrc\system src\tools\make\configure.c >nul +cl -nologo -Isrc\runtime src\tools\make\configure.c >nul setlocal configure.exe >nul del configure.obj configure.exe 2>nul @@ -27,7 +27,8 @@ for /F "delims='=' tokens=1,2" %%a in (Configuration.make) do set %%a=%%b set FLAVOUR=%OS%.%DATAMODEL%.%COMPILER% set BUILDDIR=build\%FLAVOUR% -set VISHAP=%ONAME%%BINEXT% +set OBECOMP=%ONAME%%BINEXT% +set MODEL=2 for /F %%d in ('cd');do set ROOTDIR=%%d @@ -62,11 +63,17 @@ goto :eof :full +whoami /groups | find "12288" >nul +if errorlevel 1 ( +echo make full - administrator rights required. Please run under an administrator command prompt. +goto :eof +) call :clean || exit /b call :compiler || exit /b call :browsercmd || exit /b call :library || exit /b call :install || exit /b +call :showpath || exit /b goto :eof @@ -80,23 +87,9 @@ goto :eof -:library -call :v4 || exit /b -call :ooc2 || exit /b -call :ooc || exit /b -call :ulm || exit /b -call :pow32 || exit /b -call :misc || exit /b -call :s3 || exit /b -call :librarybinary || exit /b -goto :eof - - - - :clean rd /s /q %BUILDDIR% 2>nul -del /q %VISHAP% 2>nul +del /q %OBECOMP% 2>nul goto :eof @@ -111,7 +104,7 @@ echo. PLATFORM: %PLATFORM% echo. OS: %OS% echo. BUILDDIR: %BUILDDIR% echo. Oberon characteristics: -echo. INTSIZE: %INTSIZE% +echo. MODEL: %MODEL% echo. ADRSIZE: %ADRSIZE% echo. ALIGNMENT: %ALIGNMENT% echo. C compiler: @@ -122,19 +115,21 @@ echo. DATAMODEL: %DATAMODEL% cd %BUILDDIR% cl -nologo /Zi -c SYSTEM.c Configuration.c Platform.c Heap.c || exit /b -cl -nologo /Zi -c Console.c Strings.c Modules.c Files.c || exit /b +cl -nologo /Zi -c Out.c Strings.c Modules.c Files.c || exit /b cl -nologo /Zi -c Reals.c Texts.c vt100.c errors.c || exit /b cl -nologo /Zi -c OPM.c extTools.c OPS.c OPT.c || exit /b cl -nologo /Zi -c OPC.c OPV.c OPB.c OPP.c || exit /b -cl -nologo /Zi Vishap.c /Fe%ROOTDIR%\%VISHAP% ^ +cl -nologo /Zi Compiler.c /Fe%ROOTDIR%\%OBECOMP% /link /INCREMENTAL:NO ^ SYSTEM.obj Configuration.obj Platform.obj Heap.obj ^ -Console.obj Strings.obj Modules.obj Files.obj ^ -Reals.obj Texts.obj vt100.obj errors.obj ^ +Out.obj Strings.obj Modules.obj Files.obj ^ +Reals.obj Texts.obj VT100.obj errors.obj ^ OPM.obj extTools.obj OPS.obj OPT.obj ^ OPC.obj OPV.obj OPB.obj OPP.obj || exit /b -echo.%VISHAP% created. +copy src\runtime\*.c %BUILDDIR% >nul +copy src\runtime\*.h %BUILDDIR% >nul +echo.%OBECOMP% created. cd %ROOTDIR% goto :eof @@ -145,7 +140,11 @@ goto :eof echo.Populating clean build directory from bootstrap C sources. mkdir %BUILDDIR% >nul 2>nul copy bootstrap\%PLATFORM%-%ADRSIZE%%ALIGNMENT%\*.* %BUILDDIR% >nul +copy bootstrap\*.c %BUILDDIR% >nul +copy bootstrap\*.h %BUILDDIR% >nul call :assemble || exit /b +copy bootstrap\*.c %BUILDDIR% >nul +copy bootstrap\*.h %BUILDDIR% >nul goto :eof @@ -154,40 +153,39 @@ goto :eof :translate :: Make sure we have an oberon compiler binary: if we built one earlier we'll use it, :: otherwise use one of the saved sets of C sources in the bootstrap directory. -if not exist %VISHAP% call :compilefromsavedsource +if not exist %OBECOMP% call :compilefromsavedsource echo. echo.make translate - translating compiler source: echo. PLATFORM: %PLATFORM% -echo. INTSIZE: %INTSIZE% +echo. MODEL: %MODEL% echo. ADRSIZE: %ADRSIZE% echo. ALIGNMENT: %ALIGNMENT% md %BUILDDIR% 2>nul cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../Configuration.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Platform%PLATFORM%.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsapx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Heap.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Console.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Strings.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Modules.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/system/Files.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Reals.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/v4/Texts.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/library/misc/vt100.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/errors.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPM.cmdln.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/extTools.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFsx -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPS.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPT.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPC.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPV.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPB.Mod || exit /b -%ROOTDIR%\%VISHAP% -SFs -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/OPP.Mod || exit /b -%ROOTDIR%\%VISHAP% -Ssm -B%INTSIZE%%ADRSIZE%%ALIGNMENT% ../../src/compiler/Vishap.Mod || exit /b +del *.sym >nul 2>nul +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../Configuration.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Platform%PLATFORM%.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFapx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Heap.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Strings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Out.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Modules.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Files.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Reals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/Texts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/runtime/VT100.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/errors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPM.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/extTools.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfFx -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPS.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPT.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPC.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPV.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPB.Mod || exit /b +%ROOTDIR%\%OBECOMP% -SsfF -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/OPP.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ssfm -A%ADRSIZE%%ALIGNMENT% -O%MODEL% ../../src/compiler/Compiler.Mod || exit /b cd %ROOTDIR% -copy src\system\*.c %BUILDDIR% >nul -copy src\system\*.h %BUILDDIR% >nul echo.%BUILDDIR% filled with compiler C source. goto :eof @@ -198,10 +196,10 @@ goto :eof echo. echo.Making symbol browser cd %BUILDDIR% -%ROOTDIR%/%VISHAP% -Sm ../../src/tools/browser/BrowserCmd.Mod +%ROOTDIR%/%OBECOMP% -fSm ../../src/tools/browser/BrowserCmd.Mod cl -nologo BrowserCmd.c /Feshowdef.exe ^ - Platform.obj Texts.obj OPT.obj Heap.obj Console.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ - Files.obj Reals.obj Modules.obj vt100.obj errors.obj Configuration.obj Strings.obj ^ + Platform.obj Texts.obj OPT.obj Heap.obj Out.obj SYSTEM.obj OPM.obj OPS.obj OPV.obj ^ + Files.obj Reals.obj Modules.obj VT100.obj errors.obj Configuration.obj Strings.obj ^ OPC.obj cd %ROOTDIR% goto :eof @@ -215,19 +213,28 @@ if errorlevel 1 ( echo make install - administrator rights required. Please run under an administrator command prompt. goto :eof ) -rmdir /s /q "%INSTALLDIR%" >nul 2>&1 -mkdir "%INSTALLDIR%" >nul 2>&1 -mkdir "%INSTALLDIR%\bin" >nul 2>&1 -mkdir "%INSTALLDIR%\include" >nul 2>&1 -mkdir "%INSTALLDIR%\sym" >nul 2>&1 -mkdir "%INSTALLDIR%\lib" >nul 2>&1 -copy %BUILDDIR%\*.h "%INSTALLDIR%\include" >nul -copy %BUILDDIR%\*.sym "%INSTALLDIR%\sym" >nul -copy %VISHAP% "%INSTALLDIR%\bin" >nul -copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul -copy %BUILDDIR%\lib%ONAME%.lib "%INSTALLDIR%\lib" >nul -echo. -echo.Now add "%INSTALLDIR%\bin" to your path. +rmdir /s /q "%INSTALLDIR%" >nul 2>&1 +mkdir "%INSTALLDIR%" >nul 2>&1 + +mkdir "%INSTALLDIR%\bin" >nul 2>&1 +copy %OBECOMP% "%INSTALLDIR%\bin" >nul +copy %BUILDDIR%\showdef.exe "%INSTALLDIR%\bin" >nul + +mkdir "%INSTALLDIR%\2" >nul 2>&1 +mkdir "%INSTALLDIR%\2\include" >nul 2>&1 +mkdir "%INSTALLDIR%\2\sym" >nul 2>&1 +copy %BUILDDIR%\2\*.h "%INSTALLDIR%\2\include" >nul +copy %BUILDDIR%\2\*.sym "%INSTALLDIR%\2\sym" >nul + +mkdir "%INSTALLDIR%\C" >nul 2>&1 +mkdir "%INSTALLDIR%\C\include" >nul 2>&1 +mkdir "%INSTALLDIR%\C\sym" >nul 2>&1 +copy %BUILDDIR%\C\*.h "%INSTALLDIR%\C\include" >nul +copy %BUILDDIR%\C\*.sym "%INSTALLDIR%\C\sym" >nul + +mkdir "%INSTALLDIR%\lib" >nul 2>&1 +copy %BUILDDIR%\2\lib%ONAME%* "%INSTALLDIR%\lib" >nul +copy %BUILDDIR%\C\lib%ONAME%* "%INSTALLDIR%\lib" >nul goto :eof @@ -241,65 +248,93 @@ rmdir /s /q "%INSTALLDIR%" >nul 2>&1 goto :eof +:showpath +echo. +echo Now add %INSTALLDIR%\bin to your path, for example with the command: +echo PATH %INSTALLDIR%\bin;%%PATH%% +echo. +goto :eof + + +:runtime +echo. +echo.Making runtime library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Platform%PLATFORM%.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Heap.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Modules.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Strings.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Out.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/In.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/VT100.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Files.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Math.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/MathL.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Reals.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Texts.Mod +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/runtime/Oberon.Mod +cd %ROOTDIR% +goto :eof :v4 echo. -echo.Making V4 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Args.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Printer.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/v4/Sets.Mod || exit /b +echo.Making V4 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Args.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Console.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Printer.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/v4/Sets.Mod || exit /b cd %ROOTDIR% goto :eof :ooc2 -echo.Making ooc2 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Strings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Ascii.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2CharClass.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2ConvTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2IntStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc2/ooc2Real0.Mod || exit /b +echo.Making ooc2 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Strings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Ascii.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2CharClass.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2ConvTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2IntConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2IntStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc2/ooc2Real0.Mod || exit /b cd %ROOTDIR% goto :eof :ooc -echo.Making ooc library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowReal.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLowLReal.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocOakMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLongInts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocComplexMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLComplexMath.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocAscii.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocCharClass.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocConvTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocLRealStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRealStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntConv.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocIntStr.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocMsg.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocSysClock.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTime.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocChannel.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocStrings2.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocRts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocTextRider.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocBinaryRider.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocJulianDay.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocFilenames.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocwrapperlibc.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ooc/oocC%DATAMODEL%.Mod || exit /b +echo.Making ooc library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLowReal.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLowLReal.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocOakMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLongInts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocComplexMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLComplexMath.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocAscii.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocCharClass.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocConvTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocLRealStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRealStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocIntConv.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocIntStr.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocMsg.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocSysClock.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocTime.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocChannel.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocStrings2.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocRts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocTextRider.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocBinaryRider.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocJulianDay.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocFilenames.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocwrapperlibc.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ooc/oocC%DATAMODEL%.Mod || exit /b cd %ROOTDIR% goto :eof @@ -308,117 +343,138 @@ echo No X11 support on plain Windows - use cygwin and build with cygwin make. goto :eof :ulm -echo.Making ulm library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmObjects.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPriorities.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmServices.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSys.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSYSTEM.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmEvents.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmProcess.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmResources.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmForwarders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRelatedEvents.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreams.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysTypes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTexts.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysConversions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmErrors.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysErrors.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysStat.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmASCII.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSets.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAssertions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIndirectDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIEEE.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmMC68881.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmReals.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPrint.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmWrite.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConstStrings.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPlotters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmSysIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmLoader.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmNetIO.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentObjects.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmPersistentDisciplines.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmOperations.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmScales.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimes.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmClocks.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmStreamConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTimeConditions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmCipherOps.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmBlockCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmAsymmetricCiphers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmConclusions.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmRandomGenerators.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmTCrypt.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/ulm/ulmIntOperations.Mod || exit /b +echo.Making ulm library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmObjects.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPriorities.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmServices.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSys.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSYSTEM.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmEvents.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmProcess.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmResources.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmForwarders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmRelatedEvents.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreams.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysTypes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTexts.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysConversions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmErrors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysErrors.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysStat.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmASCII.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSets.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmAssertions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIndirectDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreamDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIEEE.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmMC68881.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmReals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPrint.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmWrite.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConstStrings.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPlotters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmSysIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmLoader.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmNetIO.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPersistentObjects.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmPersistentDisciplines.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmOperations.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmScales.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimes.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmClocks.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmStreamConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTimeConditions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmCipherOps.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmBlockCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmAsymmetricCiphers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmConclusions.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmRandomGenerators.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmTCrypt.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/ulm/ulmIntOperations.Mod || exit /b cd %ROOTDIR% goto :eof :pow32 -echo.Making pow32 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/pow/powStrings.Mod || exit /b +echo.Making pow32 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/pow/powStrings.Mod || exit /b cd %ROOTDIR% goto :eof :misc -echo.Making misc library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/system/Oberon.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/crt.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/Listen.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MersenneTwister.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrays.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/misc/MultiArrayRiders.Mod || exit /b +echo.Making misc library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/crt.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/Listen.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MersenneTwister.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MultiArrays.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/misc/MultiArrayRiders.Mod || exit /b cd %ROOTDIR% goto :eof :s3 -echo.Making s3 library -cd %BUILDDIR% -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethBTrees.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethMD5.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethSets.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlib.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibBuffers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibInflate.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibDeflate.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibReaders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZlibWriters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethZip.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethRandomNumbers.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZReaders.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethGZWriters.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethUnicode.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethDates.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethReals.Mod || exit /b -%ROOTDIR%\%VISHAP% -Fs ../../src/library/s3/ethStrings.Mod || exit /b +echo.Making s3 library for -O%MODEL% +cd %BUILDDIR%\%MODEL% +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethBTrees.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethMD5.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethSets.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlib.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibBuffers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibInflate.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibDeflate.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibReaders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZlibWriters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethZip.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethRandomNumbers.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethGZReaders.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethGZWriters.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethUnicode.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethDates.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethReals.Mod || exit /b +%ROOTDIR%\%OBECOMP% -Ffs -O%MODEL% ../../../src/library/s3/ethStrings.Mod || exit /b cd %ROOTDIR% goto :eof -:librarybinary -echo. -echo.Making lib%ONAME% -:: Remove objects that should not be part of the library -del /q %BUILDDIR%\Vishap.obj -:: Make static library -lib -nologo %BUILDDIR%\*.obj -out:%BUILDDIR%\lib%ONAME%.lib || exit /b +:initlibrary +del /s /q %BUILDDIR%\%MODEL% >nul 2>nul +mkdir %BUILDDIR% >nul 2>nul +mkdir %BUILDDIR%\%MODEL% >nul 2>nul +copy src\runtime\*.c %BUILDDIR%\%MODEL% >nul +copy src\runtime\*.h %BUILDDIR%\%MODEL% >nul +cd %BUILDDIR%\%MODEL% +cl -nologo -c SYSTEM.c +cd %ROOTDIR% +goto :eof + + +:library +SET MODEL=2 +call :initlibrary || exit /b +call :runtime || exit /b +call :v4 || exit /b +call :ooc2 || exit /b +call :ooc || exit /b +call :ulm || exit /b +call :pow32 || exit /b +call :misc || exit /b +call :s3 || exit /b +lib -nologo %BUILDDIR%\%MODEL%\*.obj -out:%BUILDDIR%\%MODEL%\lib%ONAME%-O%MODEL%.lib || exit /b + +SET MODEL=C +call :initlibrary || exit /b +call :runtime || exit /b +lib -nologo %BUILDDIR%\%MODEL%\*.obj -out:%BUILDDIR%\%MODEL%\lib%ONAME%-O%MODEL%.lib || exit /b goto :eof @@ -427,3 +483,4 @@ goto :eof + diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 062e8014..8c84ecae 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -72,6 +72,7 @@ PROCEDURE LinkMain*(VAR moduleName: ARRAY OF CHAR; statically: BOOLEAN; addition Strings.Append(Configuration.libspec, cmd); Strings.Append('-O', cmd); Strings.Append(OPM.Model, cmd); + Strings.Append(Configuration.libext, cmd); execute("Assemble and link: ", cmd); END LinkMain; diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index fb88276c..3f3b6133 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -26,6 +26,9 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); +#if defined _WIN32 +#define alloca _alloca +#endif void *alloca(size_t size); diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 183d1966..13ea087a 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -54,6 +54,7 @@ char *version = macrotostring(O_VER); char *objext = ".o"; char *objflag = " -o "; char *linkflags = " -L\""; +char *libext = ""; char *oname = NULL; // From O_NAME env var if present, or O_NAME macro otherwise. @@ -154,7 +155,8 @@ void determineCCompiler() { objext = ".obj"; objflag = " -Fe"; linkflags = " -link -libpath:\""; - snprintf(libspec, sizeof(libspec), " lib%s.lib", oname); + snprintf(libspec, sizeof(libspec), " lib%s", oname); + libext = ".lib"; #else fail("Unrecognised C compiler."); #endif @@ -412,6 +414,7 @@ void writeConfigurationMod() { fprintf(fd, " objflag* = '%s';\n", objflag); fprintf(fd, " linkflags* = '%s';\n", linkflags); fprintf(fd, " libspec* = '%s';\n", libspec); + fprintf(fd, " libext* = '%s';\n", libext); fprintf(fd, " compile* = '%s';\n", cc); fprintf(fd, " installdir* = '%s';\n", installdir); fprintf(fd, " staticLink* = '%s';\n", staticlink); diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index c67dfe10..e5fde295 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -254,6 +254,7 @@ ooc: cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod From 1d6c7889b10a1c3681e718f4c2eb0eba013a7a19 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 20:18:14 +0000 Subject: [PATCH 111/140] Use _alloca /only/ on MSC, not on mingw. Elsewhere it is alloca. --- src/runtime/SYSTEM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index 3f3b6133..d9778393 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -26,7 +26,7 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); -#if defined _WIN32 +#if defined _MSC_VER #define alloca _alloca #endif void *alloca(size_t size); From c2e97de49586c993498ebd5883d37a98917a9097 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 8 Nov 2016 20:42:36 +0000 Subject: [PATCH 112/140] Update bootstrap. --- bootstrap/SYSTEM.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index 3f3b6133..d9778393 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -26,7 +26,7 @@ #define _SIZE_T_DEFINED_ // For OpenBSD void *memcpy(void *dest, const void *source, size_t size); -#if defined _WIN32 +#if defined _MSC_VER #define alloca _alloca #endif void *alloca(size_t size); From c93705920e0452e7024bde6e774ef112c13bca9f Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:22:23 +0000 Subject: [PATCH 113/140] Remove redundant sync that causes error on windows. Update console for Windows cr/lf. --- src/library/v4/Console.Mod | 9 +++++++-- src/runtime/Files.Mod | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/library/v4/Console.Mod b/src/library/v4/Console.Mod index 6b35a090..070ba46b 100644 --- a/src/library/v4/Console.Mod +++ b/src/library/v4/Console.Mod @@ -46,7 +46,7 @@ MODULE Console; (* J. Templ, 29-June-96 *) END Int; PROCEDURE Ln*; - BEGIN Char(0AX); (* Unix end-of-line *) + BEGIN String(Platform.NL); END Ln; PROCEDURE Bool*(b: BOOLEAN); @@ -75,7 +75,12 @@ MODULE Console; (* J. Templ, 29-June-96 *) VAR i: LONGINT; ch: CHAR; BEGIN Flush(); i := 0; Read(ch); - WHILE (i < LEN(line) - 1) & (ch # 0AX) & (ch # 0X) DO line[i] := ch; INC(i); Read(ch) END ; + WHILE (i < LEN(line) - 1) + & (ch # 0AX) + & (ch # 0X) DO + line[i] := ch; INC(i); Read(ch) + END; + IF (i > 0) & (line[i-1] = 0DX) THEN DEC(i) END; (* Swallow CR before LF *) line[i] := 0X END ReadLine; diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 1daefc0b..40307644 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -215,8 +215,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + (* There's no reason to sync this file - we're about to close it. The OS + will sync if necessary. Further, sync will fail for a R/O file on Windows. error := Platform.Sync(f.fd); - IF error # 0 THEN Err("error writing file", f, error) END; + IF error # 0 THEN Err("error syncing file", f, error) END; + *) CloseOSFile(f); END END Close; From 45d3daa11edcf69da9c01558f5e6e38cfa58677c Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:56:35 +0000 Subject: [PATCH 114/140] Windows: enable VT100 support and use SYSTEM.ADDRESS for FileHandle. --- src/runtime/Platformwindows.Mod | 64 +++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 1ef34d49..9bf36594 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -12,7 +12,7 @@ TYPE SignalHandler = PROCEDURE(signal: SYSTEM.INT32); ErrorCode* = INTEGER; - FileHandle* = LONGINT; + FileHandle* = SYSTEM.ADDRESS; FileIdentity* = RECORD volume: LONGINT; (* dev on Unix filesystems, volume serial number on NTFS *) @@ -297,16 +297,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): SYSTEM.ADDRESS "((ADDRESS)INVALID_HANDLE_VALUE)"; -PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -openrw (n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; -PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -openro (n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; -PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +PROCEDURE -opennew(n: ARRAY OF CHAR): FileHandle +"(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -314,21 +314,21 @@ PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT (* File APIs *) PROCEDURE OldRO*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := openro(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; END OldRO; PROCEDURE OldRW*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := openrw(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; END OldRW; PROCEDURE New*(VAR n: ARRAY OF CHAR; VAR h: FileHandle): ErrorCode; -VAR fd: LONGINT; +VAR fd: FileHandle; BEGIN fd := opennew(n); IF (fd = invalidHandleValue()) THEN RETURN err() ELSE h := fd; RETURN 0 END; @@ -336,7 +336,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(ADDRESS)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -346,7 +346,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -405,7 +405,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -416,8 +416,8 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER -"(INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: LONGINT): ErrorCode; VAR result: INTEGER; lengthread: SYSTEM.INT32; @@ -435,8 +435,8 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; BEGIN @@ -445,7 +445,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -455,7 +455,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -471,9 +471,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -531,8 +531,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -587,6 +587,14 @@ PROCEDURE SetHalt*(p: HaltProcedure); BEGIN HaltHandler := p; END SetHalt; +PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, m)"; +PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, m)"; +PROCEDURE -VTprocessing(): SYSTEM.INT32 "ENABLE_VIRTUAL_TERMINAL_PROCESSING"; + +PROCEDURE EnableVT100; +VAR mode: SYSTEM.INT32; +BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing()) END +END EnableVT100; PROCEDURE TestLittleEndian; @@ -594,9 +602,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(ADDRESS)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(ADDRESS)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN @@ -616,6 +624,8 @@ BEGIN StdOut := getstdouthandle(); StdErr := getstderrhandle(); + EnableVT100; + NL[0] := 0DX; (* CR *) NL[1] := 0AX; (* LF *) NL[2] := 0X; From 2cd28725ea8eb987a306bef21b0917debf96bb3a Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 11:57:59 +0000 Subject: [PATCH 115/140] Update bootstrap --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 6 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 6 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 6 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 6 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 51 ++++++++----- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 14 ++-- bootstrap/windows-88/Files.h | 9 +-- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 109 +++++++++++++++------------ bootstrap/windows-88/Platform.h | 28 +++---- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 195 files changed, 312 insertions(+), 305 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fc49744a..b6483b0d 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 93b5757c..1b94c84f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 37631f98..49df34bf 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 343fb141..c90c4c43 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index ff45e732..bff09b6b 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 92b17de0..7891a3ab 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 19f2a2f5..b8f6a762 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fc49744a..b6483b0d 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 93b5757c..1b94c84f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 3340bb93..8d2305be 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 343fb141..c90c4c43 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index ff45e732..bff09b6b 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index ac0a3850..abf1736a 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index f2c8d90e..dd1e65e5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 2572b5cd..53e757cf 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 47c54d97..7c86bc8b 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index efbba685..65151d07 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 0b6a9d03..d37b81db 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 39e2d6ca..56f6f73e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index d343241b..6cd0dab4 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 3eabde0b..4a47eb31 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index e1405ce9..51464c2f 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index ac2e6fba..4eaacd0b 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index c435c944..27e1fa94 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index a685b291..79895677 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index c75a6d63..9682a16f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 2da07523..84628711 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3b932ce7..38bcde69 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index bff9cc72..6ef483f3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 5f08fc35..8f9d4784 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -307,10 +307,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index a0965363..c939154b 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e8c720bb..8ab8db36 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index dbc3fcd7..a7926fd5 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index d8293ed7..20b68450 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9b4663f5..2f163525 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 45f4db77..a8a90bfc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 3340bb93..8d2305be 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index f40a6104..c90bb72a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index ea8636f2..bad87929 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index a685b291..79895677 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index baa90502..7b5d8c73 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -56,6 +56,7 @@ export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_DisplayHaltCode (INT32 code); +static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT16 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); @@ -118,10 +119,13 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -130,44 +134,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +186,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -738,6 +742,14 @@ void Platform_SetHalt (Platform_HaltProcedure p) Platform_HaltHandler = p; } +static void Platform_EnableVT100 (void) +{ + INT32 mode; + if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { + Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + } +} + static void Platform_TestLittleEndian (void) { INT16 i; @@ -767,6 +779,7 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); + Platform_EnableVT100(); Platform_NL[0] = 0x0d; Platform_NL[1] = 0x0a; Platform_NL[2] = 0x00; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 27a42a84..d6c32fa3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index ac0a3850..abf1736a 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index f2c8d90e..dd1e65e5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 86c4c1fd..5635eb49 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 3f8c68d8..88e7a4c9 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 6abf2414..20f55dce 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 28c9e997..683c021e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,8 @@ typedef Files_FileName workName, registerName; BOOLEAN tempFile; Platform_FileIdentity identity; - INT32 fd, len, pos; + INT64 fd; + INT32 len, pos; Files_Buffer bufs[4]; INT16 swapper, state; Files_File next; @@ -307,10 +308,6 @@ void Files_Close (Files_File f) Files_Flush(f->bufs[i]); i += 1; } - error = Platform_Sync(f->fd); - if (error != 0) { - Files_Err((CHAR*)"error writing file", 19, f, error); - } Files_CloseOSFile(f); } } @@ -422,7 +419,7 @@ static Files_File Files_CacheEntry (Platform_FileIdentity identity) Files_File Files_Old (CHAR *name, LONGINT name__len) { Files_File f = NIL; - INT32 fd; + INT64 fd; INT16 pos; BOOLEAN done; CHAR dir[256], path[256]; @@ -726,7 +723,8 @@ void Files_Delete (CHAR *name, LONGINT name__len, INT16 *res) void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT16 *res) { - INT32 fdold, fdnew, n; + INT64 fdold, fdnew; + INT32 n; INT16 error, ignore; Platform_FileIdentity oldidentity, newidentity; CHAR buf[4096]; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 4d65d916..2bc98b79 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h @@ -10,10 +10,9 @@ typedef typedef struct Files_FileDesc { - INT64 _prvt0; - char _prvt1[216]; - INT32 fd; - char _prvt2[60]; + char _prvt0[224]; + INT64 fd; + char _prvt1[56]; } Files_FileDesc; typedef diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index efbba685..65151d07 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 0b6a9d03..d37b81db 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 39e2d6ca..56f6f73e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index c2afbd3c..de306cf5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 4b7fe51c..d272b474 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index bc644f4c..880670eb 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 19167eeb..1dba2168 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index f7fc51f9..a6816fe2 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index d343241b..6cd0dab4 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 42866571..d828881d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 3eabde0b..4a47eb31 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index cb3aabc8..806302cb 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 5d7b776f..6cb1973e 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 01ffbd17..04a8a785 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index e1405ce9..51464c2f 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 66f25d3d..b01bfedc 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index ac2e6fba..4eaacd0b 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 513d8dfa..ae75cd60 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index ea8636f2..bad87929 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index a685b291..79895677 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 2b9fd2c2..05db7a71 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -41,7 +41,7 @@ export INT64 Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static INT32 Platform_TimeStart; export INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -export INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +export INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; static Platform_SignalHandler Platform_InterruptHandler; export CHAR Platform_NL[3]; @@ -51,11 +51,12 @@ export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); -export INT16 Platform_Close (INT32 h); +export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); static void Platform_DisplayHaltCode (INT32 code); +static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); export void Platform_Exit (INT16 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); @@ -64,37 +65,37 @@ export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); export void Platform_Halt (INT32 code); -export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +export INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); export INT64 Platform_OSAllocate (INT64 size); export void Platform_OSFree (INT64 address); -export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); -export INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -export INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +export INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +export INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); +export INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); export INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); +export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); -export INT16 Platform_Size (INT32 h, INT32 *l); -export INT16 Platform_Sync (INT32 h); +export INT16 Platform_Size (INT64 h, INT32 *l); +export INT16 Platform_Sync (INT64 h); export INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); static void Platform_TestLittleEndian (void); export INT32 Platform_Time (void); export BOOLEAN Platform_TimedOut (INT16 e); export BOOLEAN Platform_TooManyFiles (INT16 e); -export INT16 Platform_Truncate (INT32 h, INT32 limit); +export INT16 Platform_Truncate (INT64 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); -export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +export INT16 Platform_Write (INT64 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); static void Platform_errch (CHAR c); static void Platform_errint (INT32 l); @@ -118,10 +119,13 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) +#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -130,44 +134,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(ADDRESS)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(ADDRESS)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(ADDRESS)h) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) #define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(ADDRESS)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(ADDRESS)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (LONGINT)(ADDRESS)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (LONGINT)(ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (ADDRESS)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (ADDRESS)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (ADDRESS)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(ADDRESS)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((ADDRESS)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (ADDRESS)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)(ADDRESS)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(ADDRESS)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(ADDRESS)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -182,7 +186,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(ADDRESS)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -387,9 +391,9 @@ INT16 Platform_Error (void) return Platform_err(); } -INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_openro(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -400,9 +404,9 @@ INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_openrw(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -413,9 +417,9 @@ INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) +INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h) { - INT32 fd; + INT64 fd; fd = Platform_opennew(n, n__len); if (fd == Platform_invalidHandleValue()) { return Platform_err(); @@ -426,7 +430,7 @@ INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h) __RETCHK; } -INT16 Platform_Close (INT32 h) +INT16 Platform_Close (INT64 h) { if (Platform_closeHandle(h) == 0) { return Platform_err(); @@ -436,7 +440,7 @@ INT16 Platform_Close (INT32 h) __RETCHK; } -INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) +INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_byHandleFileInformation(); if (Platform_getFileInformationByHandle(h) == 0) { @@ -452,7 +456,7 @@ INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *iden INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ) { - INT32 h; + INT64 h; INT16 e, i; __DUP(n, n__len, CHAR); e = Platform_OldRO((void*)n, n__len, &h); @@ -489,7 +493,7 @@ void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d) Platform_YMDHMStoClock(Platform_styear(), Platform_stmon(), Platform_stmday(), Platform_sthour(), Platform_stmin(), Platform_stsec(), &*t, &*d); } -INT16 Platform_Size (INT32 h, INT32 *l) +INT16 Platform_Size (INT64 h, INT32 *l) { Platform_largeInteger(); if (Platform_getFileSize(h) == 0) { @@ -499,7 +503,7 @@ INT16 Platform_Size (INT32 h, INT32 *l) return 0; } -INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) +INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n) { INT16 result; INT32 lengthread; @@ -514,7 +518,7 @@ INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n) __RETCHK; } -INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) +INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) { INT16 result; INT32 lengthread; @@ -529,7 +533,7 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) __RETCHK; } -INT16 Platform_Write (INT32 h, INT64 p, INT32 l) +INT16 Platform_Write (INT64 h, INT64 p, INT32 l) { if (Platform_writefile(h, p, l) == 0) { return Platform_err(); @@ -539,7 +543,7 @@ INT16 Platform_Write (INT32 h, INT64 p, INT32 l) __RETCHK; } -INT16 Platform_Sync (INT32 h) +INT16 Platform_Sync (INT64 h) { if (Platform_flushFileBuffers(h) == 0) { return Platform_err(); @@ -549,7 +553,7 @@ INT16 Platform_Sync (INT32 h) __RETCHK; } -INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) +INT16 Platform_Seek (INT64 h, INT32 o, INT16 r) { INT16 rc; Platform_largeInteger(); @@ -562,7 +566,7 @@ INT16 Platform_Seek (INT32 h, INT32 o, INT16 r) __RETCHK; } -INT16 Platform_Truncate (INT32 h, INT32 limit) +INT16 Platform_Truncate (INT64 h, INT32 limit) { INT16 rc; INT32 oldpos; @@ -738,6 +742,14 @@ void Platform_SetHalt (Platform_HaltProcedure p) Platform_HaltHandler = p; } +static void Platform_EnableVT100 (void) +{ + INT32 mode; + if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { + Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + } +} + static void Platform_TestLittleEndian (void) { INT16 i; @@ -767,6 +779,7 @@ export void *Platform__init(void) Platform_StdIn = Platform_getstdinhandle(); Platform_StdOut = Platform_getstdouthandle(); Platform_StdErr = Platform_getstderrhandle(); + Platform_EnableVT100(); Platform_NL[0] = 0x0d; Platform_NL[1] = 0x0a; Platform_NL[2] = 0x00; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e67b2ca0..e2e65585 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -26,7 +26,7 @@ import CHAR Platform_CWD[4096]; import INT16 Platform_ArgCount; import INT64 Platform_ArgVector; import INT16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; -import INT32 Platform_StdIn, Platform_StdOut, Platform_StdErr; +import INT64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_NL[3]; import ADDRESS *Platform_FileIdentity__typ; @@ -35,7 +35,7 @@ import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); -import INT16 Platform_Close (INT32 h); +import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); @@ -47,36 +47,36 @@ import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); import void Platform_Halt (INT32 code); -import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); +import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); -import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); +import INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); import INT64 Platform_OSAllocate (INT64 size); import void Platform_OSFree (INT64 address); -import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT32 *h); -import INT16 Platform_Read (INT32 h, INT64 p, INT32 l, INT32 *n); -import INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); +import INT16 Platform_OldRO (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_OldRW (CHAR *n, LONGINT n__len, INT64 *h); +import INT16 Platform_Read (INT64 h, INT64 p, INT32 l, INT32 *n); +import INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n); import INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); -import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); +import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); -import INT16 Platform_Size (INT32 h, INT32 *l); -import INT16 Platform_Sync (INT32 h); +import INT16 Platform_Size (INT64 h, INT32 *l); +import INT16 Platform_Sync (INT64 h); import INT16 Platform_System (CHAR *cmd, LONGINT cmd__len); import INT32 Platform_Time (void); import BOOLEAN Platform_TimedOut (INT16 e); import BOOLEAN Platform_TooManyFiles (INT16 e); -import INT16 Platform_Truncate (INT32 h, INT32 limit); +import INT16 Platform_Truncate (INT64 h, INT32 limit); import INT16 Platform_Unlink (CHAR *n, LONGINT n__len); -import INT16 Platform_Write (INT32 h, INT64 p, INT32 l); +import INT16 Platform_Write (INT64 h, INT64 p, INT32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 432ce603..37ba21bb 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 07688e3c..94d22e76 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 141a9976..17fe28a6 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 4319e8c8..6d2e8625 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3b932ce7..38bcde69 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index bff9cc72..6ef483f3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index b5067d33..6a492f2a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index d9aa6ab7..54e1e753 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2a1a7a02..651501a0 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 5555899e..bd6765aa 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index aa59dd88..23b737c3 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index ad76f7b6..124b2154 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/08]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h From 9f5d4c6b0d551ad8b13a84821e2bd9e8c78bbb41 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 12:52:23 +0000 Subject: [PATCH 116/140] Fix mingw where ENABLE_VIRTUAL_TERMINAL_PROCESSING is undefined. --- bootstrap/windows-48/Platform.c | 7 +++---- bootstrap/windows-88/Platform.c | 7 +++---- src/runtime/Platformwindows.Mod | 8 ++++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 7b5d8c73..4a8c3cc0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) -#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void) { INT32 mode; if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { - Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + Platform_SetConsoleMode(Platform_StdOut, mode + 4); } } diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 05db7a71..c0d60542 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -119,13 +119,12 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_ERRORWRITEPROTECT() ERROR_WRITE_PROTECT #define Platform_ETIMEDOUT() WSAETIMEDOUT extern void Heap_InitHeap(); -#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, m) +#define Platform_GetConsoleMode(h, m) GetConsoleMode((HANDLE)h, (DWORD*)m) #define Platform_GetTickCount() (LONGINT)(UINT32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, m) +#define Platform_SetConsoleMode(h, m) SetConsoleMode((HANDLE)h, (DWORD)m) #define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((ADDRESS)h) #define Platform_SetQuitHandler(h) SystemSetQuitHandler((ADDRESS)h) -#define Platform_VTprocessing() ENABLE_VIRTUAL_TERMINAL_PROCESSING #define Platform_allocate(size) (ADDRESS)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow @@ -746,7 +745,7 @@ static void Platform_EnableVT100 (void) { INT32 mode; if (Platform_GetConsoleMode(Platform_StdOut, &mode)) { - Platform_SetConsoleMode(Platform_StdOut, mode + Platform_VTprocessing()); + Platform_SetConsoleMode(Platform_StdOut, mode + 4); } } diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 9bf36594..a52ae92c 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -587,13 +587,13 @@ PROCEDURE SetHalt*(p: HaltProcedure); BEGIN HaltHandler := p; END SetHalt; -PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, m)"; -PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, m)"; -PROCEDURE -VTprocessing(): SYSTEM.INT32 "ENABLE_VIRTUAL_TERMINAL_PROCESSING"; +PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, (DWORD*)m)"; +PROCEDURE -SetConsoleMode(h: FileHandle; m: SYSTEM.INT32) "SetConsoleMode((HANDLE)h, (DWORD)m)"; PROCEDURE EnableVT100; +CONST VTprocessing = 4; (* ENABLE_VIRTUAL_TERMINAL_PROCESSING: value specified by MSDN *) VAR mode: SYSTEM.INT32; -BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing()) END +BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing) END END EnableVT100; From ef815aa1315db544bd5e7e0cd958870600197943 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 10 Nov 2016 18:54:40 +0000 Subject: [PATCH 117/140] Add version to symbol files to avoid confusing symptoms from format changes. --- bootstrap/unix-44/OPM.c | 8 +++++--- bootstrap/unix-48/OPM.c | 8 +++++--- bootstrap/unix-88/OPM.c | 8 +++++--- bootstrap/windows-48/OPM.c | 8 +++++--- bootstrap/windows-88/OPM.c | 8 +++++--- make.cmd | 3 ++- src/compiler/OPM.Mod | 10 ++++++---- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 6cd0dab4..e077a852 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 2f163525..4924854d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 6cd0dab4..e077a852 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -764,15 +764,16 @@ void OPM_CloseOldSym (void) void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done) { - CHAR ch; + CHAR tag, ver; OPM_FileName fileName; OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5); OPM_oldSFile = Files_Old(fileName, 32); *done = OPM_oldSFile != NIL; if (*done) { Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0); - Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch); - if (ch != 0xf7) { + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&tag); + Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ver); + if (tag != 0xf7 || ver != 0x82) { OPM_err(-306); OPM_CloseOldSym(); *done = 0; @@ -829,6 +830,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len) if (OPM_newSFile != NIL) { Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0); Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7); + Files_Write(&OPM_newSF, Files_Rider__typ, 0x82); } else { OPM_err(153); } diff --git a/make.cmd b/make.cmd index 80ab98d4..6eb498e5 100644 --- a/make.cmd +++ b/make.cmd @@ -68,6 +68,7 @@ if errorlevel 1 ( echo make full - administrator rights required. Please run under an administrator command prompt. goto :eof ) +call :uninstall || exit /b call :clean || exit /b call :compiler || exit /b call :browsercmd || exit /b @@ -447,7 +448,7 @@ goto :eof :initlibrary -del /s /q %BUILDDIR%\%MODEL% >nul 2>nul +rd /s /q %BUILDDIR%\%MODEL% >nul 2>nul mkdir %BUILDDIR% >nul 2>nul mkdir %BUILDDIR%\%MODEL% >nul 2>nul copy src\runtime\*.c %BUILDDIR%\%MODEL% >nul diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c0abf4e3..48337bfc 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -76,6 +76,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BFext = ".c"; (* body file extension *) HFext = ".h"; (* header file extension *) SFtag = 0F7X; (* symbol file tag *) + SFver = 082X; (* symbol file version. Increment if symbol file format is changed. *) @@ -618,13 +619,13 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END CloseOldSym; PROCEDURE OldSym*(VAR modName: ARRAY OF CHAR; VAR done: BOOLEAN); - VAR ch: CHAR; fileName: FileName; + VAR tag, ver: CHAR; fileName: FileName; BEGIN MakeFileName(modName, fileName, SFext); oldSFile := Files.Old(fileName); done := oldSFile # NIL; IF done THEN - Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, ch); - IF ch # SFtag THEN err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) + Files.Set(oldSF, oldSFile, 0); Files.Read(oldSF, tag); Files.Read(oldSF, ver); + IF (tag # SFtag) OR (ver # SFver) THEN err(-306); (*possibly a symbol file from another Oberon implementation, e.g. HP-Oberon*) CloseOldSym; done := FALSE END END @@ -671,7 +672,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR fileName: FileName; BEGIN MakeFileName(modName, fileName, SFext); newSFile := Files.New(fileName); - IF newSFile # NIL THEN Files.Set(newSF, newSFile, 0); Files.Write(newSF, SFtag) + IF newSFile # NIL THEN Files.Set(newSF, newSFile, 0); + Files.Write(newSF, SFtag); Files.Write(newSF, SFver) ELSE err(153) END END NewSym; From ed7043324d744d9fb5aa3de0b882d4c4c06cc542 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 11 Nov 2016 18:23:31 +0000 Subject: [PATCH 118/140] Remove redundant writer in OPM. Fix Files.Readline for CR/LF and guarantee 0 termination. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 23 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 5 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 23 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 5 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 23 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 5 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 23 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 5 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 23 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 5 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPM.Mod | 3 - src/library/v4/Modules.Mod | 96 --- src/library/v4/Reals.Mod | 136 ----- src/library/v4/Strings.Mod | 156 ----- src/library/v4/Texts.Mod | 879 --------------------------- src/runtime/Files.Mod | 17 +- 201 files changed, 255 insertions(+), 1552 deletions(-) delete mode 100644 src/library/v4/Modules.Mod delete mode 100644 src/library/v4/Reals.Mod delete mode 100644 src/library/v4/Strings.Mod delete mode 100644 src/library/v4/Texts.Mod diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index b6483b0d..5aedd8ec 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1b94c84f..88034b00 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 49df34bf..fc148d64 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index c90c4c43..bc020535 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index bff09b6b..2bbafb50 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 7891a3ab..db16a845 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index b8f6a762..f7454dae 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index b6483b0d..5aedd8ec 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1b94c84f..88034b00 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 8d2305be..a8951123 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index c90c4c43..bc020535 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index bff09b6b..2bbafb50 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index abf1736a..987b9952 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index dd1e65e5..e902469a 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 53e757cf..53ac0902 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 7c86bc8b..3bfefe80 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 65151d07..806a01db 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index d37b81db..2603a3eb 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 56f6f73e..f463ec4e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index e077a852..97726a71 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d828881d..91212642 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 4a47eb31..e3840599 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 51464c2f..0a7b463e 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 4eaacd0b..7c411904 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 27e1fa94..09fecc76 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 9682a16f..46853757 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 84628711..ca01598a 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 38bcde69..3a949175 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 6ef483f3..216e64dc 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 8f9d4784..1d23fdc4 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -883,19 +883,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c939154b..38b52f44 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 8ab8db36..45b45394 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a7926fd5..8626628d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 20b68450..5eddf9be 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 4924854d..0ac4141a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 36, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d828881d..91212642 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index a8a90bfc..6a24e3cd 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 8d2305be..a8951123 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index c90bb72a..77b842f8 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index bad87929..de6a9e16 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 4a8c3cc0..29801da0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index d6c32fa3..e96a1eec 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index abf1736a..987b9952 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index dd1e65e5..e902469a 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 5635eb49..87b0392c 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 88e7a4c9..c15b87f9 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 20f55dce..f169a3b6 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 683c021e..c519f8d5 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -885,19 +885,18 @@ void Files_ReadString (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) void Files_ReadLine (Files_Rider *R, ADDRESS *R__typ, CHAR *x, LONGINT x__len) { INT16 i; - CHAR ch; - BOOLEAN b; i = 0; - b = 0; do { - Files_Read(&*R, R__typ, (void*)&ch); - if ((ch == 0x00 || ch == 0x0a) || ch == 0x0d) { - b = 1; - } else { - x[i] = ch; - i += 1; - } - } while (!b); + Files_Read(&*R, R__typ, (void*)&x[i]); + i += 1; + } while (!(x[i - 1] == 0x00 || x[i - 1] == 0x0a)); + if (x[i - 1] == 0x0a) { + i -= 1; + } + if ((i > 0 && x[i - 1] == 0x0d)) { + i -= 1; + } + x[i] = 0x00; } void Files_ReadNum (Files_Rider *R, ADDRESS *R__typ, SYSTEM_BYTE *x, LONGINT x__len) diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 2bc98b79..376ef83e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 65151d07..806a01db 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index d37b81db..2603a3eb 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 56f6f73e..f463ec4e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index de306cf5..2da3fa50 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index d272b474..dcac4eb9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 880670eb..cb6399f9 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 1dba2168..9b3d80c3 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a6816fe2..6cc996c8 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index e077a852..97726a71 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -38,7 +38,6 @@ export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; static Texts_Text OPM_Log; -static Texts_Writer OPM_W; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -1044,7 +1043,6 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); - __ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1080,6 +1078,5 @@ export void *OPM__init(void) OPM_MaxLReal = 1.79769296342094e+308; OPM_MinReal = -OPM_MaxReal; OPM_MinLReal = -OPM_MaxLReal; - Texts_OpenWriter(&OPM_W, Texts_Writer__typ); __ENDMOD; } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d828881d..91212642 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 4a47eb31..e3840599 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 806302cb..3cadf5a4 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 6cb1973e..898b14b6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 04a8a785..34906046 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 51464c2f..0a7b463e 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index b01bfedc..3a248e3c 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 4eaacd0b..7c411904 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ae75cd60..34e34ae6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index bad87929..de6a9e16 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 79895677..63fefd3c 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index c0d60542..151ed04c 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e2e65585..e3841844 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 37ba21bb..f7860591 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 94d22e76..5ed2ec95 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 17fe28a6..5ae2e44e 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 6d2e8625..a9d577f6 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 38bcde69..3a949175 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 6ef483f3..216e64dc 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 6a492f2a..01b8a481 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 54e1e753..5ee411dd 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 651501a0..b7d411bb 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index bd6765aa..fa08de1c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 23b737c3..74271e5d 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 124b2154..9b7b3c17 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/10]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 48337bfc..f765cd2e 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -112,7 +112,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) lasterrpos: LONGINT; inR: Texts.Reader; Log: Texts.Text; - W: Texts.Writer; oldSF, newSF: Files.Rider; R: ARRAY 3 OF Files.Rider; @@ -811,6 +810,4 @@ BEGIN MaxLReal := 1.7976931348623157D307 * 9.999999; (* LONGREAL is 8 bytes, should be 1.7976931348623157D308 *) MinReal := -MaxReal; MinLReal := -MaxLReal; - - Texts.OpenWriter(W); END OPM. diff --git a/src/library/v4/Modules.Mod b/src/library/v4/Modules.Mod deleted file mode 100644 index 46c933f5..00000000 --- a/src/library/v4/Modules.Mod +++ /dev/null @@ -1,96 +0,0 @@ -MODULE Modules; (* jt 6.1.96 *) - - (* access to list of modules and commands, based on ETH Oberon *) - - - IMPORT SYSTEM, Console, Heap; - - CONST - ModNameLen* = 20; - - TYPE - ModuleName* = ARRAY ModNameLen OF CHAR; - Module* = POINTER TO ModuleDesc; - Cmd* = POINTER TO CmdDesc; - ModuleDesc* = RECORD (* cf. SYSTEM.Mod *) - next-: Module; - name-: ModuleName; - refcnt-: LONGINT; - cmds-: Cmd; - types-: LONGINT; - enumPtrs-: PROCEDURE (P: PROCEDURE(p: LONGINT)); - reserved1, reserved2: LONGINT; - END ; - - Command* = PROCEDURE; - - CmdDesc* = RECORD - next-: Cmd; - name-: ARRAY 24 OF CHAR; - cmd-: Command - END ; - - VAR - res*: INTEGER; - resMsg*: ARRAY 256 OF CHAR; - imported*, importing*: ModuleName; - - - PROCEDURE -modules*(): Module - "(Modules_Module)Heap_modules"; - - PROCEDURE -setmodules*(m: Module) - "Heap_modules = m"; - - - PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); - VAR i, j: INTEGER; - BEGIN - i := 0; WHILE a[i] # 0X DO INC(i) END; - j := 0; WHILE b[j] # 0X DO a[i] := b[j]; INC(i); INC(j) END; - a[i] := 0X - END Append; - - PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; - VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; - BEGIN m := modules(); - WHILE (m # NIL) & (m.name # name) DO m := m.next END ; - IF m # NIL THEN res := 0; resMsg := "" - ELSE res := 1; COPY(name, importing); - resMsg := ' module "'; Append(resMsg, name); Append(resMsg, '" not found'); - END ; - RETURN m - END ThisMod; - - PROCEDURE ThisCommand* (mod: Module; name: ARRAY OF CHAR): Command; - VAR c: Cmd; - BEGIN c := mod.cmds; - WHILE (c # NIL) & (c.name # name) DO c := c.next END ; - IF c # NIL THEN res := 0; resMsg := ""; RETURN c.cmd - ELSE res := 2; resMsg := ' command "'; COPY(name, importing); - Append(resMsg, mod.name); Append(resMsg, "."); Append(resMsg, name); Append(resMsg, '" not found'); - RETURN NIL - END - END ThisCommand; - - PROCEDURE Free*(name: ARRAY OF CHAR; all: BOOLEAN); - VAR m, p: Module; - BEGIN m := modules(); - IF all THEN - res := 1; resMsg := 'unloading "all" not yet supported' - ELSE - WHILE (m # NIL) & (m.name # name) DO p := m; m := m.next END ; - IF (m # NIL) & (m.refcnt = 0) THEN - IF m = modules() THEN setmodules(m.next) - ELSE p.next := m.next - END ; - res := 0 - ELSE res := 1; - IF m = NIL THEN resMsg := "module not found" - ELSE resMsg := "clients of this module exist" - END - END - END - END Free; - -END Modules. diff --git a/src/library/v4/Reals.Mod b/src/library/v4/Reals.Mod deleted file mode 100644 index f9e6617b..00000000 --- a/src/library/v4/Reals.Mod +++ /dev/null @@ -1,136 +0,0 @@ -MODULE Reals; - (* JT, 5.2.90 / RC 9.12.91 conversion between reals and strings for HP-700, MB 9.12.91, JT for Ofront, 16.3. 95*) - (* DCWB 20160817 Made independent of INTEGER size *) - - IMPORT SYSTEM; - - PROCEDURE Ten*(e: INTEGER): REAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - WHILE e > 0 DO - IF ODD(e) THEN r := r * power END ; - power := power * power; e := e DIV 2 - END ; - RETURN SHORT(r) - END Ten; - - - PROCEDURE TenL*(e: INTEGER): LONGREAL; - VAR r, power: LONGREAL; - BEGIN r := 1.0; - power := 10.0; - LOOP - IF ODD(e) THEN r := r * power END ; - e := e DIV 2; - IF e <= 0 THEN RETURN r END ; - power := power * power - END - END TenL; - - - (* Real number format (IEEE 754) - - TYPE REAL - Single precision / binary32: - 1/sign, 8/exponent, 23/significand - - TYPE LONGREAL - Double precision / binary64: - 1/sign, 11/exponent, 52/significand - - exponent: - stored as exponent value + 127. - - significand (fraction): - excludes leading (most significant) bit which is assumed to be 1. - *) - - - PROCEDURE Expo*(x: REAL): INTEGER; - VAR i: INTEGER; - BEGIN - SYSTEM.GET(SYSTEM.ADR(x)+2, i); - RETURN (i DIV 128) MOD 256 - END Expo; - - PROCEDURE SetExpo*(VAR x: REAL; ex: INTEGER); - VAR c: CHAR; - BEGIN - (* Replace exponent bits within top byte of REAL *) - SYSTEM.GET(SYSTEM.ADR(x)+3, c); - SYSTEM.PUT(SYSTEM.ADR(x)+3, CHR(((ORD(c) DIV 128) * 128) + ((ex DIV 2) MOD 128))); - (* Replace exponent bits within 2nd byte of REAL *) - SYSTEM.GET(SYSTEM.ADR(x)+2, c); - SYSTEM.PUT(SYSTEM.ADR(x)+2, CHR((ORD(c) MOD 128) + ((ex MOD 2) * 128))) - END SetExpo; - - PROCEDURE ExpoL*(x: LONGREAL): INTEGER; - VAR i: INTEGER; - BEGIN - SYSTEM.GET(SYSTEM.ADR(x)+6, i); - RETURN (i DIV 16) MOD 2048 - END ExpoL; - - (* Convert LONGREAL: Write positive integer value of x into array d. - The value is stored backwards, i.e. least significant digit - first. n digits are written, with trailing zeros fill. - On entry x has been scaled to the number of digits required. *) - PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); - VAR i, j, k: LONGINT; - BEGIN - IF x < 0 THEN x := -x END; - k := 0; - - IF (SIZE(LONGINT) < 8) & (n > 9) THEN - (* There are more decimal digits than can be held in a single LONGINT *) - i := ENTIER(x / 1000000000.0D0); (* The 10th and higher digits *) - j := ENTIER(x - (i * 1000000000.0D0)); (* The low 9 digits *) - (* First generate the low 9 digits. *) - IF j < 0 THEN j := 0 END; - WHILE k < 9 DO - d[k] := CHR(j MOD 10 + 48); j := j DIV 10; INC(k) - END; - (* Fall through to generate the upper digits *) - ELSE - (* We can generate all the digits in one go. *) - i := ENTIER(x); - END; - - WHILE k < n DO - d[k] := CHR(i MOD 10 + 48); i := i DIV 10; INC(k) - END - END ConvertL; - - - PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); - BEGIN ConvertL(x, n, d) - END Convert; - - PROCEDURE ToHex(i: INTEGER): CHAR; - BEGIN - IF i < 10 THEN RETURN CHR(i+48) - ELSE RETURN CHR(i+55) END - END ToHex; - - PROCEDURE BytesToHex(VAR b, d: ARRAY OF SYSTEM.BYTE); - VAR i: INTEGER; l: LONGINT; by: CHAR; - BEGIN - i := 0; l := LEN(b); - WHILE i < l DO - by := SYSTEM.VAL(CHAR, b[i]); - d[i*2] := ToHex(ORD(by) DIV 16); - d[i*2+1] := ToHex(ORD(by) MOD 16); - INC(i) - END - END BytesToHex; - - (* Convert Hex *) - PROCEDURE ConvertH*(y: REAL; VAR d: ARRAY OF CHAR); - BEGIN BytesToHex(y, d) - END ConvertH; - - (* Convert Hex Long *) - PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); - BEGIN BytesToHex(x, d) - END ConvertHL; - -END Reals. diff --git a/src/library/v4/Strings.Mod b/src/library/v4/Strings.Mod deleted file mode 100644 index e6fe12ac..00000000 --- a/src/library/v4/Strings.Mod +++ /dev/null @@ -1,156 +0,0 @@ -(*------------------------------------------------------------- -Strings provides a set of operations on strings (i.e., on string constants and character -arrays, both of which contain the character 0X as a terminator). All positions in -strings start at 0. -Strings.Length(s) - returns the number of characters in s up to and excluding the first 0X. -Strings.Insert(src, pos, dst) - inserts the string src into the string dst at position pos (0 <= pos <= Length(dst)). - If pos = Length(dst), src is appended to dst. If the size of dst is not large enough - to hold the result of the operation, the result is truncated so that dst is always - terminated with a 0X. -Strings.Append(s, dst) - has the same effect as Insert(s, Length(s), dst). -Strings.Delete(s, pos, n) - deletes n characters from s starting at position pos (0 <= pos < Length(s)). - If n > Length(s) - pos, the new length of s is pos. -Strings.Replace(src, pos, dst) - has the same effect as Delete(dst, pos, Length(src)) followed by an Insert(src, pos, dst). -Strings.Extract(src, pos, n, dst) - extracts a substring dst with n characters from position pos (0 <= pos < Length(src)) in src. - If n > Length(src) - pos, dst is only the part of src from pos to Length(src) - 1. If the size of - dst is not large enough to hold the result of the operation, the result is truncated so that - dst is always terminated with a 0X. -Strings.Pos(pat, s, pos) - returns the position of the first occurrence of pat in s after position pos (inclusive). - If pat is not found, -1 is returned. -Strings.Cap(s) - replaces each lower case letter in s by its upper case equivalent. --------------------------------------------------------------*) -(* added from trianus v4 *) -MODULE Strings; (*HM 94-06-22 / *) - - -PROCEDURE Length* (s: ARRAY OF CHAR): INTEGER; - VAR i: INTEGER; -BEGIN - i := 0; WHILE (i < LEN(s)) & (s[i] # 0X) DO INC(i) END ; - RETURN i -END Length; - - -PROCEDURE Append* (extra: ARRAY OF CHAR; VAR dest: ARRAY OF CHAR); - VAR n1, n2, i: INTEGER; -BEGIN - n1 := Length(dest); n2 := Length(extra); i := 0; - WHILE (i < n2) & (i + n1 < LEN(dest)) DO dest[i + n1] := extra[i]; INC(i) END ; - IF i + n1 < LEN(dest) THEN dest[i + n1] := 0X END -END Append; - - -PROCEDURE Insert* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); - VAR n1, n2, i: INTEGER; -BEGIN - n1 := Length(dest); n2 := Length(source); - IF pos < 0 THEN pos := 0 END ; - IF pos > n1 THEN Append(dest, source); RETURN END ; - IF pos + n2 < LEN(dest) THEN (*make room for source*) - i := n1; (*move also 0X if it is there*) - WHILE i >= pos DO - IF i + n2 < LEN(dest) THEN dest[i + n2] := dest[i] END ; - DEC(i) - END - END ; - i := 0; WHILE i < n2 DO dest[pos + i] := source[i]; INC(i) END -END Insert; - - -PROCEDURE Delete* (VAR s: ARRAY OF CHAR; pos, n: INTEGER); - VAR len, i: INTEGER; -BEGIN - len:=Length(s); - IF pos < 0 THEN pos:=0 ELSIF pos >= len THEN RETURN END ; - IF pos + n < len THEN - i:=pos + n; WHILE i < len DO s[i - n]:=s[i]; INC(i) END ; - IF i - n < LEN(s) THEN s[i - n]:=0X END - ELSE s[pos]:=0X - END -END Delete; - - -PROCEDURE Replace* (source: ARRAY OF CHAR; pos: INTEGER; VAR dest: ARRAY OF CHAR); -BEGIN - Delete(dest, pos, pos + Length(source)); - Insert(source, pos, dest) -END Replace; - - -PROCEDURE Extract* (source: ARRAY OF CHAR; pos, n: INTEGER; VAR dest: ARRAY OF CHAR); - VAR len, destLen, i: INTEGER; -BEGIN - len := Length(source); destLen := SHORT(LEN(dest)) - 1; - IF pos < 0 THEN pos := 0 END ; - IF pos >= len THEN dest[0] := 0X; RETURN END ; - i := 0; - WHILE (pos + i <= LEN(source)) & (source[pos + i] # 0X) & (i < n) DO - IF i < destLen THEN dest[i] := source[pos + i] END ; - INC(i) - END ; - dest[i] := 0X -END Extract; - - -PROCEDURE Pos* (pattern, s: ARRAY OF CHAR; pos: INTEGER): INTEGER; - VAR n1, n2, i, j: INTEGER; -BEGIN - n1 := Length(s); n2 := Length(pattern); - IF n2 = 0 THEN RETURN 0 END ; - i := pos; - WHILE i <= n1 - n2 DO - IF s[i] = pattern[0] THEN - j := 1; WHILE (j < n2) & (s[i + j] = pattern[j]) DO INC(j) END ; - IF j = n2 THEN RETURN i END - END ; - INC(i) - END ; - RETURN -1 -END Pos; - - -PROCEDURE Cap* (VAR s: ARRAY OF CHAR); - VAR i: INTEGER; -BEGIN - i := 0; - WHILE s[i] # 0X DO - IF ("a" <= s[i]) & (s[i] <= "z") THEN s[i] := CAP(s[i]) END ; - INC(i) - END -END Cap; - - -PROCEDURE Match* (string, pattern: ARRAY OF CHAR): BOOLEAN; - - PROCEDURE M (VAR name, mask: ARRAY OF CHAR; n, m: INTEGER): BOOLEAN; - BEGIN - WHILE (n >= 0) & (m >= 0) & (mask[m] # "*") DO - IF name[n] # mask[m] THEN RETURN FALSE END ; - DEC(n); DEC(m) - END ; - (* ----- name empty | mask empty | mask ends with "*" *) - IF m < 0 THEN RETURN n < 0 END ; - (* ----- name empty | mask ends with "*" *) - WHILE (m >= 0) & (mask[m] = "*") DO DEC(m) END ; - IF m < 0 THEN RETURN TRUE END ; - (* ----- name empty | mask still to be matched *) - WHILE n >= 0 DO - IF M(name, mask, n, m) THEN RETURN TRUE END ; - DEC(n) - END ; - RETURN FALSE - END M; - -BEGIN - RETURN M(string, pattern, Length(string)-1, Length(pattern)-1) -END Match; - -END Strings. diff --git a/src/library/v4/Texts.Mod b/src/library/v4/Texts.Mod deleted file mode 100644 index ecca315d..00000000 --- a/src/library/v4/Texts.Mod +++ /dev/null @@ -1,879 +0,0 @@ -MODULE Texts; (** CAS/HM 23.9.93 -- interface based on Texts by JG/NW 6.12.91**) (* << RC, MB, JT *) - IMPORT - Files, Modules, Reals, SYSTEM; - - (*--- insert field e: Elem into Texts.Scanner and change Texts.Scan to set it in case of class=6 *) - - - CONST - Displaywhite = 15; - ElemChar* = 1CX; - TAB = 9X; CR = 0DX; maxD = 9; - (**FileMsg.id**) - load* = 0; store* = 1; - (**Notifier op**) - replace* = 0; insert* = 1; delete* = 2; unmark* = 3; - (**Scanner.class**) - Inval* = 0; Name* = 1; String* = 2; Int* = 3; Real* = 4; LongReal* = 5; Char* = 6; - - textTag = 0F0X; DocBlockId = 0F7X; version = 01X; - - TYPE - FontsFont = POINTER TO FontDesc; - FontDesc = RECORD - name: ARRAY 32 OF CHAR; - END ; - - Run = POINTER TO RunDesc; - RunDesc = RECORD - prev, next: Run; - len: LONGINT; - fnt: FontsFont; - col, voff: SHORTINT; - ascii: BOOLEAN (* << *) - END; - - Piece = POINTER TO PieceDesc; - PieceDesc = RECORD (RunDesc) - file: Files.File; - org: LONGINT - END; - - Elem* = POINTER TO ElemDesc; - Buffer* = POINTER TO BufDesc; - Text* = POINTER TO TextDesc; - - ElemMsg* = RECORD END; - Handler* = PROCEDURE (e: Elem; VAR msg: ElemMsg); - - ElemDesc* = RECORD (RunDesc) - W*, H*: LONGINT; - handle*: Handler; - base: Text - END; - - FileMsg* = RECORD (ElemMsg) - id*: INTEGER; - pos*: LONGINT; - r*: Files.Rider - END; - - CopyMsg* = RECORD (ElemMsg) - e*: Elem - END; - - IdentifyMsg* = RECORD (ElemMsg) - mod*, proc*: ARRAY 32 OF CHAR - END; - - - BufDesc* = RECORD - len*: LONGINT; - head: Run - END; - - Notifier* = PROCEDURE (T: Text; op: INTEGER; beg, end: LONGINT); - TextDesc* = RECORD - len*: LONGINT; - notify*: Notifier; - head, cache: Run; - corg: LONGINT - END; - - Reader* = RECORD - eot*: BOOLEAN; - fnt*: FontsFont; - col*, voff*: SHORTINT; - elem*: Elem; - rider: Files.Rider; - run: Run; - org, off: LONGINT - END; - - Scanner* = RECORD (Reader) - nextCh*: CHAR; - line*, class*: INTEGER; - i*: LONGINT; - x*: REAL; - y*: LONGREAL; - c*: CHAR; - len*: SHORTINT; - s*: ARRAY 64 OF CHAR (* << *) - END; - - Writer* = RECORD - buf*: Buffer; - fnt*: FontsFont; - col*, voff*: SHORTINT; - rider: Files.Rider; - file: Files.File - END; - - Alien = POINTER TO RECORD (ElemDesc) - file: Files.File; - org, span: LONGINT; - mod, proc: ARRAY 32 OF CHAR - END; - - VAR - new*: Elem; - del: Buffer; - FontsDefault: FontsFont; - - - PROCEDURE FontsThis(VAR name: ARRAY OF CHAR): FontsFont; - VAR F: FontsFont; - BEGIN - NEW(F); COPY(name, F.name); RETURN F - END FontsThis; - - (* run primitives *) - - PROCEDURE Find (T: Text; VAR pos: LONGINT; VAR u: Run; VAR org, off: LONGINT); - VAR v: Run; m: LONGINT; - BEGIN - IF pos >= T.len THEN pos := T.len; u := T.head; org := T.len; off := 0; T.cache := T.head; T.corg := 0 - ELSE v := T.cache.next; m := pos - T.corg; - IF pos >= T.corg THEN - WHILE m >= v.len DO DEC(m, v.len); v := v.next END - ELSE - WHILE m < 0 DO v := v.prev; INC(m, v.len) END; - END; - u := v; org := pos - m; off := m; T.cache := v.prev; T.corg := org - END - END Find; - - PROCEDURE Split (off: LONGINT; VAR u, un: Run); - VAR p, U: Piece; - BEGIN - IF off = 0 THEN un := u; u := un.prev - ELSIF off >= u.len THEN un := u.next - ELSE NEW(p); un := p; U := u(Piece); - p^ := U^; INC(p.org, off); DEC(p.len, off); DEC(U.len, p.len); - p.ascii := u.ascii; p.prev := U; p.next := U.next; p.next.prev := p; U.next := p (* << *) - END - END Split; - - PROCEDURE Merge (T: Text; u: Run; VAR v: Run); - VAR p, q: Piece; - BEGIN - IF (u IS Piece) & (v IS Piece) & (u.fnt.name = v.fnt.name) & (u.col = v.col) & (u.voff = v.voff) - & (u(Piece).ascii = v(Piece).ascii) THEN (* << *) - p := u(Piece); q := v(Piece); - IF (p.file = q.file) & (p.org + p.len = q.org) THEN - IF T.cache = u THEN INC(T.corg, q.len) - ELSIF T.cache = v THEN T.cache := T.head; T.corg := 0 - END; - INC(p.len, q.len); v := v.next - END - END - END Merge; - - PROCEDURE Splice (un, v, w: Run; base: Text); (* (u, un) -> (u, v, w, un) *) - VAR u: Run; - BEGIN - IF v # w.next THEN u := un.prev; - u.next := v; v.prev := u; un.prev := w; w.next := un; - REPEAT - IF v IS Elem THEN v(Elem).base := base END; - v := v.next - UNTIL v = un - END - END Splice; - - PROCEDURE ClonePiece (p: Piece): Piece; - VAR q: Piece; - BEGIN NEW(q); q^ := p^; RETURN q - END ClonePiece; - - PROCEDURE CloneElem (e: Elem): Elem; - VAR msg: CopyMsg; - BEGIN msg.e := NIL; e.handle(e, msg); RETURN msg.e - END CloneElem; - - - (** Elements **) - - PROCEDURE CopyElem* (SE, DE: Elem); - BEGIN DE.len := SE.len; DE.fnt := SE.fnt; DE.col := SE.col; DE.voff := SE.voff; - DE.W := SE.W; DE.H := SE.H; DE.handle := SE.handle - END CopyElem; - - PROCEDURE ElemBase* (E: Elem): Text; - BEGIN RETURN E.base - END ElemBase; - - PROCEDURE ElemPos* (E: Elem): LONGINT; - VAR u: Run; pos: LONGINT; - BEGIN u := E.base.head.next; pos := 0; - WHILE u # E DO pos := pos + u.len; u := u.next END; - RETURN pos - END ElemPos; - - - PROCEDURE HandleAlien (E: Elem; VAR msg: ElemMsg); - VAR e: Alien; r: Files.Rider; i: LONGINT; ch: CHAR; - BEGIN - WITH E: Alien DO - IF msg IS CopyMsg THEN - WITH msg: CopyMsg DO NEW(e); CopyElem(E, e); - e.file := E.file; e.org := E.org; e.span := E.span; e.mod := E.mod; e.proc := E.proc; - msg.e := e - END - ELSIF msg IS IdentifyMsg THEN - WITH msg: IdentifyMsg DO - COPY(E.mod, msg.mod); COPY(E.proc, msg.proc); msg.mod[31] := 1X (*alien*) - END - ELSIF msg IS FileMsg THEN - WITH msg: FileMsg DO - IF msg.id = store THEN Files.Set(r, E.file, E.org); i := E.span; - WHILE i > 0 DO Files.Read(r, ch); Files.Write(msg.r, ch); DEC(i) END - END - END - END - END - END HandleAlien; - - - (** Buffers **) - - PROCEDURE OpenBuf* (B: Buffer); - VAR u: Run; - BEGIN NEW(u); u.next := u; u.prev := u; B.head := u; B.len := 0 - END OpenBuf; - - PROCEDURE Copy* (SB, DB: Buffer); - VAR u, v, vn: Run; - BEGIN u := SB.head.next; v := DB.head.prev; - WHILE u # SB.head DO - IF u IS Piece THEN vn := ClonePiece(u(Piece)) ELSE vn := CloneElem(u(Elem)) END; - v.next := vn; vn.prev := v; v := vn; u := u.next - END; - v.next := DB.head; DB.head.prev := v; - INC(DB.len, SB.len) - END Copy; - - PROCEDURE Recall* (VAR B: Buffer); - BEGIN B := del; del := NIL - END Recall; - - - (** Texts **) - - PROCEDURE Save* (T: Text; beg, end: LONGINT; B: Buffer); - VAR u, v, w, wn: Run; uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Find(T, end, v, vo, vd); - w := B.head.prev; - WHILE u # v DO - IF u IS Piece THEN wn := ClonePiece(u(Piece)); DEC(wn.len, ud); INC(wn(Piece).org, ud) - ELSE wn := CloneElem(u(Elem)) - END; - w.next := wn; wn.prev := w; w := wn; u := u.next; ud := 0 - END; - IF vd > 0 THEN (*v IS Piece*) wn := ClonePiece(v(Piece)); wn.len := vd - ud; INC(wn(Piece).org, ud); - w.next := wn; wn.prev := w; w := wn - END; - w.next := B.head; B.head.prev := w; - INC(B.len, end - beg) - END Save; - - PROCEDURE Insert* (T: Text; pos: LONGINT; B: Buffer); - VAR u, un, v: Run; p, q: Piece; uo, ud, len: LONGINT; - BEGIN Find(T, pos, u, uo, ud); Split(ud, u, un); - len := B.len; v := B.head.next; - Merge(T, u, v); Splice(un, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END - END Insert; - - PROCEDURE Append* (T: Text; B: Buffer); - VAR v: Run; pos, len: LONGINT; - BEGIN pos := T.len; len := B.len; v := B.head.next; - Merge(T, T.head.prev, v); Splice(T.head, v, B.head.prev, T); - INC(T.len, len); B.head.next := B.head; B.head.prev := B.head; B.len := 0; - IF T.notify # NIL THEN T.notify(T, insert, pos, pos+len) END - END Append; - - PROCEDURE Delete* (T: Text; beg, end: LONGINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN - Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - NEW(del); OpenBuf(del); del.len := end - beg; - Splice(del.head, un, v, NIL); - Merge(T, u, vn); u.next := vn; vn.prev := u; - DEC(T.len, end - beg); - IF T.notify # NIL THEN T.notify(T, delete, beg, end) END - END Delete; - - PROCEDURE ChangeLooks* (T: Text; beg, end: LONGINT; sel: SET; fnt: FontsFont; col, voff: SHORTINT); - VAR c, u, un, v, vn: Run; co, uo, ud, vo, vd: LONGINT; - BEGIN Find(T, beg, u, uo, ud); Split(ud, u, un); c := T.cache; co := T.corg; - Find(T, end, v, vo, vd); Split(vd, v, vn); T.cache := c; T.corg := co; - WHILE un # vn DO - IF (0 IN sel) & (fnt # NIL) THEN un.fnt := fnt END; - IF 1 IN sel THEN un.col := col END; - IF 2 IN sel THEN un.voff := voff END; - Merge(T, u, un); - IF u.next = un THEN u := un; un := un.next ELSE u.next := un; un.prev := u END - END; - Merge(T, u, un); u.next := un; un.prev := u; - IF T.notify # NIL THEN T.notify(T, replace, beg, end) END - END ChangeLooks; - - - (** Readers **) - - PROCEDURE OpenReader* (VAR R: Reader; T: Text; pos: LONGINT); - VAR u: Run; - BEGIN - IF pos >= T.len THEN pos := T.len END; - Find(T, pos, u, R.org, R.off); R.run := u; R.eot := FALSE; - IF u IS Piece THEN - Files.Set(R.rider, u(Piece).file, u(Piece).org + R.off) - END - END OpenReader; - - PROCEDURE Read* (VAR R: Reader; VAR ch: CHAR); - VAR u: Run; pos: LONGINT; nextch: CHAR; - BEGIN u := R.run; R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; INC(R.off); - IF u IS Piece THEN Files.Read(R.rider, ch); R.elem := NIL; - IF (ch = 0AX) & u(Piece).ascii THEN ch := CR (* << LF to CR *) - ELSIF (ch = CR) & u(Piece).ascii THEN (* << CR LF to CR *) - pos := Files.Pos(R.rider); Files.Read(R.rider, nextch); - IF nextch = 0AX THEN INC(R.off) ELSE Files.Set(R.rider, u(Piece).file, pos) END - END - ELSIF u IS Elem THEN ch := ElemChar; R.elem := u(Elem) - ELSE ch := 0X; R.elem := NIL; R.eot := TRUE - END; - IF R.off = u.len THEN INC(R.org, u.len); u := u.next; - IF u IS Piece THEN - WITH u: Piece DO Files.Set(R.rider, u.file, u.org) END - END; - R.run := u; R.off := 0 - END - END Read; - - PROCEDURE ReadElem* (VAR R: Reader); - VAR u, un: Run; - BEGIN u := R.run; - WHILE u IS Piece DO INC(R.org, u.len); u := u.next END; - IF u IS Elem THEN un := u.next; R.run := un; INC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem); - IF un IS Piece THEN - WITH un: Piece DO Files.Set(R.rider, un.file, un.org) END - END - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadElem; - - PROCEDURE ReadPrevElem* (VAR R: Reader); - VAR u: Run; - BEGIN u := R.run.prev; - WHILE u IS Piece DO DEC(R.org, u.len); u := u.prev END; - IF u IS Elem THEN R.run := u; DEC(R.org); R.off := 0; - R.fnt := u.fnt; R.col := u.col; R.voff := u.voff; R.elem := u(Elem) - ELSE R.eot := TRUE; R.elem := NIL - END - END ReadPrevElem; - - PROCEDURE Pos* (VAR R: Reader): LONGINT; - BEGIN RETURN R.org + R.off - END Pos; - - - (** Scanners --------------- NW --------------- **) - - PROCEDURE OpenScanner* (VAR S: Scanner; T: Text; pos: LONGINT); - BEGIN OpenReader(S, T, pos); S.line := 0; S.nextCh := " " - END OpenScanner; - - (*IEEE floating point formats: - x = 2^(e-127) * 1.m bit 0: sign, bits 1- 8: e, bits 9-31: m - x = 2^(e-1023) * 1.m bit 0: sign, bits 1-11: e, bits 12-63: m *) - - PROCEDURE Scan* (VAR S: Scanner); - CONST maxD = 32; - VAR ch, term: CHAR; - neg, negE, hex: BOOLEAN; - i, j, h: SHORTINT; - e: INTEGER; k: LONGINT; - x, f: REAL; y, g: LONGREAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE ReadScaleFactor; - BEGIN Read(S, ch); - IF ch = "-" THEN negE := TRUE; Read(S, ch) - ELSE negE := FALSE; - IF ch = "+" THEN Read(S, ch) END - END; - WHILE ("0" <= ch) & (ch <= "9") DO - e := e*10 + ORD(ch) - 30H; Read(S, ch) - END - END ReadScaleFactor; - - BEGIN ch := S.nextCh; i := 0; - LOOP - IF ch = CR THEN INC(S.line) - ELSIF (ch # " ") & (ch # TAB) THEN EXIT - END ; - Read(S, ch) - END; - IF ("A" <= CAP(ch)) & (CAP(ch) <= "Z") OR (ch = "/") OR (ch = ".") THEN (*name*) (* << *) - REPEAT S.s[i] := ch; INC(i); Read(S, ch) - UNTIL (CAP(ch) > "Z") & (ch # "_") (* << *) - OR ("A" > CAP(ch)) & (ch > "9") - OR ("0" > ch) & (ch # ".") & (ch # "/") (* << *) - OR (i = 63); (* << *) - S.s[i] := 0X; S.len := i; S.class := 1 - ELSIF ch = 22X THEN (*literal string*) - Read(S, ch); - WHILE (ch # 22X) & (ch >= " ") & (i # 63) DO (* << *) - S.s[i] := ch; INC(i); Read(S, ch) - END; - S.s[i] := 0X; S.len := i+1; Read(S, ch); S.class := 2 - ELSE - IF ch = "-" THEN neg := TRUE; Read(S, ch) ELSE neg := FALSE END ; - IF ("0" <= ch) & (ch <= "9") THEN (*number*) - hex := FALSE; j := 0; - LOOP d[i] := ch; INC(i); Read(S, ch); - IF ch < "0" THEN EXIT END; - IF "9" < ch THEN - IF ("A" <= ch) & (ch <= "F") THEN hex := TRUE; ch := CHR(ORD(ch)-7) - ELSIF ("a" <= ch) & (ch <= "f") THEN hex := TRUE; ch := CHR(ORD(ch)-27H) - ELSE EXIT - END - END - END; - IF ch = "H" THEN (*hex number*) - Read(S, ch); S.class := 3; - IF i-j > 8 THEN j := i-8 END ; - k := ORD(d[j]) - 30H; INC(j); - IF (i-j = 7) & (k >= 8) THEN DEC(k, 16) END ; - WHILE j < i DO k := k*10H + (ORD(d[j]) - 30H); INC(j) END ; - IF neg THEN S.i := -k ELSE S.i := k END - ELSIF ch = "." THEN (*read real*) - Read(S, ch); h := i; - WHILE ("0" <= ch) & (ch <= "9") DO d[i] := ch; INC(i); Read(S, ch) END ; - IF ch = "D" THEN - e := 0; y := 0; g := 1; - REPEAT y := y*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO g := g/10; y := (ORD(d[j]) - 30H)*g + y; INC(j) END ; - ReadScaleFactor; - IF negE THEN - IF e <= 308 THEN y := y / Reals.TenL(e) ELSE y := 0 END - ELSIF e > 0 THEN - IF e <= 308 THEN y := Reals.TenL(e) * y ELSE HALT(40) END - END ; - IF neg THEN y := -y END ; - S.class := 5; S.y := y - ELSE e := 0; x := 0; f := 1; - REPEAT x := x*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = h; - WHILE j < i DO f := f/10; x := (ORD(d[j])-30H)*f + x; INC(j) END; - IF ch = "E" THEN ReadScaleFactor END ; - IF negE THEN - IF e <= 38 THEN x := x / Reals.Ten(e) ELSE x := 0 END - ELSIF e > 0 THEN - IF e <= 38 THEN x := Reals.Ten(e) * x ELSE HALT(40) END - END ; - IF neg THEN x := -x END ; - S.class := 4; S.x := x - END ; - IF hex THEN S.class := 0 END - ELSE (*decimal integer*) - S.class := 3; k := 0; - REPEAT k := k*10 + (ORD(d[j]) - 30H); INC(j) UNTIL j = i; - IF neg THEN S.i := -k ELSE S.i := k END; - IF hex THEN S.class := 0 ELSE S.class := 3 END - END - ELSE S.class := 6; - IF neg THEN S.c := "-" ELSE S.c := ch; Read(S, ch) END - END - END; - S.nextCh := ch - END Scan; - - - (** Writers **) - - PROCEDURE OpenWriter* (VAR W: Writer); - BEGIN NEW(W.buf); OpenBuf(W.buf); - W.fnt := FontsDefault; W.col := Displaywhite; W.voff := 0; - W.file := Files.New(""); Files.Set(W.rider, W.file, 0) - END OpenWriter; - - PROCEDURE SetFont* (VAR W: Writer; fnt: FontsFont); - BEGIN W.fnt := fnt - END SetFont; - - PROCEDURE SetColor* (VAR W: Writer; col: SHORTINT); - BEGIN W.col := col - END SetColor; - - PROCEDURE SetOffset* (VAR W: Writer; voff: SHORTINT); - BEGIN W.voff := voff - END SetOffset; - - - PROCEDURE Write* (VAR W: Writer; ch: CHAR); - VAR u, un: Run; p: Piece; - BEGIN Files.Write(W.rider, ch); INC(W.buf.len); un := W.buf.head; u := un.prev; - IF (u IS Piece) & (u(Piece).file = W.file) & (u.fnt.name = W.fnt.name) & (u.col = W.col) & (u.voff = W.voff) - & ~u(Piece).ascii THEN (* << *) - INC(u.len) - ELSE NEW(p); u.next := p; p.prev := u; p.next := un; un.prev := p; - p.len := 1; p.fnt := W.fnt; p.col := W.col; p.voff := W.voff; - p.file := W.file; p.org := Files.Length(W.file) - 1; p.ascii := FALSE (* << *) - END - END Write; - - PROCEDURE WriteElem* (VAR W: Writer; e: Elem); - VAR u, un: Run; - BEGIN - IF e.base # NIL THEN HALT(99) END; - INC(W.buf.len); e.len := 1; e.fnt := W.fnt; e.col := W.col; e.voff := W.voff; - un := W.buf.head; u := un.prev; u.next := e; e.prev := u; e.next := un; un.prev := e - END WriteElem; - - PROCEDURE WriteLn* (VAR W: Writer); - BEGIN Write(W, CR) - END WriteLn; - - PROCEDURE WriteString* (VAR W: Writer; s: ARRAY OF CHAR); - VAR i: INTEGER; - BEGIN i := 0; - WHILE s[i] >= " " DO Write(W, s[i]); INC(i) END - END WriteString; - - PROCEDURE WriteInt* (VAR W: Writer; x, n: SYSTEM.INT64); - VAR - i: INTEGER; x0: SYSTEM.INT64; - a: ARRAY 24 OF CHAR; - BEGIN i := 0; - IF x < 0 THEN - IF x = MIN(SYSTEM.INT64) THEN WriteString(W, " -9223372036854775808"); RETURN - ELSE DEC(n); x0 := -x - END - ELSE x0 := x - END; - REPEAT - a[i] := CHR(x0 MOD 10 + 30H); x0 := x0 DIV 10; INC(i) - UNTIL x0 = 0; - WHILE n > i DO Write(W, " "); DEC(n) END; - IF x < 0 THEN Write(W, "-") END; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteInt; - - PROCEDURE WriteHex* (VAR W: Writer; x: LONGINT); - VAR i: INTEGER; y: LONGINT; - a: ARRAY 20 OF CHAR; - BEGIN i := 0; Write(W, " "); - REPEAT y := x MOD 10H; - IF y < 10 THEN a[i] := CHR(y + 30H) ELSE a[i] := CHR(y + 37H) END; - x := x DIV 10H; INC(i) - UNTIL i = 8; - REPEAT DEC(i); Write(W, a[i]) UNTIL i = 0 - END WriteHex; - - PROCEDURE WriteReal* (VAR W: Writer; x: REAL; n: INTEGER); - VAR e: INTEGER; x0: REAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.Expo(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 255 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 9 THEN n := 3 ELSE DEC(n, 6) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= 8; - (*there are 2 < n <= 8 digits to be written*) - IF x < 0.0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - e := (e - 127) * 77 DIV 256; - IF e >= 0 THEN x := x / Reals.Ten(e) ELSE x := Reals.Ten(-e) * x END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - x0 := Reals.Ten(n-1); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN x := x*0.1; INC(e) END; - Reals.Convert(x, n, d); - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - Write(W, "E"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 10 + 30H)); Write(W, CHR(e MOD 10 + 30H)) - END - END WriteReal; - - PROCEDURE WriteRealFix* (VAR W: Writer; x: REAL; n, k: INTEGER); - VAR e, i: INTEGER; sign: CHAR; x0: REAL; - d: ARRAY maxD OF CHAR; - - PROCEDURE seq(ch: CHAR; n: INTEGER); - BEGIN WHILE n > 0 DO Write(W, ch); DEC(n) END - END seq; - - PROCEDURE dig(n: INTEGER); - BEGIN - WHILE n > 0 DO - DEC(i); Write(W, d[i]); DEC(n) - END - END dig; - - BEGIN e := Reals.Expo(x); - IF k < 0 THEN k := 0 END; - IF e = 0 THEN seq(" ", n-k-2); Write(W, "0"); seq(" ", k+1) - ELSIF e = 255 THEN WriteString(W, " NaN"); seq(" ", n-4) - ELSE e := (e - 127) * 77 DIV 256; - IF x < 0 THEN sign := "-"; x := -x ELSE sign := " " END; - IF e >= 0 THEN (*x >= 1.0, 77/256 = log 2*) x := x/Reals.Ten(e) - ELSE (*x < 1.0*) x := Reals.Ten(-e) * x - END; - IF x >= 10.0 THEN x := 0.1*x; INC(e) END; - (* 1 <= x < 10 *) - IF k+e >= maxD-1 THEN k := maxD-1-e - ELSIF k+e < 0 THEN k := -e; x := 0.0 - END; - x0 := Reals.Ten(k+e); x := x0*x + 0.5; - IF x >= 10.0*x0 THEN INC(e) END; - (*e = no. of digits before decimal point*) - INC(e); i := k+e; Reals.Convert(x, i, d); - IF e > 0 THEN - seq(" ", n-e-k-2); Write(W, sign); dig(e); - Write(W, "."); dig(k) - ELSE seq(" ", n-k-3); - Write(W, sign); Write(W, "0"); Write(W, "."); - seq("0", -e); dig(k+e) - END - END - END WriteRealFix; - - PROCEDURE WriteRealHex* (VAR W: Writer; x: REAL); - VAR i: INTEGER; - d: ARRAY 8 OF CHAR; - BEGIN Reals.ConvertH(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 8 - END WriteRealHex; - - PROCEDURE WriteLongReal* (VAR W: Writer; x: LONGREAL; n: INTEGER); - CONST maxD = 16; - VAR e: INTEGER; x0: LONGREAL; - d: ARRAY maxD OF CHAR; - BEGIN e := Reals.ExpoL(x); - IF e = 0 THEN - WriteString(W, " 0"); - REPEAT Write(W, " "); DEC(n) UNTIL n <= 3 - ELSIF e = 2047 THEN - WriteString(W, " NaN"); - WHILE n > 4 DO Write(W, " "); DEC(n) END - ELSE - IF n <= 10 THEN n := 3 ELSE DEC(n, 7) END; - REPEAT Write(W, " "); DEC(n) UNTIL n <= maxD; - (*there are 2 <= n <= maxD digits to be written*) - IF x < 0 THEN Write(W, "-"); x := -x ELSE Write(W, " ") END; - - (* Scale e to be an exponent of 10 rather than 2 *) - e := SHORT(LONG(e - 1023) * 77 DIV 256); - IF e >= 0 THEN x := x / Reals.TenL(e) ELSE x := Reals.TenL(-e) * x END ; - IF x >= 10.0D0 THEN x := 0.1D0 * x; INC(e) END; - - (* Scale x to the number of digits requested *) - x0 := Reals.TenL(n-1); x := x0*x + 0.5D0; - IF x >= 10.0D0*x0 THEN x := 0.1D0 * x; INC(e) END ; - - (* Generate the mantissa digits of x *) - Reals.ConvertL(x, n, d); - - DEC(n); Write(W, d[n]); Write(W, "."); - REPEAT DEC(n); Write(W, d[n]) UNTIL n = 0; - - Write(W, "D"); - IF e < 0 THEN Write(W, "-"); e := -e ELSE Write(W, "+") END; - Write(W, CHR(e DIV 100 + 30H)); e := e MOD 100; - Write(W, CHR(e DIV 10 + 30H)); - Write(W, CHR(e MOD 10 + 30H)) - END - END WriteLongReal; - - PROCEDURE WriteLongRealHex* (VAR W: Writer; x: LONGREAL); - VAR i: INTEGER; - d: ARRAY 16 OF CHAR; - BEGIN Reals.ConvertHL(x, d); i := 0; - REPEAT Write(W, d[i]); INC(i) UNTIL i = 16 - END WriteLongRealHex; - - PROCEDURE WriteDate* (VAR W: Writer; t, d: LONGINT); - - PROCEDURE WritePair(ch: CHAR; x: LONGINT); - BEGIN Write(W, ch); - Write(W, CHR(x DIV 10 + 30H)); Write(W, CHR(x MOD 10 + 30H)) - END WritePair; - - BEGIN - WritePair(" ", d MOD 32); WritePair(".", d DIV 32 MOD 16); WritePair(".", d DIV 512 MOD 128); - WritePair(" ", t DIV 4096 MOD 32); WritePair(":", t DIV 64 MOD 64); WritePair(":", t MOD 64) - END WriteDate; - - - (** Text Filing **) - - PROCEDURE Load0 (VAR r: Files.Rider; T: Text); - VAR u, un: Run; p: Piece; e: Elem; - org, pos, hlen, plen: LONGINT; ecnt, fno, fcnt, col, voff: SHORTINT; - f: Files.File; - msg: FileMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - name: ARRAY 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - - PROCEDURE LoadElem (VAR r: Files.Rider; pos, span: LONGINT; VAR e: Elem); - VAR M: Modules.Module; Cmd: Modules.Command; a: Alien; - org, ew, eh: LONGINT; eno: SHORTINT; - BEGIN new := NIL; - Files.ReadLInt(r, ew); Files.ReadLInt(r, eh); Files.Read(r, eno); - IF eno > ecnt THEN ecnt := eno; Files.ReadString(r, mods[eno]); Files.ReadString(r, procs[eno]) END; - org := Files.Pos(r); M := Modules.ThisMod(mods[eno]); - IF M # NIL THEN Cmd := Modules.ThisCommand(M, procs[eno]); - IF Cmd # NIL THEN Cmd END - END; - e := new; - IF e # NIL THEN e.W := ew; e.H := eh; e.base := T; - msg.pos := pos; e.handle(e, msg); - IF Files.Pos(r) # org + span THEN e := NIL END - END; - IF e = NIL THEN Files.Set(r, f, org + span); - NEW(a); a.W := ew; a.H := eh; a.handle := HandleAlien; a.base := T; - a.file := f; a.org := org; a.span := span; - COPY(mods[eno], a.mod); COPY(procs[eno], a.proc); - e := a - END - END LoadElem; - - BEGIN pos := Files.Pos(r); f := Files.Base(r); - NEW(u); u.len := MAX(LONGINT); (*u.fnt := FontsDefault;*)u.fnt := NIL; u.col := Displaywhite; - T.head := u; ecnt := 0; fcnt := 0; - msg.id := load; msg.r := r; - Files.ReadLInt(msg.r, hlen); (*!!!org := pos + hlen;*) org := pos -2 + hlen; pos := org; Files.Read(msg.r, fno); - WHILE fno # 0 DO - IF fno > fcnt THEN fcnt := fno; Files.ReadString(msg.r, name); fnts[fno] := FontsThis(name) END; - Files.Read(msg.r, col); Files.Read(msg.r, voff); Files.ReadLInt(msg.r, plen); - IF plen > 0 THEN NEW(p); p.file := f; p.org := pos; p.ascii := FALSE; un := p; un.len := plen - ELSE LoadElem(msg.r, pos - org, -plen, e); un := e; un.len := 1 - END; - (*un.fnt := fnts[fno];*) un.col := col; un.voff := voff; - INC(pos, un.len); u.next := un; un.prev := u; u := un; Files.Read(msg.r, fno) - END; - u.next := T.head; T.head.prev := u; T.cache := T.head; T.corg := 0; - Files.ReadLInt(msg.r, T.len); Files.Set(r, f, Files.Pos(msg.r) + T.len) - END Load0; - - PROCEDURE Load* (VAR r: Files.Rider; T: Text); - CONST oldTag = -4095; - VAR tag: INTEGER; - BEGIN - (* for compatibility inner text tags are checked and skipped; remove this in a later version *) - Files.ReadInt(r, tag); IF tag # oldTag THEN Files.Set(r, Files.Base(r), Files.Pos(r)-2) END; - Load0(r, T) - END Load; - - PROCEDURE Open* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; u: Run; p: Piece; tag, version: CHAR; hlen: LONGINT; - BEGIN f := Files.Old(name); - IF f = NIL THEN f := Files.New("") END; - Files.Set(r, f, 0); Files.Read(r, tag); Files.Read(r, version); - IF (tag = textTag) OR (tag = 01X) & (version = textTag) THEN Load0(r, T) - ELSE (*ascii*) - NEW(u); u.len := MAX(LONGINT); u.fnt := NIL; u.col := Displaywhite; - NEW(p); - IF (tag = DocBlockId) & (version = 07X) THEN (* extract ascii text from System 3 text document *) - Files.Set(r, f, 28); Files.ReadLInt(r, hlen); - Files.Set(r, f, 22 + hlen); Files.ReadLInt(r, T.len); p.org := 26 + hlen - ELSE - T.len := Files.Length(f); p.org := 0 - END ; - IF T.len > 0 THEN p.len := T.len; p.fnt := FontsDefault; - p.col := Displaywhite; p.voff := 0; p.file := f; p.ascii := TRUE; - u.next := p; u.prev := p; p.next := u; p.prev := u - ELSE u.next := u; u.prev := u - END; - T.head := u; T.cache := T.head; T.corg := 0 - END - END Open; - - PROCEDURE Store* (VAR r: Files.Rider; T: Text); - VAR r1: Files.Rider; u, un: Run; e: Elem; org, pos, delta, hlen, rlen: LONGINT; ecnt, fno, fcnt: SHORTINT; ch: CHAR; (* << *) - msg: FileMsg; iden: IdentifyMsg; - mods, procs: ARRAY 64, 32 OF CHAR; - fnts: ARRAY 32 OF FontsFont; - block: ARRAY 1024 OF CHAR; - - PROCEDURE StoreElem (VAR r: Files.Rider; pos: LONGINT; e: Elem); - VAR r1: Files.Rider; org, span: LONGINT; eno: SHORTINT; - BEGIN COPY(iden.mod, mods[ecnt]); COPY(iden.proc, procs[ecnt]); eno := 1; - WHILE (mods[eno] # iden.mod) OR (procs[eno] # iden.proc) DO INC(eno) END; - Files.Set(r1, Files.Base(r), Files.Pos(r)); - Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); Files.WriteLInt(r, 0); (*fixup slot*) - Files.Write(r, eno); - IF eno = ecnt THEN INC(ecnt); Files.WriteString(r, iden.mod); Files.WriteString(r, iden.proc) END; - msg.pos := pos; org := Files.Pos(r); e.handle(e, msg); span := Files.Pos(r) - org; - Files.WriteLInt(r1, -span); Files.WriteLInt(r1, e.W); Files.WriteLInt(r1, e.H) (*fixup*) - END StoreElem; - - BEGIN - org := Files.Pos(r); msg.id := store; msg.r := r; Files.WriteLInt(msg.r, 0); (*fixup slot*) - u := T.head.next; pos := 0; delta := 0; fcnt := 1; ecnt := 1; - WHILE u # T.head DO - IF u IS Elem THEN iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden) ELSE iden.mod[0] := 1X END; - IF iden.mod[0] # 0X THEN - fnts[fcnt] := u.fnt; fno := 1; - WHILE fnts[fno].name # u.fnt.name DO INC(fno) END; - Files.Write(msg.r, fno); - IF fno = fcnt THEN INC(fcnt); Files.WriteString(msg.r, u.fnt.name) END; - Files.Write(msg.r, u.col); Files.Write(msg.r, u.voff) - END; - IF u IS Piece THEN rlen := u.len; un := u.next; - WHILE (un IS Piece) & (un.fnt = u.fnt) & (un.col = u.col) & (un.voff = u.voff) DO - INC(rlen, un.len); un := un.next - END; - Files.WriteLInt(msg.r, rlen); INC(pos, rlen); u := un - ELSIF iden.mod[0] # 0X THEN StoreElem(msg.r, pos, u(Elem)); INC(pos); u := u.next - ELSE INC(delta); u := u.next - END - END; - Files.Write(msg.r, 0); Files.WriteLInt(msg.r, T.len - delta); - (*!!!hlen := Files.Pos(msg.r) - org;*) hlen := Files.Pos(msg.r) - org + 2; - Files.Set(r1, Files.Base(msg.r), org); Files.WriteLInt(r1, hlen); (*fixup*) - u := T.head.next; - WHILE u # T.head DO - IF u IS Piece THEN - WITH u: Piece DO - IF u.ascii THEN Files.Set(r1, u.file, u.org); delta := u.len; (* << LF to CR *) - WHILE delta > 0 DO Files.Read(r1, ch); DEC(delta); - IF ch = 0AX THEN Files.Write(msg.r, CR) ELSE Files.Write(msg.r, ch) END - END - ELSE Files.Set(r1, u.file, u.org); delta := u.len; - WHILE delta > LEN(block) DO Files.ReadBytes(r1, block, LEN(block)); - Files.WriteBytes(msg.r, block, LEN(block)); DEC(delta, LEN(block)) - END; - Files.ReadBytes(r1, block, delta); Files.WriteBytes(msg.r, block, delta) - END - END - ELSE iden.mod[0] := 0X; u(Elem).handle(u(Elem), iden); - IF iden.mod[0] # 0X THEN Files.Write(msg.r, ElemChar) END - END; - u := u.next - END; - r := msg.r; - IF T.notify # NIL THEN T.notify(T, unmark, 0, 0) END - END Store; - - PROCEDURE Close* (T: Text; name: ARRAY OF CHAR); - VAR f: Files.File; r: Files.Rider; i, res: INTEGER; bak: ARRAY 64 OF CHAR; - BEGIN - f := Files.New(name); Files.Set(r, f, 0); Files.Write(r, textTag); Files.Write(r, version); Store(r, T); - i := 0; WHILE name[i] # 0X DO INC(i) END; - COPY(name, bak); bak[i] := "."; bak[i+1] := "B"; bak[i+2] := "a"; bak[i+3] := "k"; bak[i+4] := 0X; - Files.Rename(name, bak, res); Files.Register(f) - END Close; - -BEGIN del := NIL; NEW(FontsDefault); FontsDefault.name := "Syntax10.Scn.Fnt" -END Texts. diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 40307644..841c5c41 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -642,19 +642,12 @@ Especially Length would become fairly complex. END ReadString; PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR); - VAR i: INTEGER; ch: CHAR; b : BOOLEAN; + VAR i: INTEGER; BEGIN - i := 0; - b := FALSE; - REPEAT - Read(R, ch); - IF ((ch = 0X) OR (ch = 0AX) OR (ch = 0DX)) THEN - b := TRUE - ELSE - x[i] := ch; - INC(i); - END; - UNTIL b + i := 0; REPEAT Read(R, x[i]); INC(i) UNTIL (x[i-1] = 0X) OR (x[i-1] = 0AX); + IF x[i-1] = 0AX THEN DEC(i) END; (* Omit trailing LF *) + IF (i > 0) & (x[i-1] = 0DX) THEN DEC(i) END; (* Also omit preceeding trailing CR if present. *) + x[i] := 0X; (* Guarantee zero termination. *) END ReadLine; PROCEDURE ReadNum*(VAR R: Rider; VAR x: ARRAY OF SYSTEM.BYTE); From 716240bdd627f81f728431d188857ba1e54a7ba3 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 12 Nov 2016 10:20:50 +0000 Subject: [PATCH 119/140] Simplify runtime error reporting and move to platform common source. --- bootstrap/SYSTEM.h | 8 +- bootstrap/unix-44/Compiler.c | 4 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 6 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-44/Modules.h | 6 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 137 +-------------------------- bootstrap/unix-44/Platform.h | 11 +-- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 8 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 4 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 6 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-48/Modules.h | 6 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 137 +-------------------------- bootstrap/unix-48/Platform.h | 11 +-- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 8 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 4 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 6 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 126 +++++++++++++++++++++++- bootstrap/unix-88/Modules.h | 6 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 137 +-------------------------- bootstrap/unix-88/Platform.h | 11 +-- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 8 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 4 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 6 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 126 +++++++++++++++++++++++- bootstrap/windows-48/Modules.h | 6 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 133 +------------------------- bootstrap/windows-48/Platform.h | 10 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 8 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 4 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 6 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 126 +++++++++++++++++++++++- bootstrap/windows-88/Modules.h | 6 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 133 +------------------------- bootstrap/windows-88/Platform.h | 10 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 8 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 5 +- src/compiler/extTools.Mod | 4 +- src/library/s3/ethReals.Mod | 16 ++-- src/runtime/Heap.Mod | 4 +- src/runtime/Modules.Mod | 67 ++++++++++++- src/runtime/Platformunix.Mod | 65 +------------ src/runtime/Platformwindows.Mod | 61 +----------- src/runtime/SYSTEM.h | 8 +- src/tools/make/oberon.mk | 1 + 205 files changed, 986 insertions(+), 1063 deletions(-) diff --git a/bootstrap/SYSTEM.h b/bootstrap/SYSTEM.h index d9778393..43baa836 100644 --- a/bootstrap/SYSTEM.h +++ b/bootstrap/SYSTEM.h @@ -103,11 +103,11 @@ extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(INT32 x); -extern void Platform_AssertFail(INT32 x); +extern void Modules_Halt(INT32 x); +extern void Modules_AssertFail(INT32 x); -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) +#define __HALT(x) Modules_Halt((INT32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x)) // Index checking diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 5aedd8ec..3ce83372 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 88034b00..c04d545c 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fc148d64..43d368dd 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index bc020535..0a70d4aa 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT32 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2bbafb50..7f48cd11 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT32 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index db16a845..90bf9113 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f7454dae..8e1a2514 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 5aedd8ec..3ce83372 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 88034b00..c04d545c 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a8951123..46e05141 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index bc020535..0a70d4aa 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT32 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT32 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2bbafb50..7f48cd11 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT32 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 987b9952..36cd76fb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index e902469a..4bae7210 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 53ac0902..ba54d44e 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3bfefe80..ef304bed 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 806a01db..46f70cc1 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 2603a3eb..06cbd0ec 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index f463ec4e..494f9fdc 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 97726a71..c2258e5b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e3840599..bcedf318 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 0a7b463e..896d5ead 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7c411904..3602bbf6 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 09fecc76..ad7ed82c 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 46853757..76346d8f 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -33,7 +33,6 @@ typedef export BOOLEAN Platform_LittleEndian; export INT64 Platform_MainStackFrame; -export INT32 Platform_HaltCode; export INT16 Platform_PID; export CHAR Platform_CWD[256]; export INT16 Platform_ArgCount; @@ -47,21 +46,18 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -81,7 +77,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetInterruptHandler (Platform_SignalHandler handler); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export void Platform_SetQuitHandler (Platform_SignalHandler handler); @@ -96,10 +91,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 l); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT32 ye, INT32 mo, INT32 da, INT32 ho, INT32 mi, INT32 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include @@ -131,9 +122,7 @@ extern void Heap_InitHeap(); #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno -#define Platform_errc(c) write(1, &c, 1) -#define Platform_errstring(s, s__len) write(1, s, s__len-1) -#define Platform_exit(code) exit(code) +#define Platform_exit(code) exit((int)code) #define Platform_free(address) free((void*)address) #define Platform_fstat(fd) fstat(fd, &s) #define Platform_fsync(fd) fsync(fd) @@ -229,7 +218,6 @@ void Platform_Init (INT32 argc, INT64 argvadr) Platform_ArgCount = __VAL(INT16, argc); av = (Platform_ArgVecPtr)(ADDRESS)argvadr; Platform_ArgVector = (*av)[0]; - Platform_HaltCode = -128; Platform_HeapInitHeap(); } @@ -571,127 +559,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); - break; - case -7: - Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32); - break; - case -8: - Platform_errstring((CHAR*)"Value out of range.", 20); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_TestLittleEndian (void) { INT16 i; @@ -708,7 +580,6 @@ export void *Platform__init(void) __INITYP(Platform_FileIdentity, Platform_FileIdentity, 0); /* BEGIN */ Platform_TestLittleEndian(); - Platform_HaltCode = -128; Platform_HaltHandler = NIL; Platform_TimeStart = 0; Platform_TimeStart = Platform_Time(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ca01598a..c890c863 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,16 +11,12 @@ typedef char _prvt1[8]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); import BOOLEAN Platform_LittleEndian; import INT64 Platform_MainStackFrame; -import INT32 Platform_HaltCode; import INT16 Platform_PID; import CHAR Platform_CWD[256]; import INT16 Platform_ArgCount; @@ -32,20 +28,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -65,7 +59,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 offset, INT16 whence); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetInterruptHandler (Platform_SignalHandler handler); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import void Platform_SetQuitHandler (Platform_SignalHandler handler); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 3a949175..deefc817 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 216e64dc..6fe829e0 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1d23fdc4..1b2bcbfc 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 38b52f44..89ff4f9d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 45b45394..2a5c9464 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8626628d..5f888271 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5eddf9be..23c71a96 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 48), {0, 28, -12}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 32), {0, -8}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 0ac4141a..9610f289 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 6a24e3cd..124bccb1 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a8951123..46e05141 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 77b842f8..bc68a5c6 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index de6a9e16..dc4c9541 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 29801da0..dcf47b13 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,22 +49,19 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT32 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -84,7 +81,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT32 h, INT32 *l); export INT16 Platform_Sync (INT32 h); @@ -97,10 +93,6 @@ export INT16 Platform_Truncate (INT32 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT32 h, INT32 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -137,8 +129,6 @@ extern void Heap_InitHeap(); #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) @@ -619,128 +609,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0d); - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Type equality failed.", 22); - break; - case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); - break; - case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_EnableVT100 (void) { INT32 mode; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index e96a1eec..714c8e3c 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,9 +11,6 @@ typedef char _prvt1[16]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); @@ -33,20 +30,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT32 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -66,7 +61,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT32 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT32 h, INT32 *l); import INT16 Platform_Sync (INT32 h); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 987b9952..36cd76fb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index e902469a..4bae7210 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 87b0392c..a6d5a403 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -153,7 +153,7 @@ static void Compiler_Trap (INT32 sig) if (sig == 3) { Platform_Exit(0); } else { - if ((sig == 4 && Platform_HaltCode == -15)) { + if (sig == 4) { OPM_LogWStr((CHAR*)" --- Oberon compiler internal error", 36); OPM_LogWLn(); } diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index c15b87f9..d84a7f24 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index f169a3b6..09543f0b 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c519f8d5..fe9b24c9 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 376ef83e..5b66b18a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 806a01db..46f70cc1 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -108,8 +108,8 @@ extern void *Heap__init(); extern ADDRESS Platform_MainStackFrame; extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_HeapModuleInit() Heap__init() +#define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_OSAllocate(size) Platform_OSAllocate(size) -#define Heap_PlatformHalt(code) Platform_Halt(code) #define Heap_PlatformMainStackFrame() Platform_MainStackFrame void Heap_Lock (void) @@ -121,7 +121,7 @@ void Heap_Unlock (void) { Heap_lockdepth -= 1; if ((Heap_interrupted && Heap_lockdepth == 0)) { - Heap_PlatformHalt(-9); + Heap_ModulesHalt(-9); } } diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 2603a3eb..06cbd0ec 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index f463ec4e..494f9fdc 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Heap.h" +#include "Platform.h" typedef struct Modules_CmdDesc *Modules_Cmd; @@ -47,9 +48,16 @@ export ADDRESS *Modules_ModuleDesc__typ; export ADDRESS *Modules_CmdDesc__typ; static void Modules_Append (CHAR *a, LONGINT a__len, CHAR *b, LONGINT b__len); +export void Modules_AssertFail (INT32 code); +static void Modules_DisplayHaltCode (INT32 code); export void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +static void Modules_errch (CHAR c); +export void Modules_errint (INT32 l); +static void Modules_errposint (INT32 l); +export void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -155,6 +163,121 @@ void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all) __DEL(name); } +static void Modules_errch (CHAR c) +{ + INT16 e; + e = Platform_Write(1, (ADDRESS)&c, 1); +} + +void Modules_errstring (CHAR *s, LONGINT s__len) +{ + INT32 i; + __DUP(s, s__len, CHAR); + i = 0; + while ((i < s__len && s[__X(i, s__len)] != 0x00)) { + Modules_errch(s[__X(i, s__len)]); + i += 1; + } + __DEL(s); +} + +static void Modules_errposint (INT32 l) +{ + if (l > 10) { + Modules_errposint(__DIV(l, 10)); + } + Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); +} + +void Modules_errint (INT32 l) +{ + if (l < 0) { + Modules_errch('-'); + l = -l; + } + Modules_errposint(l); +} + +static void Modules_DisplayHaltCode (INT32 code) +{ + switch (code) { + case -1: + Modules_errstring((CHAR*)"Assertion failure.", 19); + break; + case -2: + Modules_errstring((CHAR*)"Index out of range.", 20); + break; + case -3: + Modules_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); + break; + case -4: + Modules_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); + break; + case -5: + Modules_errstring((CHAR*)"Type guard failed.", 19); + break; + case -6: + Modules_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49); + break; + case -7: + Modules_errstring((CHAR*)"Invalid case in WITH statement.", 32); + break; + case -8: + Modules_errstring((CHAR*)"Value out of range.", 20); + break; + case -9: + Modules_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); + break; + case -10: + Modules_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Modules_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Modules_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Modules_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Modules_errstring((CHAR*)"Invalid function argument.", 27); + break; + case -15: + Modules_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); + break; + case -20: + Modules_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); + break; + default: + break; + } +} + +void Modules_Halt (INT32 code) +{ + Modules_errstring((CHAR*)"Terminated by Halt(", 20); + Modules_errint(code); + Modules_errstring((CHAR*)"). ", 4); + if (code < 0) { + Modules_DisplayHaltCode(code); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + +void Modules_AssertFail (INT32 code) +{ + Modules_errstring((CHAR*)"Assertion failure.", 19); + if (code != 0) { + Modules_errstring((CHAR*)" ASSERT code ", 14); + Modules_errint(code); + Modules_errstring((CHAR*)".", 2); + } + Modules_errstring(Platform_NL, 3); + Platform_Exit(code); +} + __TDESC(Modules_ModuleDesc, 1, 2) = {__TDFLDS("ModuleDesc", 64), {0, 32, -24}}; __TDESC(Modules_CmdDesc, 1, 1) = {__TDFLDS("CmdDesc", 40), {0, -16}}; @@ -162,6 +285,7 @@ export void *Modules__init(void) { __DEFMOD; __MODULE_IMPORT(Heap); + __MODULE_IMPORT(Platform); __REGMOD("Modules", 0); __INITYP(Modules_ModuleDesc, Modules_ModuleDesc, 0); __INITYP(Modules_CmdDesc, Modules_CmdDesc, 0); diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2da3fa50..6809ec05 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h @@ -43,9 +43,13 @@ import Modules_ModuleName Modules_imported, Modules_importing; import ADDRESS *Modules_ModuleDesc__typ; import ADDRESS *Modules_CmdDesc__typ; +import void Modules_AssertFail (INT32 code); import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); +import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); +import void Modules_errint (INT32 l); +import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); #define Modules_modules() (Modules_Module)Heap_modules diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index dcac4eb9..8a1b80fe 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index cb6399f9..0caeb234 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 9b3d80c3..c4b9a965 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 6cc996c8..a1917812 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 97726a71..c2258e5b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 91212642..fce0614a 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e3840599..bcedf318 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3cadf5a4..978ccdff 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 898b14b6..845787eb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 34906046..d8134366 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 0a7b463e..896d5ead 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 3a248e3c..e3170fc0 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7c411904..3602bbf6 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 34e34ae6..9d02e218 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index de6a9e16..dc4c9541 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 63fefd3c..247b98de 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 151ed04c..91508fdf 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,22 +49,19 @@ export ADDRESS *Platform_FileIdentity__typ; export BOOLEAN Platform_Absent (INT16 e); export INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -export void Platform_AssertFail (INT32 code); export INT16 Platform_Chdir (CHAR *n, LONGINT n__len); export INT16 Platform_Close (INT64 h); export BOOLEAN Platform_ConnectionFailed (INT16 e); export void Platform_Delay (INT32 ms); export BOOLEAN Platform_DifferentFilesystems (INT16 e); -static void Platform_DisplayHaltCode (INT32 code); static void Platform_EnableVT100 (void); export INT16 Platform_Error (void); -export void Platform_Exit (INT16 code); +export void Platform_Exit (INT32 code); export void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); export void Platform_GetClock (INT32 *t, INT32 *d); export void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); export void Platform_GetIntArg (INT16 n, INT32 *val); export void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -export void Platform_Halt (INT32 code); export INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); export BOOLEAN Platform_Inaccessible (INT16 e); @@ -84,7 +81,6 @@ export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); export INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); export void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -export void Platform_SetHalt (Platform_HaltProcedure p); export void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); export INT16 Platform_Size (INT64 h, INT32 *l); export INT16 Platform_Sync (INT64 h); @@ -97,10 +93,6 @@ export INT16 Platform_Truncate (INT64 h, INT32 limit); export INT16 Platform_Unlink (CHAR *n, LONGINT n__len); export INT16 Platform_Write (INT64 h, INT64 p, INT32 l); static void Platform_YMDHMStoClock (INT16 ye, INT16 mo, INT16 da, INT16 ho, INT16 mi, INT16 se, INT32 *t, INT32 *d); -static void Platform_errch (CHAR c); -static void Platform_errint (INT32 l); -static void Platform_errln (void); -static void Platform_errposint (INT32 l); export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); #include "WindowsWrapper.h" @@ -137,8 +129,6 @@ extern void Heap_InitHeap(); #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) #define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)h) @@ -619,128 +609,11 @@ INT16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len) __RETCHK; } -void Platform_Exit (INT16 code) +void Platform_Exit (INT32 code) { Platform_exit(code); } -static void Platform_errch (CHAR c) -{ - Platform_errc(c); -} - -static void Platform_errln (void) -{ - Platform_errch(0x0d); - Platform_errch(0x0a); -} - -static void Platform_errposint (INT32 l) -{ - if (l > 10) { - Platform_errposint(__DIV(l, 10)); - } - Platform_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -static void Platform_errint (INT32 l) -{ - if (l < 0) { - Platform_errch('-'); - l = -l; - } - Platform_errposint(l); -} - -static void Platform_DisplayHaltCode (INT32 code) -{ - switch (code) { - case -1: - Platform_errstring((CHAR*)"Assertion failure.", 19); - break; - case -2: - Platform_errstring((CHAR*)"Index out of range.", 20); - break; - case -3: - Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49); - break; - case -4: - Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47); - break; - case -5: - Platform_errstring((CHAR*)"Type guard failed.", 19); - break; - case -6: - Platform_errstring((CHAR*)"Type equality failed.", 22); - break; - case -7: - Platform_errstring((CHAR*)"WITH statement type guard failed.", 34); - break; - case -8: - Platform_errstring((CHAR*)"SHORT: Value too large for shorter type.", 41); - break; - case -9: - Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); - break; - case -10: - Platform_errstring((CHAR*)"NIL access.", 12); - break; - case -11: - Platform_errstring((CHAR*)"Alignment error.", 17); - break; - case -12: - Platform_errstring((CHAR*)"Divide by zero.", 16); - break; - case -13: - Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); - break; - case -14: - Platform_errstring((CHAR*)"Invalid function argument.", 27); - break; - case -15: - Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); - break; - case -20: - Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); - break; - default: - break; - } -} - -void Platform_Halt (INT32 code) -{ - Platform_HaltCode = code; - if (Platform_HaltHandler != NIL) { - (*Platform_HaltHandler)(code); - } - Platform_errstring((CHAR*)"Terminated by Halt(", 20); - Platform_errint(code); - Platform_errstring((CHAR*)"). ", 4); - if (code < 0) { - Platform_DisplayHaltCode(code); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_AssertFail (INT32 code) -{ - Platform_errstring((CHAR*)"Assertion failure.", 19); - if (code != 0) { - Platform_errstring((CHAR*)" ASSERT code ", 14); - Platform_errint(code); - Platform_errstring((CHAR*)".", 2); - } - Platform_errln(); - Platform_exit(__VAL(INT16, code)); -} - -void Platform_SetHalt (Platform_HaltProcedure p) -{ - Platform_HaltHandler = p; -} - static void Platform_EnableVT100 (void) { INT32 mode; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index e3841844..c6c57d6a 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h @@ -11,9 +11,6 @@ typedef char _prvt1[16]; } Platform_FileIdentity; -typedef - void (*Platform_HaltProcedure)(INT32); - typedef void (*Platform_SignalHandler)(INT32); @@ -33,20 +30,18 @@ import ADDRESS *Platform_FileIdentity__typ; import BOOLEAN Platform_Absent (INT16 e); import INT16 Platform_ArgPos (CHAR *s, LONGINT s__len); -import void Platform_AssertFail (INT32 code); import INT16 Platform_Chdir (CHAR *n, LONGINT n__len); import INT16 Platform_Close (INT64 h); import BOOLEAN Platform_ConnectionFailed (INT16 e); import void Platform_Delay (INT32 ms); import BOOLEAN Platform_DifferentFilesystems (INT16 e); import INT16 Platform_Error (void); -import void Platform_Exit (INT16 code); +import void Platform_Exit (INT32 code); import void Platform_GetArg (INT16 n, CHAR *val, LONGINT val__len); import void Platform_GetClock (INT32 *t, INT32 *d); import void Platform_GetEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void Platform_GetIntArg (INT16 n, INT32 *val); import void Platform_GetTimeOfDay (INT32 *sec, INT32 *usec); -import void Platform_Halt (INT32 code); import INT16 Platform_Identify (INT64 h, Platform_FileIdentity *identity, ADDRESS *identity__typ); import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, ADDRESS *identity__typ); import BOOLEAN Platform_Inaccessible (INT16 e); @@ -66,7 +61,6 @@ import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentit import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); import INT16 Platform_Seek (INT64 h, INT32 o, INT16 r); import void Platform_SetBadInstructionHandler (Platform_SignalHandler handler); -import void Platform_SetHalt (Platform_HaltProcedure p); import void Platform_SetMTime (Platform_FileIdentity *target, ADDRESS *target__typ, Platform_FileIdentity source); import INT16 Platform_Size (INT64 h, INT32 *l); import INT16 Platform_Sync (INT64 h); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index f7860591..955cd8dc 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 5ed2ec95..fbae270c 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5ae2e44e..07e3b700 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index a9d577f6..e3525cd0 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 3a949175..deefc817 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 216e64dc..6fe829e0 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 01b8a481..97a7d318 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 5ee411dd..577a2d44 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b7d411bb..aac72a79 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index fa08de1c..4f03779e 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 74271e5d..3493ea47 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -7,6 +7,7 @@ #include "SYSTEM.h" #include "Configuration.h" +#include "Modules.h" #include "OPM.h" #include "Out.h" #include "Platform.h" @@ -53,9 +54,9 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN Out_Ln(); } if (status != 0) { - Platform_Halt(status); + Modules_Halt(status); } else { - Platform_Halt(exitcode); + Modules_Halt(exitcode); } } __DEL(title); @@ -114,6 +115,7 @@ export void *extTools__init(void) { __DEFMOD; __MODULE_IMPORT(Configuration); + __MODULE_IMPORT(Modules); __MODULE_IMPORT(OPM); __MODULE_IMPORT(Out); __MODULE_IMPORT(Platform); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 9b7b3c17..691b2968 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/11]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index c8e3c40f..6c6381e6 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -135,9 +135,8 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF sig = 3 THEN Platform.Exit(0) ELSE - IF (sig = 4) & (Platform.HaltCode = -15) THEN - OPM.LogWStr(" --- Oberon compiler internal error"); - OPM.LogWLn + IF sig = 4 THEN + OPM.LogWStr(" --- Oberon compiler internal error"); OPM.LogWLn END ; Platform.Exit(2) END diff --git a/src/compiler/extTools.Mod b/src/compiler/extTools.Mod index 8c84ecae..2847768e 100644 --- a/src/compiler/extTools.Mod +++ b/src/compiler/extTools.Mod @@ -1,6 +1,6 @@ MODULE extTools; -IMPORT Strings, Out, Configuration, Platform, OPM; +IMPORT Strings, Out, Configuration, Platform, Modules, OPM; VAR CFLAGS: ARRAY 1023 OF CHAR; @@ -24,7 +24,7 @@ BEGIN IF (status = 0) & (exitcode = 127) THEN Out.String("Is the C compiler in the current command path?"); Out.Ln END; - IF status # 0 THEN Platform.Halt(status) ELSE Platform.Halt(exitcode) END + IF status # 0 THEN Modules.Halt(status) ELSE Modules.Halt(exitcode) END END; END execute; diff --git a/src/library/s3/ethReals.Mod b/src/library/s3/ethReals.Mod index ea2d9d9f..484b186c 100644 --- a/src/library/s3/ethReals.Mod +++ b/src/library/s3/ethReals.Mod @@ -10,7 +10,7 @@ Implemented by Bernd Moesli, Seminar for Applied Mathematics, Swiss Federal Institute of Technology Z…rich. *) -IMPORT SYSTEM, Platform; +IMPORT SYSTEM, Modules; (* Bernd Moesli Seminar for Applied Mathematics @@ -50,7 +50,7 @@ BEGIN RETURN SHORT(ASH(SYSTEM.VAL(INTEGER, x), -23)) MOD 256 ELSIF SIZE(LONGINT) = 4 THEN RETURN SHORT(ASH(SYSTEM.VAL(LONGINT, x), -23)) MOD 256 - ELSE Platform.Halt(-15); + ELSE Modules.Halt(-15); END END Expo; @@ -77,7 +77,7 @@ BEGIN SYSTEM.GET(SYSTEM.ADR(x), i); i := SHORT(ASH(ASH(ASH(i, -31), 8) + e MOD 256, 23) + i MOD ASH(1, 23)); SYSTEM.PUT(SYSTEM.ADR(x), i) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END SetExpo; @@ -93,7 +93,7 @@ BEGIN SYSTEM.GET(SYSTEM.ADR(x) + H, i); i := SHORT(ASH(ASH(ASH(i, -31), 11) + e MOD 2048, 20) + i MOD ASH(1, 20)); SYSTEM.PUT(SYSTEM.ADR(x) + H, i) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END SetExpoL; @@ -105,7 +105,7 @@ BEGIN SYSTEM.PUT(SYSTEM.ADR(x), h) ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(x), SYSTEM.VAL(INTEGER, h)) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END; RETURN x END Real; @@ -120,7 +120,7 @@ BEGIN ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(x) + H, SYSTEM.VAL(INTEGER, h)); SYSTEM.PUT(SYSTEM.ADR(x) + L, SYSTEM.VAL(INTEGER, l)) - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END; RETURN x END RealL; @@ -133,7 +133,7 @@ BEGIN SYSTEM.PUT(SYSTEM.ADR(l), x); RETURN l ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.PUT(SYSTEM.ADR(i), x); RETURN i - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END Int; @@ -147,7 +147,7 @@ BEGIN ELSIF SIZE(INTEGER) = 4 THEN SYSTEM.GET(SYSTEM.ADR(x) + H, i); h := i; SYSTEM.GET(SYSTEM.ADR(x) + L, i); l := i - ELSE Platform.Halt(-15) + ELSE Modules.Halt(-15) END END IntL; diff --git a/src/runtime/Heap.Mod b/src/runtime/Heap.Mod index a74b4684..550867f7 100644 --- a/src/runtime/Heap.Mod +++ b/src/runtime/Heap.Mod @@ -99,13 +99,13 @@ MODULE Heap; INC(lockdepth); END Lock; - PROCEDURE -PlatformHalt(code: LONGINT) "Platform_Halt(code)"; + PROCEDURE -ModulesHalt(code: LONGINT) "Modules_Halt(code)"; PROCEDURE Unlock*; BEGIN DEC(lockdepth); IF interrupted & (lockdepth = 0) THEN - PlatformHalt(-9); + ModulesHalt(-9); END END Unlock; diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 26268749..33d210d6 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -3,7 +3,7 @@ MODULE Modules; (* jt 6.1.96 *) (* access to list of modules and commands, based on ETH Oberon *) - IMPORT SYSTEM, Heap; + IMPORT SYSTEM, Heap, Platform; CONST ModNameLen* = 20; @@ -93,4 +93,69 @@ MODULE Modules; (* jt 6.1.96 *) END END Free; + + (* Run time error reporting. *) + + PROCEDURE errch(c: CHAR); (* Here we favour simplicity over efficiency, so no buffering. *) + VAR e: Platform.ErrorCode; + BEGIN e := Platform.Write(1, SYSTEM.ADR(c), 1) + END errch; + + PROCEDURE errstring*(s: ARRAY OF CHAR); + VAR i: LONGINT; + BEGIN i := 0; + WHILE (i10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; + + PROCEDURE errint*(l: SYSTEM.INT32); + BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + + PROCEDURE DisplayHaltCode(code: SYSTEM.INT32); + BEGIN + CASE code OF + | -1: errstring("Assertion failure.") + | -2: errstring("Index out of range.") + | -3: errstring("Reached end of function without reaching RETURN.") + | -4: errstring("CASE statement: no matching label and no ELSE.") + | -5: errstring("Type guard failed.") + | -6: errstring("Implicit type guard in record assignment failed.") + | -7: errstring("Invalid case in WITH statement.") + | -8: errstring("Value out of range.") + | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") + |-20: errstring("Too many, or negative number of, elements in dynamic array.") + ELSE + END + END DisplayHaltCode; + + PROCEDURE Halt*(code: SYSTEM.INT32); + BEGIN + (*IF HaltHandler # NIL THEN HaltHandler(code) END;*) + errstring("Terminated by Halt("); errint(code); errstring("). "); + IF code < 0 THEN DisplayHaltCode(code) END; + errstring(Platform.NL); + Platform.Exit(code); + END Halt; + + PROCEDURE AssertFail*(code: SYSTEM.INT32); + BEGIN + errstring("Assertion failure."); + IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; + errstring(Platform.NL); + Platform.Exit(code); + END AssertFail; + + (* + PROCEDURE SetHalt*(p: HaltProcedure); + BEGIN HaltHandler := p; END SetHalt; + *) + END Modules. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 6f7dc4a0..27ce9539 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -28,7 +28,6 @@ TYPE VAR LittleEndian-: BOOLEAN; MainStackFrame-: SYSTEM.ADDRESS; - HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; @@ -131,7 +130,6 @@ BEGIN ArgCount := SYSTEM.VAL(INTEGER, argc); av := SYSTEM.VAL(ArgVecPtr, argvadr); ArgVector := av[0]; - HaltCode := -128; (* This function (Platform.Init) is called at program startup BEFORE any modules have been initalised. In turn we must initialise the heap @@ -464,66 +462,8 @@ END Rename; (* Process termination *) -PROCEDURE -exit(code: INTEGER) "exit(code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; -PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Implicit type guard in record assignment failed.") - | -7: errstring("Invalid case in WITH statement.") - | -8: errstring("Value out of range.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: SYSTEM.INT32); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: SYSTEM.INT32); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; - - +PROCEDURE -exit(code: LONGINT) "exit((int)code)"; +PROCEDURE Exit*(code: LONGINT); BEGIN exit(code) END Exit; @@ -537,7 +477,6 @@ PROCEDURE -getpid(): INTEGER "(INTEGER)getpid()"; BEGIN TestLittleEndian; - HaltCode := -128; HaltHandler := NIL; TimeStart := 0; TimeStart := Time(); PID := getpid(); diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index a52ae92c..937c1da0 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -526,65 +526,8 @@ END Rename; (* Process termination *) -PROCEDURE -exit(code: INTEGER) "ExitProcess((UINT)code)"; -PROCEDURE Exit*(code: INTEGER); -BEGIN exit(code) END Exit; - - -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)Platform_StdOut, &c, 1, 0,0)'; -PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; - -PROCEDURE errposint(l: LONGINT); -BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - -PROCEDURE errint(l: LONGINT); -BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; - -PROCEDURE DisplayHaltCode(code: LONGINT); -BEGIN - CASE code OF - | -1: errstring("Assertion failure.") - | -2: errstring("Index out of range.") - | -3: errstring("Reached end of function without reaching RETURN.") - | -4: errstring("CASE statement: no matching label and no ELSE.") - | -5: errstring("Type guard failed.") - | -6: errstring("Type equality failed.") - | -7: errstring("WITH statement type guard failed.") - | -8: errstring("SHORT: Value too large for shorter type.") - | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-10: errstring("NIL access."); - |-11: errstring("Alignment error."); - |-12: errstring("Divide by zero."); - |-13: errstring("Arithmetic overflow/underflow."); - |-14: errstring("Invalid function argument."); - |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") - |-20: errstring("Too many, or negative number of, elements in dynamic array.") - ELSE - END -END DisplayHaltCode; - -PROCEDURE Halt*(code: SYSTEM.INT32); -BEGIN - HaltCode := code; - IF HaltHandler # NIL THEN HaltHandler(code) END; - errstring("Terminated by Halt("); errint(code); errstring("). "); - IF code < 0 THEN DisplayHaltCode(code) END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END Halt; - -PROCEDURE AssertFail*(code: SYSTEM.INT32); -BEGIN - errstring("Assertion failure."); - IF code # 0 THEN errstring(" ASSERT code "); errint(code); errstring("."); END; - errln; - exit(SYSTEM.VAL(INTEGER,code)); -END AssertFail; - -PROCEDURE SetHalt*(p: HaltProcedure); -BEGIN HaltHandler := p; END SetHalt; +PROCEDURE -exit(code: LONGINT) "ExitProcess((UINT)code)"; +PROCEDURE Exit*(code: LONGINT); BEGIN exit(code) END Exit; PROCEDURE -GetConsoleMode(h: FileHandle; VAR m: SYSTEM.INT32): BOOLEAN "GetConsoleMode((HANDLE)h, (DWORD*)m)"; diff --git a/src/runtime/SYSTEM.h b/src/runtime/SYSTEM.h index d9778393..43baa836 100644 --- a/src/runtime/SYSTEM.h +++ b/src/runtime/SYSTEM.h @@ -103,11 +103,11 @@ extern void Platform_OSFree (ADDRESS addr); // Assertions and Halts -extern void Platform_Halt(INT32 x); -extern void Platform_AssertFail(INT32 x); +extern void Modules_Halt(INT32 x); +extern void Modules_AssertFail(INT32 x); -#define __HALT(x) Platform_Halt(x) -#define __ASSERT(cond, x) if (!(cond)) Platform_AssertFail((INT32)(x)) +#define __HALT(x) Modules_Halt((INT32)(x)) +#define __ASSERT(cond, x) if (!(cond)) Modules_AssertFail((INT32)(x)) // Index checking diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index e5fde295..bb8b0f60 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -122,6 +122,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cp src/runtime/*.[ch] $(BUILDDIR) @printf "$(BUILDDIR) filled with compiler C source.\n" From bb143a6162543af228d4a23fed8d31d608daf748 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 13 Nov 2016 20:35:53 +0000 Subject: [PATCH 120/140] Include Int and Set type size in symbol fingerprint. --- bootstrap/unix-44/Compiler.c | 6 ++++- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 10 ++++++-- bootstrap/unix-44/OPT.h | 6 +++-- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 6 ++++- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 10 ++++++-- bootstrap/unix-48/OPT.h | 6 +++-- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 6 ++++- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 10 ++++++-- bootstrap/unix-88/OPT.h | 6 +++-- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 6 ++++- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 10 ++++++-- bootstrap/windows-48/OPT.h | 6 +++-- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 6 ++++- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 10 ++++++-- bootstrap/windows-88/OPT.h | 6 +++-- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 7 ++++- src/compiler/OPT.Mod | 38 +++++++++++++++------------- 197 files changed, 297 insertions(+), 228 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 3ce83372..ea177995 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index c04d545c..1499df05 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 43d368dd..2394c022 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 0a70d4aa..d2da38f5 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 7f48cd11..df398744 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 90bf9113..8e1abee4 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 8e1a2514..d72c211b 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 3ce83372..ea177995 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index c04d545c..1499df05 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 46e05141..71a6bbe3 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 0a70d4aa..d2da38f5 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 7f48cd11..df398744 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 36cd76fb..b92f9c58 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 4bae7210..0b42a742 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index ba54d44e..0a6a9df0 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ef304bed..ce408573 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 46f70cc1..00665676 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 06cbd0ec..3ab728a5 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 494f9fdc..e7be8295 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index c2258e5b..aace2669 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index bcedf318..9ffb7fc8 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 896d5ead..05d6a917 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 3602bbf6..9cda46a8 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index ad7ed82c..8cd71126 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 76346d8f..d61c6c2d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index c890c863..447f60be 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index deefc817..cfce97a1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 6fe829e0..9455890c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 1b2bcbfc..25a6171e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 89ff4f9d..689c8108 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2a5c9464..85a52286 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 5f888271..a40ef769 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 23c71a96..34a1723e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9610f289..f52f655a 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 124bccb1..3408b3cc 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 46e05141..71a6bbe3 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index bc68a5c6..2f149a8a 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index dc4c9541..e5c33574 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index dcf47b13..1c582348 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 714c8e3c..530f5a80 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 36cd76fb..b92f9c58 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 4bae7210..0b42a742 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index a6d5a403..9d52cfc4 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 @@ -83,7 +83,11 @@ static void Compiler_PropagateElementaryTypeSizes (void) { OPT_Struct adrinttyp = NIL; OPT_sysptrtyp->size = OPM_AddressSize; + OPT_sysptrtyp->idfp = OPT_sysptrtyp->form; + OPM_FPrint(&OPT_sysptrtyp->idfp, OPT_sysptrtyp->size); OPT_adrtyp->size = OPM_AddressSize; + OPT_adrtyp->idfp = OPT_adrtyp->form; + OPM_FPrint(&OPT_adrtyp->idfp, OPT_adrtyp->size); adrinttyp = OPT_IntType(OPM_AddressSize); OPT_adrtyp->strobj = adrinttyp->strobj; OPT_sinttyp = OPT_IntType(OPM_ShortintSize); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index d84a7f24..4e78eeda 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 09543f0b..45384aa2 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index fe9b24c9..8a1b02c3 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 5b66b18a..a798ac33 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 46f70cc1..00665676 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 06cbd0ec..3ab728a5 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 494f9fdc..e7be8295 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6809ec05..7c2a221a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8a1b80fe..f2e99ab3 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 0caeb234..88ed3d3f 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index c4b9a965..90df9e97 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a1917812..cfb3a8bf 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index c2258e5b..aace2669 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index fce0614a..4c5e13a8 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index bcedf318..9ffb7fc8 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 978ccdff..3ddbca21 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 845787eb..91e3a136 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index d8134366..bd0a0e9a 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 896d5ead..05d6a917 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -643,8 +643,11 @@ void OPT_IdFPrint (OPT_Struct typ) typ->idfpdone = 1; idfp = 0; f = typ->form; - c = typ->comp; OPM_FPrint(&idfp, f); + if (__IN(f, 0x90, 32)) { + OPM_FPrint(&idfp, typ->size); + } + c = typ->comp; OPM_FPrint(&idfp, c); btyp = typ->BaseTyp; strobj = typ->strobj; @@ -1903,6 +1906,9 @@ static void OPT_EnterTyp (OPS_Name name, INT8 form, INT16 size, OPT_Struct *res) typ->fpdone = 1; typ->idfp = form; typ->idfpdone = 1; + if (__IN(form, 0x90, 32)) { + OPM_FPrint(&typ->idfp, typ->size); + } *res = typ; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e3170fc0..9850a22e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h @@ -60,7 +60,9 @@ typedef INT16 ref, sysflag; INT32 n, size, align, txtpos; BOOLEAN allocated, pbused, pvused; - char _prvt0[16]; + char _prvt0[4]; + INT32 idfp; + char _prvt1[8]; OPT_Struct BaseTyp; OPT_Object link, strobj; } OPT_StrDesc; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 3602bbf6..9cda46a8 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 9d02e218..ebb01de2 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index dc4c9541..e5c33574 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 247b98de..144d7888 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 91508fdf..0b4778fa 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c6c57d6a..98f9604c 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 955cd8dc..0eecd854 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index fbae270c..1eaca8ec 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 07e3b700..48e0dd7f 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index e3525cd0..17369939 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index deefc817..cfce97a1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 6fe829e0..9455890c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 97a7d318..909f4e92 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 577a2d44..15dc50c5 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index aac72a79..64af94f5 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 4f03779e..1a983a0c 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 3493ea47..e70c387c 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 691b2968..a6813769 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/12]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 6c6381e6..b6683241 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -54,7 +54,12 @@ MODULE Compiler; (* J. Templ 3.2.95 *) VAR adrinttyp: OPT.Struct; BEGIN OPT.sysptrtyp.size := OPM.AddressSize; - OPT.adrtyp.size := OPM.AddressSize; + OPT.sysptrtyp.idfp := OPT.sysptrtyp.form; + OPM.FPrint(OPT.sysptrtyp.idfp, OPT.sysptrtyp.size); + + OPT.adrtyp.size := OPM.AddressSize; + OPT.adrtyp.idfp := OPT.adrtyp.form; + OPM.FPrint(OPT.adrtyp.idfp, OPT.adrtyp.size); adrinttyp := OPT.IntType(OPM.AddressSize); OPT.adrtyp.strobj := adrinttyp.strobj; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index c2e7412f..75ad6c72 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -83,7 +83,7 @@ TYPE allocated*: BOOLEAN; pbused*, pvused*: BOOLEAN; fpdone, idfpdone: BOOLEAN; - idfp, pbfp, pvfp: LONGINT; + idfp*, pbfp, pvfp: LONGINT; BaseTyp*: Struct; link*, strobj*: Object END; @@ -515,21 +515,23 @@ END FPrintSign; PROCEDURE IdFPrint*(typ: Struct); (* idfp codifies assignment compatibility *) VAR btyp: Struct; strobj: Object; idfp: LONGINT; f, c: INTEGER; BEGIN - IF ~typ^.idfpdone THEN - typ^.idfpdone := TRUE; (* may be recursive, temporary idfp is 0 in that case *) - idfp := 0; f := typ^.form; c := typ^.comp; OPM.FPrint(idfp, f); OPM.FPrint(idfp, c); - btyp := typ^.BaseTyp; strobj := typ^.strobj; - IF (strobj # NIL) & (strobj^.name # "") THEN - FPrintName(idfp, GlbMod[typ^.mno]^.name); FPrintName(idfp, strobj^.name) - END; - IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN - IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) - ELSIF c = Array THEN - IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) - ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) - END; - typ^.idfp := idfp - END + IF ~typ^.idfpdone THEN + typ^.idfpdone := TRUE; (* may be recursive, temporary idfp is 0 in that case *) + idfp := 0; + f := typ^.form; OPM.FPrint(idfp, f); IF f IN {Int, Set} THEN OPM.FPrint(idfp, typ.size) END; + c := typ^.comp; OPM.FPrint(idfp, c); + btyp := typ^.BaseTyp; strobj := typ^.strobj; + IF (strobj # NIL) & (strobj^.name # "") THEN + FPrintName(idfp, GlbMod[typ^.mno]^.name); FPrintName(idfp, strobj^.name) + END; + IF (f = Pointer) OR (c = Record) & (btyp # NIL) OR (c = DynArr) THEN + IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp) + ELSIF c = Array THEN + IdFPrint(btyp); OPM.FPrint(idfp, btyp^.idfp); OPM.FPrint(idfp, typ^.n) + ELSIF f = ProcTyp THEN FPrintSign(idfp, btyp, typ^.link) + END; + typ^.idfp := idfp + END END IdFPrint; PROCEDURE FPrintStr*(typ: Struct); @@ -1275,7 +1277,9 @@ END Import; typ := NewStr(form, Basic); obj^.mode := Typ; obj^.typ := typ; obj^.vis := external; typ^.strobj := obj; typ^.size := size; typ^.ref := form; typ^.allocated := TRUE; typ^.pbfp := form; typ^.pvfp := form; typ^.fpdone := TRUE; - typ^.idfp := form; typ^.idfpdone := TRUE; res := typ + typ^.idfp := form; typ^.idfpdone := TRUE; + IF form IN {Int, Set} THEN OPM.FPrint(typ.idfp, typ.size) END; + res := typ END EnterTyp; PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); From f7feea0ad1ce5d57a464bd137dbdaa5b95a74832 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 18:19:56 +0000 Subject: [PATCH 121/140] Tidy browsercmd aka showdef. --- makefile | 2 +- src/runtime/Modules.Mod | 28 +++-- src/tools/browser/BrowserCmd.Mod | 186 +++++++++++++++++-------------- src/tools/make/oberon.mk | 5 +- 4 files changed, 118 insertions(+), 103 deletions(-) diff --git a/makefile b/makefile index 499b5bf0..7f98eb4b 100644 --- a/makefile +++ b/makefile @@ -184,7 +184,7 @@ sourcechanges: # browsercmd: build the 'showdef' command browsercmd: configuration - @make -f src/tools/make/oberon.mk -s browsercmd + @make -f src/tools/make/oberon.mk -s browsercmd MODEL=2 diff --git a/src/runtime/Modules.Mod b/src/runtime/Modules.Mod index 33d210d6..d6b8eeeb 100644 --- a/src/runtime/Modules.Mod +++ b/src/runtime/Modules.Mod @@ -36,13 +36,6 @@ MODULE Modules; (* jt 6.1.96 *) imported*, importing*: ModuleName; - PROCEDURE -modules*(): Module - "(Modules_Module)Heap_modules"; - - PROCEDURE -setmodules*(m: Module) - "Heap_modules = m"; - - PROCEDURE Append(VAR a: ARRAY OF CHAR; b: ARRAY OF CHAR); VAR i, j: INTEGER; BEGIN @@ -51,6 +44,10 @@ MODULE Modules; (* jt 6.1.96 *) a[i] := 0X END Append; + + PROCEDURE -modules(): Module "(Modules_Module)Heap_modules"; + PROCEDURE -setmodules(m: Module) "Heap_modules = m"; + PROCEDURE ThisMod* (name: ARRAY OF CHAR): Module; VAR m: Module; bodyname: ARRAY 64 OF CHAR; body: Command; BEGIN m := modules(); @@ -101,17 +98,18 @@ MODULE Modules; (* jt 6.1.96 *) BEGIN e := Platform.Write(1, SYSTEM.ADR(c), 1) END errch; - PROCEDURE errstring*(s: ARRAY OF CHAR); + PROCEDURE errstring(s: ARRAY OF CHAR); VAR i: LONGINT; - BEGIN i := 0; - WHILE (i10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; - - PROCEDURE errint*(l: SYSTEM.INT32); - BEGIN IF l<0 THEN errch('-'); l := -l END; errposint(l) END errint; + PROCEDURE errint(l: SYSTEM.INT32); + BEGIN + IF l < 0 THEN errch('-'); l := -l END; + IF l >= 10 THEN errint(l DIV 10) END; + errch(CHR(l MOD 10 + 30H)) + END errint; PROCEDURE DisplayHaltCode(code: SYSTEM.INT32); BEGIN diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 3ae3dd5b..dd15c680 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,7 +1,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Out, Platform, SYSTEM; + OPM, OPS, OPT, OPV, Texts, Out, Oberon, Platform, SYSTEM; CONST @@ -12,12 +12,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver option: CHAR; PROCEDURE Ws(s: ARRAY OF CHAR); BEGIN Texts.WriteString(W, s) END Ws; - PROCEDURE Wch(ch: CHAR); BEGIN Texts.Write(W, ch) END Wch; + PROCEDURE Wc(ch: CHAR); BEGIN Texts.Write(W, ch) END Wc; PROCEDURE Wi(i: SYSTEM.INT64); BEGIN Texts.WriteInt(W, i, 0) END Wi; PROCEDURE Wln; BEGIN Texts.WriteLn(W) END Wln; + PROCEDURE Wh(i: SYSTEM.INT64); + BEGIN + IF i >= 16 THEN Wh(i DIV 10H) + ELSIF i >= 10 THEN Wc("0") END; + i := i MOD 16; + IF i < 10 THEN Wc(CHR(i+30H)) ELSE Wc(CHR(i+37H)) END + END Wh; + PROCEDURE Indent(i: INTEGER); - BEGIN WHILE i > 0 DO Wch(" "); Wch(" "); DEC(i) END + BEGIN WHILE i > 0 DO Wc(" "); Wc(" "); DEC(i) END END Indent; PROCEDURE ^Wtype(typ: OPT.Struct); @@ -28,18 +36,26 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN first := TRUE; res := (result # NIL) (* hidden mthd *) & (result # OPT.notyp); paren := res OR (par # NIL); - IF paren THEN Wch("(") END ; + IF paren THEN Wc("(") END; WHILE par # NIL DO - IF ~first THEN Ws("; ") ELSE first := FALSE END ; - IF option = "x" THEN Wi(par^.adr); Wch(" ") END ; - IF par^.mode = OPT.VarPar THEN Ws("VAR ") END ; + IF ~first THEN Ws("; ") ELSE first := FALSE END; + IF option = "x" THEN Wi(par^.adr); Wc(" ") END; + IF par^.mode = OPT.VarPar THEN Ws("VAR ") END; Ws(par^.name); Ws(": "); Wtype(par^.typ); par := par^.link - END ; - IF paren THEN Wch(")") END ; + END; + IF paren THEN Wc(")") END; IF res THEN Ws(": "); Wtype(result) END END Wsign; + PROCEDURE HasForm(obj: OPT.Object; mode: SET): BOOLEAN; + BEGIN + RETURN (obj # NIL) + & ( ((obj.mode IN mode) & (obj.name # "")) + OR HasForm(obj.left, mode) + OR HasForm(obj.right, mode)); + END HasForm; + PROCEDURE Objects(obj: OPT.Object; mode: SET); VAR i: SYSTEM.INT64; m: INTEGER; s: SYSTEM.SET64; ext: OPT.ConstExt; BEGIN @@ -51,58 +67,58 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver CASE obj^.typ^.form OF |OPT.Bool: IF obj^.conval^.intval = 1 THEN Ws("TRUE") ELSE Ws("FALSE") END |OPT.Char: IF (obj^.conval^.intval >= 32) & (obj^.conval^.intval <= 126) THEN - Wch(22X); Wch(CHR(obj^.conval^.intval)); Wch(22X) + Wc(22X); Wc(CHR(obj^.conval^.intval)); Wc(22X) ELSE i := obj^.conval^.intval DIV 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; + IF i > 9 THEN Wc(CHR(55 + i)) ELSE Wc(CHR(48 + i)) END; i := obj^.conval^.intval MOD 16; - IF i > 9 THEN Wch(CHR(55 + i)) ELSE Wch(CHR(48 + i)) END ; - Wch("X") + IF i > 9 THEN Wc(CHR(55 + i)) ELSE Wc(CHR(48 + i)) END; + Wc("X") END |OPT.Int: Wi(obj^.conval^.intval) - |OPT.Set: Wch("{"); i := 0; s := obj^.conval^.setval; + |OPT.Set: Wc("{"); i := 0; s := obj^.conval^.setval; WHILE i <= MAX(SYSTEM.SET64) DO IF i IN s THEN Wi(i); EXCL(s, i); IF s # {} THEN Ws(", ") END - END ; + END; INC(i) - END ; - Wch("}") + END; + Wc("}") |OPT.Real: Texts.WriteReal(W, SHORT(obj^.conval^.realval), 16) |OPT.LReal: Texts.WriteLongReal(W, obj^.conval^.realval, 23) - |OPT.String: Ws(obj^.conval^.ext^) + |OPT.String: Wc('"'); Ws(obj^.conval^.ext^); Wc('"') |OPT.NilTyp: Ws("NIL") ELSE (* Ignore other forms *) - END ; - Wch(";"); Wln + END; + Wc(";"); Wln |OPT.Typ: IF obj^.name # "" THEN Indent(2); IF obj^.typ^.strobj = obj THEN (* canonical name *) Wtype(obj^.typ); Ws(" = "); Wstruct(obj^.typ) ELSE (* alias *) Ws(obj^.name); Ws(" = "); Wtype(obj^.typ) - END ; - Wch(";"); Wln + END; + Wc(";"); Wln END |OPT.Var: Indent(2); Ws(obj^.name); - IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END ; - Wtype(obj^.typ); Wch(";"); Wln + IF obj^.vis = OPT.externalR THEN Ws("-: ") ELSE Ws(": ") END; + Wtype(obj^.typ); Wc(";"); Wln |OPT.XProc, OPT.CProc, OPT.IProc: Indent(1); Ws("PROCEDURE "); - IF obj^.mode = OPT.IProc THEN Wch("+") - ELSIF obj^.mode = OPT.CProc THEN Wch("-") - END ; + IF obj^.mode = OPT.IProc THEN Wc("+") + ELSIF obj^.mode = OPT.CProc THEN Wc("-") + END; Ws(obj^.name); Wsign(obj^.typ, obj^.link); IF obj^.mode = OPT.CProc THEN ext := obj^.conval^.ext; m := ORD(ext^[0]); i := 1; Ws(' "'); - WHILE i <= m DO Wch(ext^[i]); INC(i) END ; - Wch('"'); - END ; - Wch(";"); Wln + WHILE i <= m DO Wc(ext^[i]); INC(i) END; + Wc('"'); + END; + Wc(";"); Wln ELSE (* Ignore other modes *) END - END ; + END; Objects(obj^.right, mode) END END Objects; @@ -115,17 +131,17 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver IF (obj^.mode = OPT.TProc) & ((obj^.name # OPM.HdTProcName) OR (option = "x")) THEN Indent(3); Ws("PROCEDURE ("); IF obj^.name # OPM.HdTProcName THEN - IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END ; + IF obj^.link^.mode = OPT.VarPar THEN Ws("VAR ") END; Ws(obj^.link^.name); Ws(": "); Wtype(obj^.link^.typ) - END ; + END; Ws(") "); Ws(obj^.name); Wsign(obj^.typ, obj^.link^.link); - Wch(";"); + Wc(";"); IF option = "x" THEN Indent(1); Ws("(* methno: "); Wi(obj^.adr DIV 10000H); Ws(" *)") - END ; + END; Wln; - END ; + END; Wmthd(obj^.right) END END Wmthd; @@ -134,10 +150,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver VAR fld: OPT.Object; PROCEDURE SysFlag; - BEGIN - IF typ^.sysflag # 0 THEN - Wch("["); Wi(typ^.sysflag); Ws("] ") - END + BEGIN IF typ^.sysflag # 0 THEN Wc("["); Wh(typ^.sysflag); Ws("H] ") END END SysFlag; BEGIN @@ -149,20 +162,20 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver |OPT.Array: Ws("ARRAY "); SysFlag; Wi(typ^.n); Ws(" OF "); Wtype(typ^.BaseTyp) |OPT.DynArr: Ws("ARRAY "); SysFlag; Ws("OF "); Wtype(typ^.BaseTyp) |OPT.Record: Ws("RECORD ");SysFlag; - IF typ^.BaseTyp # NIL THEN Wch("("); Wtype(typ^.BaseTyp); Wch(")") END ; + IF typ^.BaseTyp # NIL THEN Wc("("); Wtype(typ^.BaseTyp); Wc(")") END; Wln; fld := typ^.link; WHILE (fld # NIL) & (fld^.mode = OPT.Fld) DO IF (option = "x") OR (fld^.name[0] # "@") THEN Indent(3); - IF option = "x" THEN Wi(fld^.adr); Wch(" ") END ; + IF option = "x" THEN Wi(fld^.adr); Wc(" ") END; Ws(fld^.name); - IF fld^.vis = OPT.externalR THEN Wch("-") END ; - Ws(": "); Wtype(fld^.typ); Wch(";"); + IF fld^.vis = OPT.externalR THEN Wc("-") END; + Ws(": "); Wtype(fld^.typ); Wc(";"); Wln - END ; + END; fld := fld^.link - END ; + END; Wmthd(typ^.link); - Indent(2); Ws("END "); + Indent(2); Ws("END"); IF option = "x" THEN Indent(1); Ws("(* size: "); Wi(typ^.size); Ws(" align: "); Wi(typ^.align); Ws(" nofm: "); Wi(typ^.n); Ws(" *)") @@ -178,20 +191,23 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN obj := typ^.strobj; IF obj^.name # "" THEN - IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wch(".") + IF typ^.mno # 0 THEN Ws(OPT.GlbMod[typ^.mno].name); Wc(".") ELSIF (typ = OPT.bytetyp) OR (typ = OPT.sysptrtyp) THEN Ws("SYSTEM.") - ELSIF obj^.vis = OPT.internal THEN Wch("#") - END ; + ELSIF obj^.vis = OPT.internal THEN Wc("#") + END; Ws(obj^.name) ELSE - IF (option = "x") & (typ^.ref > OPM.MaxStruct) THEN Wch("#"); Wi(typ^.ref - OPM.MaxStruct); Wch(" ") END ; + IF (option = "x") & (typ^.ref > OPM.MaxStruct) THEN Wc("#"); Wi(typ^.ref - OPM.MaxStruct); Wc(" ") END; Wstruct(typ) END END Wtype; PROCEDURE WModule(name: OPS.Name; T: Texts.Text); - VAR i: INTEGER; - beg, end: LONGINT; first, done: BOOLEAN; + VAR + i: INTEGER; + beg, end: LONGINT; + first, done: BOOLEAN; + obj: OPT.Object; PROCEDURE Header(s: ARRAY OF CHAR); BEGIN @@ -210,21 +226,24 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN OPT.Import("@notself", name, done); IF done THEN - Ws("DEFINITION "); Ws(name); Wch(";"); Wln; Wln; - Header("IMPORT"); i := 1; first := TRUE; - WHILE i < OPT.nofGmod DO - IF first THEN first := FALSE; Indent(2) ELSE Ws(", ") END ; - Ws(OPT.GlbMod[i].name); - INC(i) - END ; - IF ~first THEN Wch(";"); Wln END ; + Ws("DEFINITION "); Ws(name); Wc(";"); Wln; + + IF OPT.nofGmod > 1 THEN + Header("IMPORT"); i := 1; first := TRUE; + WHILE i < OPT.nofGmod DO + IF first THEN first := FALSE; Indent(2) ELSE Ws(", ") END; + Ws(OPT.GlbMod[i].name); + INC(i) + END; + IF ~first THEN Wc(";"); Wln END + END; CheckHeader; - Header("CONST"); Objects(OPT.GlbMod[0].right, {OPT.Con}); CheckHeader; - Header("TYPE"); Objects(OPT.GlbMod[0].right, {OPT.Typ}); CheckHeader; - Header("VAR"); Objects(OPT.GlbMod[0].right, {OPT.Var}); CheckHeader; - Objects(OPT.GlbMod[0].right, {OPT.XProc, OPT.IProc, OPT.CProc}); - Wln; - Ws("END "); Ws(name); Wch("."); Wln; Texts.Append(T, W.buf) + obj := OPT.GlbMod[0].right; + IF HasForm(obj, {OPT.Con}) THEN Header("CONST"); Objects(obj, {OPT.Con}); CheckHeader END; + IF HasForm(obj, {OPT.Typ}) THEN Header("TYPE"); Objects(obj, {OPT.Typ}); CheckHeader END; + IF HasForm(obj, {OPT.Var}) THEN Header("VAR"); Objects(obj, {OPT.Var}); CheckHeader END; + Objects(obj, {OPT.XProc, OPT.IProc, OPT.CProc}); Wln; + Ws("END "); Ws(name); Wc("."); Wln; Texts.Append(T, W.buf) ELSE Texts.WriteString(W, name); Texts.WriteString(W, " -- symbol file not found"); Texts.WriteLn(W); Texts.Append(T, W.buf) @@ -232,37 +251,34 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver END WModule; PROCEDURE Ident(VAR name, first: ARRAY OF CHAR); - VAR i, j: INTEGER; ch: CHAR; + VAR i, j: INTEGER; ch: CHAR; BEGIN i := 0; - WHILE name[i] # 0X DO INC(i) END ; - WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END ; + WHILE name[i] # 0X DO INC(i) END; + WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END; INC(i); j := 0; ch := name[i]; - WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END ; + WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END; first[j] := 0X END Ident; PROCEDURE ShowDef*; - VAR T, dummyT: Texts.Text; S, vname, name: OPS.Name; R: Texts.Reader; ch: CHAR; - s: ARRAY 1024 OF CHAR; i: INTEGER; + VAR S, vname, name: OPS.Name; BEGIN option := 0X; Platform.GetArg(1, S); IF Platform.ArgCount > 2 THEN IF S[0] = OptionChar THEN option := S[1]; Platform.GetArg(2, S) ELSE Platform.GetArg(2, vname); option := vname[1] END - END ; + END; IF Platform.ArgCount >= 2 THEN Ident(S, name); - NEW(T); Texts.Open(T, ""); - OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; WModule(name, T); OPT.Close; - Texts.OpenReader(R, T, 0); Texts.Read(R, ch); i := 0; - WHILE ~R.eot DO - IF ch = 0DX THEN s[i] := 0X; i := 0; Out.String(s); Out.Ln - ELSE s[i] := ch; INC(i) - END ; - Texts.Read(R, ch) - END ; - s[i] := 0X; Out.String(s) + OPT.Init(name, {}); OPT.SelfName := "AvoidErr154"; + WModule(name, Oberon.Log); + OPT.Close; + ELSE + Texts.WriteString(W, "showdef - Display module's public interface."); Texts.WriteLn(W); + Texts.WriteString(W, "Usage: showdef module"); Texts.WriteLn(W); + Texts.WriteString(W, "Note: module.sym must be in the current directory."); Texts.WriteLn(W); + Texts.Append(Oberon.Log, W.buf) END END ShowDef; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index bb8b0f60..f9ae45a4 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -130,8 +130,9 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -fSm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod - @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c -o showdef \ + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssf -O$(MODEL) ../../src/runtime/Oberon.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ OPC.o From 377bc73774f0667530d8205d74d928a0c516ded8 Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 21:00:34 +0000 Subject: [PATCH 122/140] Restore text file based error support as prototyped in the ErrorExperiment branch. --- .gitignore | 4 + bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Modules.c | 22 +-- bootstrap/unix-44/Modules.h | 4 - bootstrap/unix-44/OPM.c | 28 +++- bootstrap/unix-44/errors.c | 205 ------------------------- bootstrap/unix-44/errors.h | 18 --- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Modules.c | 22 +-- bootstrap/unix-48/Modules.h | 4 - bootstrap/unix-48/OPM.c | 28 +++- bootstrap/unix-48/errors.c | 205 ------------------------- bootstrap/unix-48/errors.h | 18 --- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Modules.c | 22 +-- bootstrap/unix-88/Modules.h | 4 - bootstrap/unix-88/OPM.c | 28 +++- bootstrap/unix-88/errors.c | 205 ------------------------- bootstrap/unix-88/errors.h | 18 --- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Modules.c | 22 +-- bootstrap/windows-48/Modules.h | 4 - bootstrap/windows-48/OPM.c | 28 +++- bootstrap/windows-48/errors.c | 205 ------------------------- bootstrap/windows-48/errors.h | 18 --- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Modules.c | 22 +-- bootstrap/windows-88/Modules.h | 4 - bootstrap/windows-88/OPM.c | 28 +++- bootstrap/windows-88/errors.c | 205 ------------------------- bootstrap/windows-88/errors.h | 18 --- makefile | 5 + src/compiler/OPM.Mod | 37 ++++- src/compiler/errors.Mod | 215 --------------------------- src/runtime/Errors.Txt | 194 ++++++++++++++++++++++++ src/tools/make/oberon.mk | 22 ++- 36 files changed, 393 insertions(+), 1479 deletions(-) delete mode 100644 bootstrap/unix-44/errors.c delete mode 100644 bootstrap/unix-44/errors.h delete mode 100644 bootstrap/unix-48/errors.c delete mode 100644 bootstrap/unix-48/errors.h delete mode 100644 bootstrap/unix-88/errors.c delete mode 100644 bootstrap/unix-88/errors.h delete mode 100644 bootstrap/windows-48/errors.c delete mode 100644 bootstrap/windows-48/errors.h delete mode 100644 bootstrap/windows-88/errors.c delete mode 100644 bootstrap/windows-88/errors.h delete mode 100644 src/compiler/errors.Mod create mode 100644 src/runtime/Errors.Txt diff --git a/.gitignore b/.gitignore index a8e5ff00..1c2d92dd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /*.sym /*.asm /*.mod +/Errors.txt /olang /src/test/**/*.exe /src/test/**/*.c @@ -24,6 +25,9 @@ /src/test/confidence/**/*.asm /src/test/confidence/**/*.s /src/test/confidence/**/*.map +/bootstrap/*/SYSTEM.[ch] +/bootstrap/*/Errors.Txt +/bootstrap/*/WindowsWrapper.h /.DS_store **/.DS_store **/*.dSYM diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-44/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-44/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-48/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-48/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index e7be8295..8432576a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index aace2669..5f5d6792 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/unix-88/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/unix-88/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 34a1723e..5fb74ad0 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index f52f655a..a5afb71e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 48, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 20, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 20, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 20, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/windows-48/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/windows-48/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 4e78eeda..40f3ddee 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index e7be8295..8432576a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -55,9 +55,8 @@ export void Modules_Halt (INT32 code); export Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); export Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); static void Modules_errch (CHAR c); -export void Modules_errint (INT32 l); -static void Modules_errposint (INT32 l); -export void Modules_errstring (CHAR *s, LONGINT s__len); +static void Modules_errint (INT32 l); +static void Modules_errstring (CHAR *s, LONGINT s__len); #define Modules_modules() (Modules_Module)Heap_modules #define Modules_setmodules(m) Heap_modules = m @@ -169,7 +168,7 @@ static void Modules_errch (CHAR c) e = Platform_Write(1, (ADDRESS)&c, 1); } -void Modules_errstring (CHAR *s, LONGINT s__len) +static void Modules_errstring (CHAR *s, LONGINT s__len) { INT32 i; __DUP(s, s__len, CHAR); @@ -181,21 +180,16 @@ void Modules_errstring (CHAR *s, LONGINT s__len) __DEL(s); } -static void Modules_errposint (INT32 l) -{ - if (l > 10) { - Modules_errposint(__DIV(l, 10)); - } - Modules_errch((CHAR)(48 + (int)__MOD(l, 10))); -} - -void Modules_errint (INT32 l) +static void Modules_errint (INT32 l) { if (l < 0) { Modules_errch('-'); l = -l; } - Modules_errposint(l); + if (l >= 10) { + Modules_errint(__DIV(l, 10)); + } + Modules_errch((CHAR)((int)__MOD(l, 10) + 48)); } static void Modules_DisplayHaltCode (INT32 code) diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7c2a221a..66c0c947 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -48,11 +48,7 @@ import void Modules_Free (CHAR *name, LONGINT name__len, BOOLEAN all); import void Modules_Halt (INT32 code); import Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT name__len); import Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len); -import void Modules_errint (INT32 l); -import void Modules_errstring (CHAR *s, LONGINT s__len); import void *Modules__init(void); -#define Modules_modules() (Modules_Module)Heap_modules -#define Modules_setmodules(m) Heap_modules = m #endif // Modules diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index aace2669..5f5d6792 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -13,7 +13,6 @@ #include "Strings.h" #include "Texts.h" #include "VT100.h" -#include "errors.h" typedef CHAR OPM_FileName[32]; @@ -37,7 +36,7 @@ export CHAR OPM_modName[32]; export CHAR OPM_objname[64]; static INT32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos; static Texts_Reader OPM_inR; -static Texts_Text OPM_Log; +static Texts_Text OPM_Log, OPM_Errors; static Files_Rider OPM_oldSF, OPM_newSF; static Files_Rider OPM_R[3]; static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile; @@ -536,11 +535,9 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN static void OPM_LogErrMsg (INT16 n) { + INT16 l; Texts_Scanner S; - Texts_Text T = NIL; - CHAR ch; - INT16 i; - CHAR buf[1024]; + CHAR c; if (n >= 0) { if (!__IN(16, OPM_Options, 32)) { VT100_SetAttr((CHAR*)"31m", 4); @@ -561,7 +558,22 @@ static void OPM_LogErrMsg (INT16 n) } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); - OPM_LogWStr(errors_errors[__X(n, 350)], 128); + if (OPM_Errors == NIL) { + __NEW(OPM_Errors, Texts_TextDesc); + Texts_Open(OPM_Errors, (CHAR*)"Errors.Txt", 11); + } + Texts_OpenScanner(&S, Texts_Scanner__typ, OPM_Errors, 0); + do { + l = S.line; + Texts_Scan(&S, Texts_Scanner__typ); + } while (!((((l != S.line && S.class == 3)) && S.i == n) || S.eot)); + if (!S.eot) { + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + while ((!S.eot && c >= ' ')) { + Out_Char(c); + Texts_Read((void*)&S, Texts_Scanner__typ, &c); + } + } } static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos) @@ -1043,6 +1055,7 @@ static void EnumPtrs(void (*P)(void*)) { __ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P); P(OPM_Log); + P(OPM_Errors); __ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P); __ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P); __ENUMR(OPM_R, Files_Rider__typ, 24, 3, P); @@ -1064,7 +1077,6 @@ export void *OPM__init(void) __MODULE_IMPORT(Strings); __MODULE_IMPORT(Texts); __MODULE_IMPORT(VT100); - __MODULE_IMPORT(errors); __REGMOD("OPM", EnumPtrs); __REGCMD("CloseFiles", OPM_CloseFiles); __REGCMD("CloseOldSym", OPM_CloseOldSym); diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c deleted file mode 100644 index 64af94f5..00000000 --- a/bootstrap/windows-88/errors.c +++ /dev/null @@ -1,205 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#define SHORTINT INT8 -#define INTEGER INT16 -#define LONGINT INT32 -#define SET UINT32 - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -export errors_string errors_errors[350]; - - - - - -export void *errors__init(void) -{ - __DEFMOD; - __REGMOD("errors", 0); -/* BEGIN */ - __MOVE("undeclared identifier", errors_errors[0], 22); - __MOVE("multiply defined identifier", errors_errors[1], 28); - __MOVE("illegal character in number", errors_errors[2], 28); - __MOVE("illegal character in string", errors_errors[3], 28); - __MOVE("identifier does not match procedure name", errors_errors[4], 41); - __MOVE("comment not closed", errors_errors[5], 19); - errors_errors[6][0] = 0x00; - errors_errors[7][0] = 0x00; - errors_errors[8][0] = 0x00; - __MOVE("'=' expected", errors_errors[9], 13); - errors_errors[10][0] = 0x00; - errors_errors[11][0] = 0x00; - __MOVE("type definition starts with incorrect symbol", errors_errors[12], 45); - __MOVE("factor starts with incorrect symbol", errors_errors[13], 36); - __MOVE("statement starts with incorrect symbol", errors_errors[14], 39); - __MOVE("declaration followed by incorrect symbol", errors_errors[15], 41); - __MOVE("MODULE expected", errors_errors[16], 16); - errors_errors[17][0] = 0x00; - __MOVE("'.' missing", errors_errors[18], 12); - __MOVE("',' missing", errors_errors[19], 12); - __MOVE("':' missing", errors_errors[20], 12); - errors_errors[21][0] = 0x00; - __MOVE("')' missing", errors_errors[22], 12); - __MOVE("']' missing", errors_errors[23], 12); - __MOVE("'}' missing", errors_errors[24], 12); - __MOVE("OF missing", errors_errors[25], 11); - __MOVE("THEN missing", errors_errors[26], 13); - __MOVE("DO missing", errors_errors[27], 11); - __MOVE("TO missing", errors_errors[28], 11); - errors_errors[29][0] = 0x00; - __MOVE("'(' missing", errors_errors[30], 12); - errors_errors[31][0] = 0x00; - errors_errors[32][0] = 0x00; - errors_errors[33][0] = 0x00; - __MOVE("':=' missing", errors_errors[34], 13); - __MOVE("',' or OF expected", errors_errors[35], 19); - errors_errors[36][0] = 0x00; - errors_errors[37][0] = 0x00; - __MOVE("identifier expected", errors_errors[38], 20); - __MOVE("';' missing", errors_errors[39], 12); - errors_errors[40][0] = 0x00; - __MOVE("END missing", errors_errors[41], 12); - errors_errors[42][0] = 0x00; - errors_errors[43][0] = 0x00; - __MOVE("UNTIL missing", errors_errors[44], 14); - errors_errors[45][0] = 0x00; - __MOVE("EXIT not within loop statement", errors_errors[46], 31); - __MOVE("illegally marked identifier", errors_errors[47], 28); - errors_errors[48][0] = 0x00; - errors_errors[49][0] = 0x00; - __MOVE("expression should be constant", errors_errors[50], 30); - __MOVE("constant not an integer", errors_errors[51], 24); - __MOVE("identifier does not denote a type", errors_errors[52], 34); - __MOVE("identifier does not denote a record type", errors_errors[53], 41); - __MOVE("result type of procedure is not a basic type", errors_errors[54], 45); - __MOVE("procedure call of a function", errors_errors[55], 29); - __MOVE("assignment to non-variable", errors_errors[56], 27); - __MOVE("pointer not bound to record or array type", errors_errors[57], 42); - __MOVE("recursive type definition", errors_errors[58], 26); - __MOVE("illegal open array parameter", errors_errors[59], 29); - __MOVE("wrong type of case label", errors_errors[60], 25); - __MOVE("inadmissible type of case label", errors_errors[61], 32); - __MOVE("case label defined more than once", errors_errors[62], 34); - __MOVE("illegal value of constant", errors_errors[63], 26); - __MOVE("more actual than formal parameters", errors_errors[64], 35); - __MOVE("fewer actual than formal parameters", errors_errors[65], 36); - __MOVE("element types of actual array and formal open array differ", errors_errors[66], 59); - __MOVE("actual parameter corresponding to open array is not an array", errors_errors[67], 61); - __MOVE("control variable must be integer", errors_errors[68], 33); - __MOVE("parameter must be an integer constant", errors_errors[69], 38); - __MOVE("pointer or VAR record required as formal receiver", errors_errors[70], 50); - __MOVE("pointer expected as actual receiver", errors_errors[71], 36); - __MOVE("procedure must be bound to a record of the same scope", errors_errors[72], 54); - __MOVE("procedure must have level 0", errors_errors[73], 28); - __MOVE("procedure unknown in base type", errors_errors[74], 31); - __MOVE("invalid call of base procedure", errors_errors[75], 31); - __MOVE("this variable (field) is read only", errors_errors[76], 35); - __MOVE("object is not a record", errors_errors[77], 23); - __MOVE("dereferenced object is not a variable", errors_errors[78], 38); - __MOVE("indexed object is not a variable", errors_errors[79], 33); - __MOVE("index expression is not an integer", errors_errors[80], 35); - __MOVE("index out of specified bounds", errors_errors[81], 30); - __MOVE("indexed variable is not an array", errors_errors[82], 33); - __MOVE("undefined record field", errors_errors[83], 23); - __MOVE("dereferenced variable is not a pointer", errors_errors[84], 39); - __MOVE("guard or test type is not an extension of variable type", errors_errors[85], 56); - __MOVE("guard or testtype is not a pointer", errors_errors[86], 35); - __MOVE("guarded or tested variable is neither a pointer nor a VAR-parameter record", errors_errors[87], 75); - __MOVE("open array not allowed as variable, record field or array element", errors_errors[88], 66); - errors_errors[89][0] = 0x00; - errors_errors[90][0] = 0x00; - errors_errors[91][0] = 0x00; - __MOVE("operand of IN not an integer, or not a set", errors_errors[92], 43); - __MOVE("set element type is not an integer", errors_errors[93], 35); - __MOVE("operand of & is not of type BOOLEAN", errors_errors[94], 36); - __MOVE("operand of OR is not of type BOOLEAN", errors_errors[95], 37); - __MOVE("operand not applicable to (unary) +", errors_errors[96], 36); - __MOVE("operand not applicable to (unary) -", errors_errors[97], 36); - __MOVE("operand of ~ is not of type BOOLEAN", errors_errors[98], 36); - __MOVE("ASSERT fault", errors_errors[99], 13); - __MOVE("incompatible operands of dyadic operator", errors_errors[100], 41); - __MOVE("operand type inapplicable to *", errors_errors[101], 31); - __MOVE("operand type inapplicable to /", errors_errors[102], 31); - __MOVE("operand type inapplicable to DIV", errors_errors[103], 33); - __MOVE("operand type inapplicable to MOD", errors_errors[104], 33); - __MOVE("operand type inapplicable to +", errors_errors[105], 31); - __MOVE("operand type inapplicable to -", errors_errors[106], 31); - __MOVE("operand type inapplicable to = or #", errors_errors[107], 36); - __MOVE("operand type inapplicable to relation", errors_errors[108], 38); - __MOVE("overriding method must be exported", errors_errors[109], 35); - __MOVE("operand is not a type", errors_errors[110], 22); - __MOVE("operand inapplicable to (this) function", errors_errors[111], 40); - __MOVE("operand is not a variable", errors_errors[112], 26); - __MOVE("incompatible assignment", errors_errors[113], 24); - __MOVE("string too long to be assigned", errors_errors[114], 31); - __MOVE("parameter doesn't match", errors_errors[115], 24); - __MOVE("number of parameters doesn't match", errors_errors[116], 35); - __MOVE("result type doesn't match", errors_errors[117], 26); - __MOVE("export mark doesn't match with forward declaration", errors_errors[118], 51); - __MOVE("redefinition textually precedes procedure bound to base type", errors_errors[119], 61); - __MOVE("type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN", errors_errors[120], 71); - __MOVE("called object is not a procedure (or is an interrupt procedure)", errors_errors[121], 64); - __MOVE("actual VAR-parameter is not a variable", errors_errors[122], 39); - __MOVE("type of actual parameter is not identical with that of formal VAR-parameter", errors_errors[123], 76); - __MOVE("type of result expression differs from that of procedure", errors_errors[124], 57); - __MOVE("type of case expression is neither INTEGER nor CHAR", errors_errors[125], 52); - __MOVE("this expression cannot be a type or a procedure", errors_errors[126], 48); - __MOVE("illegal use of object", errors_errors[127], 22); - __MOVE("unsatisfied forward reference", errors_errors[128], 30); - __MOVE("unsatisfied forward procedure", errors_errors[129], 30); - __MOVE("WITH clause does not specify a variable", errors_errors[130], 40); - __MOVE("LEN not applied to array", errors_errors[131], 25); - __MOVE("dimension in LEN too large or negative", errors_errors[132], 39); - __MOVE("SYSTEM not imported", errors_errors[135], 20); - __MOVE("key inconsistency of imported module", errors_errors[150], 37); - __MOVE("incorrect symbol file", errors_errors[151], 22); - __MOVE("symbol file of imported module not found", errors_errors[152], 41); - __MOVE("object or symbol file not opened (disk full\?)", errors_errors[153], 46); - __MOVE("recursive import not allowed", errors_errors[154], 29); - __MOVE("generation of new symbol file not allowed", errors_errors[155], 42); - __MOVE("parameter file not found", errors_errors[156], 25); - __MOVE("syntax error in parameter file", errors_errors[157], 31); - __MOVE("not yet implemented", errors_errors[200], 20); - __MOVE("lower bound of set range greater than higher bound", errors_errors[201], 51); - __MOVE("set element greater than MAX(SET) or less than 0", errors_errors[202], 49); - __MOVE("number too large", errors_errors[203], 17); - __MOVE("product too large", errors_errors[204], 18); - __MOVE("division by zero", errors_errors[205], 17); - __MOVE("sum too large", errors_errors[206], 14); - __MOVE("difference too large", errors_errors[207], 21); - __MOVE("overflow in arithmetic shift", errors_errors[208], 29); - __MOVE("case range too large", errors_errors[209], 21); - __MOVE("too many cases in case statement", errors_errors[213], 33); - __MOVE("illegal value of parameter (0 <= p < 256)", errors_errors[218], 42); - __MOVE("machine registers cannot be accessed", errors_errors[219], 37); - __MOVE("illegal value of parameter", errors_errors[220], 27); - __MOVE("too many pointers in a record", errors_errors[221], 30); - __MOVE("too many global pointers", errors_errors[222], 25); - __MOVE("too many record types", errors_errors[223], 22); - __MOVE("too many pointer types", errors_errors[224], 23); - __MOVE("address of pointer variable too large (move forward in text)", errors_errors[225], 61); - __MOVE("too many exported procedures", errors_errors[226], 29); - __MOVE("too many imported modules", errors_errors[227], 26); - __MOVE("too many exported structures", errors_errors[228], 29); - __MOVE("too many nested records for import", errors_errors[229], 35); - __MOVE("too many constants (strings) in module", errors_errors[230], 39); - __MOVE("too many link table entries (external procedures)", errors_errors[231], 50); - __MOVE("too many commands in module", errors_errors[232], 28); - __MOVE("record extension hierarchy too high", errors_errors[233], 36); - __MOVE("export of recursive type not allowed", errors_errors[234], 37); - __MOVE("identifier too long", errors_errors[240], 20); - __MOVE("string too long", errors_errors[241], 16); - __MOVE("address overflow", errors_errors[242], 17); - __MOVE("cyclic type definition not allowed", errors_errors[244], 35); - __MOVE("guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable", errors_errors[245], 100); - __MOVE("implicit type cast", errors_errors[301], 19); - __MOVE("inappropriate symbol file ignored", errors_errors[306], 34); - __MOVE("no ELSE symbol after CASE statement sequence may lead to trap", errors_errors[307], 62); - __MOVE("SYSTEM.VAL result includes memory past end of source variable", errors_errors[308], 62); - __ENDMOD; -} diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h deleted file mode 100644 index 1a983a0c..00000000 --- a/bootstrap/windows-88/errors.h +++ /dev/null @@ -1,18 +0,0 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ - -#ifndef errors__h -#define errors__h - -#include "SYSTEM.h" - -typedef - CHAR errors_string[128]; - - -import errors_string errors_errors[350]; - - -import void *errors__init(void); - - -#endif // errors diff --git a/makefile b/makefile index 7f98eb4b..39da025f 100644 --- a/makefile +++ b/makefile @@ -170,6 +170,11 @@ assemble: @make -f src/tools/make/oberon.mk -s assemble MODEL=2 +compilerfromsavedsource: + @make -f src/tools/make/oberon.mk -s compilerfromsavedsource + + + # compile: compiler only, without cleaning compiler: configuration @make -f src/tools/make/oberon.mk -s translate MODEL=2 diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f765cd2e..02439e66 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -4,7 +4,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) 31.1.2007 jt synchronized with BlackBox version, in particular PromoteIntConstToLInt added *) - IMPORT SYSTEM, Texts, Files, Platform, Out, errors, Configuration, VT100, Strings; + IMPORT SYSTEM, Texts, Files, Platform, Out, Configuration, VT100, Strings; CONST OptionChar* = "-"; @@ -111,7 +111,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) lasterrpos: LONGINT; inR: Texts.Reader; - Log: Texts.Text; + Log, Errors: Texts.Text; oldSF, newSF: Files.Rider; R: ARRAY 3 OF Files.Rider; @@ -420,10 +420,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogErrMsg(n: INTEGER); - VAR - S: Texts.Scanner; T: Texts.Text; - ch: CHAR; i: INTEGER; - buf: ARRAY 1024 OF CHAR; + VAR l: INTEGER; S: Texts.Scanner; c: CHAR; BEGIN IF n >= 0 THEN IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; @@ -436,6 +433,32 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END ; LogWNum(n, 1); LogWStr(" "); + + IF Errors = NIL THEN NEW(Errors); Texts.Open(Errors, "Errors.Txt") END; + Texts.OpenScanner(S, Errors, 0); + REPEAT l := S.line; Texts.Scan(S) + UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; + IF ~S.eot THEN + Texts.Read(S, c); + WHILE ~S.eot & (c >= ' ') DO Out.Char(c); Texts.Read(S, c) END + END + + +(* --- +VAR T: Texts.Text; S: Texts.Scanner; + +PROCEDURE Write*(n: INTEGER); + VAR l: INTEGER; c: CHAR; +BEGIN + IF T = NIL THEN NEW(T); Texts.Open(T, "VishapOberonErrors.txt") END; + Texts.OpenScanner(S, T, 0); + REPEAT l := S.line; Texts.Scan(S) + UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; + IF ~S.eot THEN Texts.Read(S, c); + WHILE ~S.eot & (c >= ' ') DO Console.Char(c); Texts.Read(S, c) END + END +END Write; + (*NEW(T); Texts.Open(T, "vocErrors.Text"); Texts.OpenScanner(S, T, 0); REPEAT S.line := 0; REPEAT Texts.Scan(S) UNTIL S.eot OR (S.line # 0) @@ -445,6 +468,8 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) buf[i] := 0X; LogWStr(buf); END*) LogWStr(errors.errors[n]); + +--- *) END LogErrMsg; diff --git a/src/compiler/errors.Mod b/src/compiler/errors.Mod deleted file mode 100644 index 1546aa8c..00000000 --- a/src/compiler/errors.Mod +++ /dev/null @@ -1,215 +0,0 @@ -MODULE errors; - -TYPE string* = ARRAY 128 OF CHAR; - -VAR errors- : ARRAY 350 OF string; - - -BEGIN -(* Incorrect use of the language Oberon *) -errors[0] := "undeclared identifier"; -errors[1] := "multiply defined identifier"; -errors[2] := "illegal character in number"; -errors[3] := "illegal character in string"; -errors[4] := "identifier does not match procedure name"; -errors[5] := "comment not closed"; -errors[6] := ""; -errors[7] := ""; -errors[8] := ""; -errors[9] := "'=' expected"; -errors[10] :=""; -errors[11] :=""; -errors[12] := "type definition starts with incorrect symbol"; -errors[13] := "factor starts with incorrect symbol"; -errors[14] := "statement starts with incorrect symbol"; -errors[15] := "declaration followed by incorrect symbol"; -errors[16] := "MODULE expected"; -errors[17] := ""; -errors[18] := "'.' missing"; -errors[19] := "',' missing"; -errors[20] := "':' missing"; -errors[21] := ""; -errors[22] := "')' missing"; -errors[23] := "']' missing"; -errors[24] := "'}' missing"; -errors[25] := "OF missing"; -errors[26] := "THEN missing"; -errors[27] := "DO missing"; -errors[28] := "TO missing"; -errors[29] := ""; -errors[30] := "'(' missing"; -errors[31] := ""; -errors[32] := ""; -errors[33] := ""; -errors[34] := "':=' missing"; -errors[35] := "',' or OF expected"; -errors[36] := ""; -errors[37] := ""; -errors[38] := "identifier expected"; -errors[39] := "';' missing"; -errors[40] := ""; -errors[41] := "END missing"; -errors[42] := ""; -errors[43] := ""; -errors[44] := "UNTIL missing"; -errors[45] := ""; -errors[46] := "EXIT not within loop statement"; -errors[47] := "illegally marked identifier"; -errors[48] := ""; -errors[49] := ""; -errors[50] := "expression should be constant"; -errors[51] := "constant not an integer"; -errors[52] := "identifier does not denote a type"; -errors[53] := "identifier does not denote a record type"; -errors[54] := "result type of procedure is not a basic type"; -errors[55] := "procedure call of a function"; -errors[56] := "assignment to non-variable"; -errors[57] := "pointer not bound to record or array type"; -errors[58] := "recursive type definition"; -errors[59] := "illegal open array parameter"; -errors[60] := "wrong type of case label"; -errors[61] := "inadmissible type of case label"; -errors[62] := "case label defined more than once"; -errors[63] := "illegal value of constant"; -errors[64] := "more actual than formal parameters"; -errors[65] := "fewer actual than formal parameters"; -errors[66] := "element types of actual array and formal open array differ"; -errors[67] := "actual parameter corresponding to open array is not an array"; -errors[68] := "control variable must be integer"; -errors[69] := "parameter must be an integer constant"; -errors[70] := "pointer or VAR record required as formal receiver"; -errors[71] := "pointer expected as actual receiver"; -errors[72] := "procedure must be bound to a record of the same scope"; -errors[73] := "procedure must have level 0"; -errors[74] := "procedure unknown in base type"; -errors[75] := "invalid call of base procedure"; -errors[76] := "this variable (field) is read only"; -errors[77] := "object is not a record"; -errors[78] := "dereferenced object is not a variable"; -errors[79] := "indexed object is not a variable"; -errors[80] := "index expression is not an integer"; -errors[81] := "index out of specified bounds"; -errors[82] := "indexed variable is not an array"; -errors[83] := "undefined record field"; -errors[84] := "dereferenced variable is not a pointer"; -errors[85] := "guard or test type is not an extension of variable type"; -errors[86] := "guard or testtype is not a pointer"; -errors[87] := "guarded or tested variable is neither a pointer nor a VAR-parameter record"; -errors[88] := "open array not allowed as variable, record field or array element"; -errors[89] := ""; -errors[90] := ""; -errors[91] := ""; -errors[92] := "operand of IN not an integer, or not a set"; -errors[93] := "set element type is not an integer"; -errors[94] := "operand of & is not of type BOOLEAN"; -errors[95] := "operand of OR is not of type BOOLEAN"; -errors[96] := "operand not applicable to (unary) +"; -errors[97] := "operand not applicable to (unary) -"; -errors[98] := "operand of ~ is not of type BOOLEAN"; -errors[99] := "ASSERT fault"; -errors[100] := "incompatible operands of dyadic operator"; -errors[101] := "operand type inapplicable to *"; -errors[102] := "operand type inapplicable to /"; -errors[103] := "operand type inapplicable to DIV"; -errors[104] := "operand type inapplicable to MOD"; -errors[105] := "operand type inapplicable to +"; -errors[106] := "operand type inapplicable to -"; -errors[107] := "operand type inapplicable to = or #"; -errors[108] := "operand type inapplicable to relation"; -errors[109] := "overriding method must be exported"; -errors[110] := "operand is not a type"; -errors[111] := "operand inapplicable to (this) function"; -errors[112] := "operand is not a variable"; -errors[113] := "incompatible assignment"; -errors[114] := "string too long to be assigned"; -errors[115] := "parameter doesn't match"; -errors[116] := "number of parameters doesn't match"; -errors[117] := "result type doesn't match"; -errors[118] := "export mark doesn't match with forward declaration"; -errors[119] := "redefinition textually precedes procedure bound to base type"; -errors[120] := "type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN"; -errors[121] := "called object is not a procedure (or is an interrupt procedure)"; -errors[122] := "actual VAR-parameter is not a variable"; -errors[123] := "type of actual parameter is not identical with that of formal VAR-parameter"; -errors[124] := "type of result expression differs from that of procedure"; -errors[125] := "type of case expression is neither INTEGER nor CHAR"; -errors[126] := "this expression cannot be a type or a procedure"; -errors[127] := "illegal use of object"; -errors[128] := "unsatisfied forward reference"; -errors[129] := "unsatisfied forward procedure"; -errors[130] := "WITH clause does not specify a variable"; -errors[131] := "LEN not applied to array"; -errors[132] := "dimension in LEN too large or negative"; -errors[135] := "SYSTEM not imported"; -errors[150] := "key inconsistency of imported module"; -errors[151] := "incorrect symbol file"; -errors[152] := "symbol file of imported module not found"; -errors[153] := "object or symbol file not opened (disk full?)"; -errors[154] := "recursive import not allowed"; -errors[155] := "generation of new symbol file not allowed"; -errors[156] := "parameter file not found"; -errors[157] := "syntax error in parameter file"; -(* Limitations of implementation*) -errors[200] := "not yet implemented"; -errors[201] := "lower bound of set range greater than higher bound"; -errors[202] := "set element greater than MAX(SET) or less than 0"; -errors[203] := "number too large"; -errors[204] := "product too large"; -errors[205] := "division by zero"; -errors[206] := "sum too large"; -errors[207] := "difference too large"; -errors[208] := "overflow in arithmetic shift"; -errors[209] := "case range too large"; -errors[213] := "too many cases in case statement"; -errors[218] := "illegal value of parameter (0 <= p < 256)"; -errors[219] := "machine registers cannot be accessed"; -errors[220] := "illegal value of parameter"; -errors[221] := "too many pointers in a record"; -errors[222] := "too many global pointers"; -errors[223] := "too many record types"; -errors[224] := "too many pointer types"; -errors[225] := "address of pointer variable too large (move forward in text)"; -errors[226] := "too many exported procedures"; -errors[227] := "too many imported modules"; -errors[228] := "too many exported structures"; -errors[229] := "too many nested records for import"; -errors[230] := "too many constants (strings) in module"; -errors[231] := "too many link table entries (external procedures)"; -errors[232] := "too many commands in module"; -errors[233] := "record extension hierarchy too high"; -errors[234] := "export of recursive type not allowed"; -errors[240] := "identifier too long"; -errors[241] := "string too long"; -errors[242] := "address overflow"; -errors[244] := "cyclic type definition not allowed"; -errors[245] := "guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable"; -(* Compiler Warnings *) - -errors[301] := "implicit type cast"; -errors[306] := "inappropriate symbol file ignored"; -errors[307] := "no ELSE symbol after CASE statement sequence may lead to trap"; (* new warning, -- noch *) -errors[308] := "SYSTEM.VAL result includes memory past end of source variable"; (* DCWB *) - -END errors. -(* -Run-time Error Messages - SYSTEM_halt - 0 silent HALT(0) - 1..255 HALT(n), cf. SYSTEM_halt - -1 assertion failed, cf. SYSTEM_assert - -2 invalid array index - -3 function procedure without RETURN statement - -4 invalid case in CASE statement - -5 type guard failed - -6 implicit type guard in record assignment failed - -7 invalid case in WITH statement - -8 value out of range - -9 (delayed) interrupt - -10 NIL access - -11 alignment error - -12 zero divide - -13 arithmetic overflow/underflow - -14 invalid function argument - -15 internal error -*) - diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt new file mode 100644 index 00000000..bafaba66 --- /dev/null +++ b/src/runtime/Errors.Txt @@ -0,0 +1,194 @@ +The first line of this file is ignored. +Any line not starting /^ *[0-9]/ is ignored. +There should be only one space between the number and the message text. + +Compiler error messages + 0 undeclared identifier + 1 multiply defined identifier + 2 illegal character in number + 3 illegal character in string + 4 identifier does not match procedure name + 5 comment not closed + + 9 '=' expected + + 12 type definition starts with incorrect symbol + 13 factor starts with incorrect symbol + 14 statement starts with incorrect symbol + 15 declaration followed by incorrect symbol + 16 MODULE expected + + 18 '.' missing + 19 ',' missing + 20 ':' missing + + 22 ')' missing + 23 ']' missing + 24 '}' missing + 25 OF missing + 26 THEN missing + 27 DO missing + 28 TO missing + + 30 '(' missing + + 34 ':=' missing + 35 ',' or OF expected + + 38 identifier expected + 39 ';' missing + + 41 END missing + + 44 UNTIL missing + + 46 EXIT not within loop statement + 47 illegally marked identifier + + 50 expression should be constant + 51 constant not an integer + 52 identifier does not denote a type + 53 identifier does not denote a record type + 54 result type of procedure is not a basic type + 55 procedure call of a function + 56 assignment to non-variable + 57 pointer not bound to record or array type + 58 recursive type definition + 59 illegal open array parameter + 60 wrong type of case label + 61 inadmissible type of case label + 62 case label defined more than once + 63 illegal value of constant + 64 more actual than formal parameters + 65 fewer actual than formal parameters + 66 element types of actual array and formal open array differ + 67 actual parameter corresponding to open array is not an array + 68 control variable must be integer + 69 parameter must be an integer constant + 70 pointer or VAR record required as formal receiver + 71 pointer expected as actual receiver + 72 procedure must be bound to a record of the same scope + 73 procedure must have level 0 + 74 procedure unknown in base type + 75 invalid call of base procedure + 76 this variable (field) is read only + 77 object is not a record + 78 dereferenced object is not a variable + 79 indexed object is not a variable + 80 index expression is not an integer + 81 index out of specified bounds + 82 indexed variable is not an array + 83 undefined record field + 84 dereferenced variable is not a pointer + 85 guard or test type is not an extension of variable type + 86 guard or testtype is not a pointer + 87 guarded or tested variable is neither a pointer nor a VAR-parameter record + 88 open array not allowed as variable, record field or array element + + 92 operand of IN not an integer, or not a set + 93 set element type is not an integer + 94 operand of & is not of type BOOLEAN + 95 operand of OR is not of type BOOLEAN + 96 operand not applicable to (unary) + + 97 operand not applicable to (unary) - + 98 operand of ~ is not of type BOOLEAN + 99 ASSERT fault +100 incompatible operands of dyadic operator +101 operand type inapplicable to * +102 operand type inapplicable to / +103 operand type inapplicable to DIV +104 operand type inapplicable to MOD +105 operand type inapplicable to + +106 operand type inapplicable to - +107 operand type inapplicable to = or # +108 operand type inapplicable to relation +109 overriding method must be exported +110 operand is not a type +111 operand inapplicable to (this) function +112 operand is not a variable +113 incompatible assignment +114 string too long to be assigned +115 parameter doesn't match +116 number of parameters doesn't match +117 result type doesn't match +118 export mark doesn't match with forward declaration +119 redefinition textually precedes procedure bound to base type +120 type of expression following IF, WHILE, UNTIL or ASSERT is not BOOLEAN +121 called object is not a procedure (or is an interrupt procedure) +122 actual VAR-parameter is not a variable +123 type of actual parameter is not identical with that of formal VAR-parameter +124 type of result expression differs from that of procedure +125 type of case expression is neither INTEGER nor CHAR +126 this expression cannot be a type or a procedure +127 illegal use of object +128 unsatisfied forward reference +129 unsatisfied forward procedure +130 WITH clause does not specify a variable +131 LEN not applied to array +132 dimension in LEN too large or negative +135 SYSTEM not imported +150 key inconsistency of imported module +151 incorrect symbol file +152 symbol file of imported module not found +153 object or symbol file not opened (disk full?) +154 recursive import not allowed +155 generation of new symbol file not allowed +156 parameter file not found +157 syntax error in parameter file + +Limitations of implementation +200 not yet implemented +201 lower bound of set range greater than higher bound +202 set element greater than MAX(SET) or less than 0 +203 number too large +204 product too large +205 division by zero +206 sum too large +207 difference too large +208 overflow in arithmetic shift +209 case range too large +213 too many cases in case statement +218 illegal value of parameter (0 <= p < 256) +219 machine registers cannot be accessed +220 illegal value of parameter +221 too many pointers in a record +222 too many global pointers +223 too many record types +224 too many pointer types +225 address of pointer variable too large (move forward in text) +226 too many exported procedures +227 too many imported modules +228 too many exported structures +229 too many nested records for import +230 too many constants (strings) in module +231 too many link table entries (external procedures) +232 too many commands in module +233 record extension hierarchy too high +234 export of recursive type not allowed +240 identifier too long +241 string too long +242 address overflow +244 cyclic type definition not allowed +245 guarded pointer variable may be manipulated by non-local operations; use auxiliary pointer variable + +Compiler Warnings +301 implicit type cast +306 inappropriate symbol file ignored +307 no ELSE symbol after CASE statement sequence may lead to trap + +Run-time Error Messages + -1 assertion failed, cf. SYSTEM_assert + -2 invalid array index + -3 function procedure without RETURN statement + -4 invalid case in CASE statement + -5 type guard failed + -6 implicit type guard in record assignment failed + -7 invalid case in WITH statement + -8 value out of range + -9 (delayed) interrupt +-10 NIL access +-11 alignment error +-12 zero divide +-13 arithmetic overflow/underflow +-14 invalid function argument +-15 internal error diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index f9ae45a4..96e8fde0 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -61,16 +61,18 @@ assemble: cd $(BUILDDIR) && $(COMPILE) -c SYSTEM.c Configuration.c Platform.c Heap.c cd $(BUILDDIR) && $(COMPILE) -c Out.c Strings.c Modules.c Files.c - cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c errors.c + cd $(BUILDDIR) && $(COMPILE) -c Reals.c Texts.c VT100.c cd $(BUILDDIR) && $(COMPILE) -c OPM.c extTools.c OPS.c OPT.c cd $(BUILDDIR) && $(COMPILE) -c OPC.c OPV.c OPB.c OPP.c cd $(BUILDDIR) && $(COMPILE) $(STATICLINK) Compiler.c -o $(ROOTDIR)/$(OBECOMP) \ - SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o Modules.o Files.o \ - Reals.o Texts.o VT100.o errors.o OPM.o extTools.o OPS.o OPT.o \ - OPC.o OPV.o OPB.o OPP.o + SYSTEM.o Configuration.o Platform.o Heap.o Out.o Strings.o \ + Modules.o Files.o Reals.o Texts.o VT100.o extTools.o \ + OPM.o OPS.o OPT.o OPC.o OPV.o OPB.o OPP.o cp src/runtime/*.[ch] $(BUILDDIR) + cp src/runtime/*.Txt $(BUILDDIR) + cp src/runtime/*.Txt $(ROOTDIR) @printf "$(OBECOMP) created.\n" @@ -111,7 +113,6 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/errors.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod @@ -123,6 +124,7 @@ translate: cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) + cp src/runtime/*.Txt $(BUILDDIR) @printf "$(BUILDDIR) filled with compiler C source.\n" @@ -134,7 +136,7 @@ browsercmd: @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ - Files.o Reals.o Modules.o VT100.o errors.o Configuration.o Strings.o \ + Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \ OPC.o @@ -168,6 +170,9 @@ install: @mkdir -p "$(INSTALLDIR)/C/include" && cp $(BUILDDIR)/C/*.h "$(INSTALLDIR)/C/include/" @mkdir -p "$(INSTALLDIR)/C/sym" && cp $(BUILDDIR)/C/*.sym "$(INSTALLDIR)/C/sym/" + @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/2/sym/" + @cp $(BUILDDIR)/*.Txt "$(INSTALLDIR)/C/sym/" + @mkdir -p "$(INSTALLDIR)/lib" @cp $(BUILDDIR)/2/lib$(ONAME)* "$(INSTALLDIR)/lib/" @cp $(BUILDDIR)/C/lib$(ONAME)* "$(INSTALLDIR)/lib/" @@ -366,8 +371,9 @@ library: @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) - cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + #cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) + #cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c + cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o From f9c72a37b007331161f5c73122b43bcd38a8865a Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 14 Nov 2016 21:25:04 +0000 Subject: [PATCH 123/140] Fix mingw build. --- src/compiler/OPM.Mod | 29 +---------------------------- src/tools/make/oberon.mk | 3 +-- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 02439e66..f0d5087b 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -435,6 +435,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) LogWStr(" "); IF Errors = NIL THEN NEW(Errors); Texts.Open(Errors, "Errors.Txt") END; + Texts.OpenScanner(S, Errors, 0); REPEAT l := S.line; Texts.Scan(S) UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; @@ -442,34 +443,6 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) Texts.Read(S, c); WHILE ~S.eot & (c >= ' ') DO Out.Char(c); Texts.Read(S, c) END END - - -(* --- -VAR T: Texts.Text; S: Texts.Scanner; - -PROCEDURE Write*(n: INTEGER); - VAR l: INTEGER; c: CHAR; -BEGIN - IF T = NIL THEN NEW(T); Texts.Open(T, "VishapOberonErrors.txt") END; - Texts.OpenScanner(S, T, 0); - REPEAT l := S.line; Texts.Scan(S) - UNTIL (l # S.line) & (S.class = Texts.Int) & (S.i = n) OR S.eot; - IF ~S.eot THEN Texts.Read(S, c); - WHILE ~S.eot & (c >= ' ') DO Console.Char(c); Texts.Read(S, c) END - END -END Write; - - (*NEW(T); Texts.Open(T, "vocErrors.Text"); Texts.OpenScanner(S, T, 0); - REPEAT S.line := 0; - REPEAT Texts.Scan(S) UNTIL S.eot OR (S.line # 0) - UNTIL S.eot OR (S.class = Texts.Int) & (S.i = n); - IF ~S.eot THEN Texts.Read(S, ch); i := 0; - WHILE ~S.eot & (ch # 0DX) DO buf[i] := ch; INC(i); Texts.Read(S, ch) END ; - buf[i] := 0X; LogWStr(buf); - END*) - LogWStr(errors.errors[n]); - ---- *) END LogErrMsg; diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index 96e8fde0..ebbbe417 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -371,9 +371,8 @@ library: @printf "\nCompiling lib$(ONAME)-O$(MODEL) sources\n" rm -rf $(BUILDDIR)/$(MODEL) mkdir -p $(BUILDDIR)/$(MODEL) - #cp src/runtime/*.[ch] $(BUILDDIR)/$(MODEL) - #cd $(BUILDDIR)/$(MODEL) && $(COMPILE) -c SYSTEM.c cp $(BUILDDIR)/SYSTEM.[ho] $(BUILDDIR)/$(MODEL) + cp $(BUILDDIR)/WindowsWrapper.h $(BUILDDIR)/$(MODEL) @make -f src/tools/make/oberon.mk -s O$(MODEL)library MODEL=$(MODEL) @printf "\nMaking lib$(ONAME)-O$(MODEL) .a and .so\n" ar rcs "$(BUILDDIR)/$(MODEL)/lib$(ONAME)-O$(MODEL).a" $(BUILDDIR)/$(MODEL)/*.o From f08e49d856e1e7368c6b7b9f769fa73b4368b051 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 11:51:29 +0000 Subject: [PATCH 124/140] Fix and simplify fingerprinting for 64 bit values --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-44/OPM.h | 8 ++--- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-48/OPM.h | 8 ++--- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 53 ++++++++++++++++------------ bootstrap/unix-88/OPM.h | 8 ++--- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 53 ++++++++++++++++------------ bootstrap/windows-48/OPM.h | 8 ++--- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 53 ++++++++++++++++------------ bootstrap/windows-88/OPM.h | 8 ++--- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/OPM.Mod | 49 ++++++++----------------- src/runtime/Errors.Txt | 1 + 187 files changed, 366 insertions(+), 349 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index ea177995..c220d8a5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 1499df05..a97a0220 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 2394c022..93bf36ce 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index d2da38f5..6cb7767f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index df398744..6ae68d6f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8e1abee4..8688df84 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index d72c211b..08d97e8d 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index ea177995..c220d8a5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 1499df05..a97a0220 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 71a6bbe3..deae7082 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index d2da38f5..6cb7767f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index df398744..6ae68d6f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b92f9c58..b3ef5a6d 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 0b42a742..92886678 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 0a6a9df0..bf261994 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index ce408573..aec2d9e7 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 00665676..9caec7dd 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 3ab728a5..c62af8b2 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 8432576a..bdc60565 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 5f5d6792..69d07404 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 9ffb7fc8..05e74ff1 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 05d6a917..052b4ba3 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 9cda46a8..9857f122 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 8cd71126..a4c3b892 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index d61c6c2d..a46330e3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 447f60be..21b3ac40 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index cfce97a1..537d4d09 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 9455890c..f408e854 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 25a6171e..cc2adfda 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 689c8108..ac675d4d 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 85a52286..dc79f2c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a40ef769..3d31f97c 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 5fb74ad0..2632922b 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index a5afb71e..4e1b04a2 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3408b3cc..e1f6e651 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 71a6bbe3..deae7082 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 2f149a8a..78becdbf 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index e5c33574..d5709f1e 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 1c582348..2ea96476 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 530f5a80..10ba64d7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b92f9c58..b3ef5a6d 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 0b42a742..92886678 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index 9d52cfc4..abb29dbf 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 40f3ddee..0fe23200 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/14]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 45384aa2..8821eec7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 8a1b02c3..7d967950 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index a798ac33..11437d58 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 00665676..9caec7dd 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 3ab728a5..c62af8b2 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 8432576a..bdc60565 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 66c0c947..ef8a8c3b 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index f2e99ab3..bb87539a 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 88ed3d3f..20ecca68 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 90df9e97..96d49e67 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index cfb3a8bf..a27ea6fd 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 5f5d6792..69d07404 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -49,10 +49,11 @@ export void OPM_CloseFiles (void); export void OPM_CloseOldSym (void); export void OPM_DeleteNewSym (void); export void OPM_FPrint (INT32 *fp, INT64 val); -export void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -export void OPM_FPrintReal (INT32 *fp, REAL real); -export void OPM_FPrintSet (INT32 *fp, UINT64 set); +export void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +export void OPM_FPrintReal (INT32 *fp, REAL val); +export void OPM_FPrintSet (INT32 *fp, UINT64 val); static void OPM_FindLine (Files_File f, Files_Rider *r, ADDRESS *r__typ, INT64 pos); +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len); export void OPM_Get (CHAR *ch); export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); @@ -707,31 +708,37 @@ void OPM_err (INT16 n) OPM_Mark(n, OPM_errpos); } -void OPM_FPrint (INT32 *fp, INT64 val) -{ - *fp = __ROTL((INT32)((UINT32)*fp ^ __VAL(UINT32, val)), 1, 32); -} - -void OPM_FPrintSet (INT32 *fp, UINT64 set) -{ - OPM_FPrint(&*fp, __VAL(INT32, set)); -} - -void OPM_FPrintReal (INT32 *fp, REAL real) +static void OPM_FingerprintBytes (INT32 *fp, SYSTEM_BYTE *bytes, LONGINT bytes__len) { INT16 i; INT32 l; - __GET((ADDRESS)&real, l, INT32); - OPM_FPrint(&*fp, l); + __ASSERT(__MASK(bytes__len, -4) == 0, 0); + i = 0; + while (i < bytes__len) { + __GET((ADDRESS)&bytes[__X(i, bytes__len)], l, INT32); + *fp = __ROTL((INT32)((UINT32)*fp ^ (UINT32)l), 1, 32); + i += 4; + } } -void OPM_FPrintLReal (INT32 *fp, LONGREAL lr) +void OPM_FPrint (INT32 *fp, INT64 val) { - INT32 l, h; - __GET((ADDRESS)&lr, l, INT32); - __GET((ADDRESS)&lr + 4, h, INT32); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintSet (INT32 *fp, UINT64 val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); +} + +void OPM_FPrintReal (INT32 *fp, REAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 4); +} + +void OPM_FPrintLReal (INT32 *fp, LONGREAL val) +{ + OPM_FingerprintBytes(&*fp, (void*)&val, 8); } void OPM_SymRCh (CHAR *ch) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 4c5e13a8..17ae2fda 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPM__h #define OPM__h @@ -24,9 +24,9 @@ import void OPM_CloseFiles (void); import void OPM_CloseOldSym (void); import void OPM_DeleteNewSym (void); import void OPM_FPrint (INT32 *fp, INT64 val); -import void OPM_FPrintLReal (INT32 *fp, LONGREAL lr); -import void OPM_FPrintReal (INT32 *fp, REAL real); -import void OPM_FPrintSet (INT32 *fp, UINT64 set); +import void OPM_FPrintLReal (INT32 *fp, LONGREAL val); +import void OPM_FPrintReal (INT32 *fp, REAL val); +import void OPM_FPrintSet (INT32 *fp, UINT64 val); import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 9ffb7fc8..05e74ff1 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 3ddbca21..272a545a 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 91e3a136..0b2a09d7 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index bd0a0e9a..2cb37758 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 05d6a917..052b4ba3 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 9850a22e..6c82f6b5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 9cda46a8..9857f122 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ebb01de2..dff88ffa 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index e5c33574..d5709f1e 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 144d7888..fd11d7ba 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 0b4778fa..e120708e 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 98f9604c..59418a88 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 0eecd854..3445ecec 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1eaca8ec..035a9727 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 48e0dd7f..2e536dda 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 17369939..668261aa 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index cfce97a1..537d4d09 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 9455890c..f408e854 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 909f4e92..2d8d0a2a 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 15dc50c5..ae8ad073 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e70c387c..76e386df 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index a6813769..2a8c5c12 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/13]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index f0d5087b..0693359d 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -542,48 +542,29 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) END err; - PROCEDURE FPrint*(VAR fp: LONGINT; val: SYSTEM.INT64); + (* ------------------------ Fingerprint hashing ----------------------- *) + + PROCEDURE FingerprintBytes(VAR fp: LONGINT; VAR bytes: ARRAY OF SYSTEM.BYTE); + VAR i: INTEGER; l: LONGINT; BEGIN - fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, val)), 1) - END FPrint; - - - PROCEDURE FPrintSet*(VAR fp: LONGINT; set: SYSTEM.SET64); - BEGIN FPrint(fp, SYSTEM.VAL(LONGINT, set)) - END FPrintSet; - - - PROCEDURE FPrintReal*(VAR fp: LONGINT; real: REAL); - VAR i: INTEGER; l: LONGINT; - BEGIN - IF SIZE(REAL) = SIZE(INTEGER) THEN - SYSTEM.GET(SYSTEM.ADR(real), i); l := i; - ELSE - SYSTEM.GET(SYSTEM.ADR(real), l); - END; - FPrint(fp, l) - END FPrintReal; - - - PROCEDURE FPrintLReal*(VAR fp: LONGINT; lr: LONGREAL); - VAR l, h: LONGINT; - BEGIN - IF SIZE(LONGREAL) = SIZE(LONGINT) THEN - (* 64 bit LONGINT *) - FPrint(fp, SYSTEM.VAL(LONGINT, lr)) - ELSE - (* 32 bit LONGINT *) - SYSTEM.GET(SYSTEM.ADR(lr), l); SYSTEM.GET(SYSTEM.ADR(lr)+4, h); - FPrint(fp, l); FPrint(fp, h) + ASSERT(LEN(bytes) MOD SIZE(LONGINT) = 0); + i := 0; WHILE i < LEN(bytes) DO + SYSTEM.GET(SYSTEM.ADR(bytes[i]), l); + fp := SYSTEM.ROT(SYSTEM.VAL(LONGINT, SYSTEM.VAL(SET, fp) / SYSTEM.VAL(SET, l)), 1); + INC(i, SIZE(LONGINT)) END - END FPrintLReal; + END FingerprintBytes; + + PROCEDURE FPrint* (VAR fp: LONGINT; val: HUGEINT); BEGIN FingerprintBytes(fp, val) END FPrint; + PROCEDURE FPrintSet* (VAR fp: LONGINT; val: SYSTEM.SET64); BEGIN FingerprintBytes(fp, val) END FPrintSet; + PROCEDURE FPrintReal* (VAR fp: LONGINT; val: REAL); BEGIN FingerprintBytes(fp, val) END FPrintReal; + PROCEDURE FPrintLReal*(VAR fp: LONGINT; val: LONGREAL); BEGIN FingerprintBytes(fp, val) END FPrintLReal; (* ------------------------- Read Symbol File ------------------------- *) - PROCEDURE SymRCh*(VAR ch: CHAR); BEGIN Files.Read(oldSF, ch) END SymRCh; diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index bafaba66..a5cea1f1 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -175,6 +175,7 @@ Compiler Warnings 301 implicit type cast 306 inappropriate symbol file ignored 307 no ELSE symbol after CASE statement sequence may lead to trap +308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert From 6da0d5d685314cce281fd8a2bf32b8bfa765137b Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 17:33:05 +0000 Subject: [PATCH 125/140] Build with colour output when on a tty/console. --- src/compiler/OPM.Mod | 20 +- src/runtime/Out.Mod | 12 +- src/runtime/Platformunix.Mod | 8 +- src/runtime/Platformwindows.Mod | 5 + src/test/confidence/intsyntax/expected | 12 +- src/test/confidence/intsyntax/test.sh | 2 +- src/tools/make/oberon.mk | 312 ++++++++++++------------- 7 files changed, 195 insertions(+), 176 deletions(-) diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 0693359d..7c0892fa 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -129,6 +129,12 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; + PROCEDURE LogVT100(vt100code: ARRAY OF CHAR); + BEGIN + IF Out.IsConsole & ~(notcoloroutput IN Options) THEN + VT100.SetAttr(vt100code) + END + END LogVT100; @@ -423,14 +429,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) VAR l: INTEGER; S: Texts.Scanner; c: CHAR; BEGIN IF n >= 0 THEN - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Red) END; - LogWStr(" err "); - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; + LogVT100(VT100.Red); LogWStr(" err "); LogVT100(VT100.ResetAll) ELSE - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Magenta) END; - LogWStr(" warning "); n := -n; - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; - END ; + LogVT100(VT100.Magenta); LogWStr(" warning "); n := -n; LogVT100(VT100.ResetAll) + END; LogWNum(n, 1); LogWStr(" "); @@ -503,9 +505,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) i := SHORT(Longint(pos - ErrorLineStartPos)); WHILE i > 0 DO LogW(" "); DEC(i) END; - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.Green) END; - LogW("^"); - IF ~(notcoloroutput IN Options) THEN VT100.SetAttr(VT100.ResetAll) END; + LogVT100(VT100.Green); LogW("^"); LogVT100(VT100.ResetAll); Files.Close(f); END ShowLine; diff --git a/src/runtime/Out.Mod b/src/runtime/Out.Mod index 0dc4ed27..9564f275 100644 --- a/src/runtime/Out.Mod +++ b/src/runtime/Out.Mod @@ -2,7 +2,13 @@ MODULE Out; (* DCW Brown. 2016-09-27 *) IMPORT SYSTEM, Platform; -VAR buf: ARRAY 128 OF CHAR; in: INTEGER; +VAR + IsConsole-: BOOLEAN; + + buf: ARRAY 128 OF CHAR; + in: INTEGER; + + PROCEDURE Flush*; VAR error: Platform.ErrorCode; @@ -199,5 +205,7 @@ PROCEDURE LongReal*(x: LONGREAL; n: INTEGER); BEGIN RealP(x, n, TRUE); END LongReal; -BEGIN in := 0 +BEGIN + IsConsole := Platform.IsConsole(Platform.StdOut); + in := 0 END Out. diff --git a/src/runtime/Platformunix.Mod b/src/runtime/Platformunix.Mod index 27ce9539..fa22d7ee 100644 --- a/src/runtime/Platformunix.Mod +++ b/src/runtime/Platformunix.Mod @@ -303,7 +303,7 @@ END New; -PROCEDURE -closefile (fd: LONGINT): INTEGER "close(fd)"; +PROCEDURE -closefile(fd: LONGINT): INTEGER "close(fd)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -311,6 +311,12 @@ BEGIN END Close; +PROCEDURE -isatty(fd: LONGINT): INTEGER "isatty(fd)"; + +PROCEDURE IsConsole*(h: FileHandle): BOOLEAN; +BEGIN RETURN isatty(h) # 0 END IsConsole; + + PROCEDURE -fstat(fd: LONGINT): INTEGER "fstat(fd, &s)"; PROCEDURE -stat(n: ARRAY OF CHAR): INTEGER "stat((char*)n, &s)"; diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 937c1da0..6a80bff4 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -539,6 +539,11 @@ VAR mode: SYSTEM.INT32; BEGIN IF GetConsoleMode(StdOut, mode) THEN SetConsoleMode(StdOut, mode+VTprocessing) END END EnableVT100; +PROCEDURE IsConsole*(h: FileHandle): BOOLEAN; +VAR mode: SYSTEM.INT32; +BEGIN RETURN GetConsoleMode(StdOut, mode) +END IsConsole; + PROCEDURE TestLittleEndian; VAR i: INTEGER; diff --git a/src/test/confidence/intsyntax/expected b/src/test/confidence/intsyntax/expected index 82813b89..1abe43f9 100644 --- a/src/test/confidence/intsyntax/expected +++ b/src/test/confidence/intsyntax/expected @@ -1,15 +1,15 @@ IntSyntax.mod compiling IntSyntax. 14: i := l; (* Bad, INTEGER shorter than LONGINT *) - ^ - pos 341 err 113 incompatible assignment + ^ + pos 341 err 113 incompatible assignment 15: s := l; (* Bad, SHORTINT shorter than LONGINT *) - ^ - pos 393 err 113 incompatible assignment + ^ + pos 393 err 113 incompatible assignment 16: i := l; (* Bad, SHORTINT shorter than INTEGER *) - ^ - pos 446 err 113 incompatible assignment + ^ + pos 446 err 113 incompatible assignment Module compilation failed. diff --git a/src/test/confidence/intsyntax/test.sh b/src/test/confidence/intsyntax/test.sh index 7699daea..3929cc8c 100644 --- a/src/test/confidence/intsyntax/test.sh +++ b/src/test/confidence/intsyntax/test.sh @@ -1,5 +1,5 @@ #!/bin/sh . ../testenv.sh # Generate mixed source and assembly code listing -$OBECOMP IntSyntax.mod -m >result +$OBECOMP IntSyntax.mod -fm >result . ../testresult.sh diff --git a/src/tools/make/oberon.mk b/src/tools/make/oberon.mk index ebbbe417..796cb8d5 100644 --- a/src/tools/make/oberon.mk +++ b/src/tools/make/oberon.mk @@ -103,25 +103,25 @@ translate: @mkdir -p $(BUILDDIR) @rm -f $(BUILDDIR)/*.sym - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsfF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod - cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssfm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../Configuration.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFapx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Heap.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Strings.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Out.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Modules.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Files.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Reals.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/Texts.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/runtime/VT100.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPM.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/extTools.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsFx -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPS.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPT.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPC.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPV.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPB.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -SsF -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/OPP.Mod + cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssm -A$(ADRSIZE)$(ALIGNMENT) -O$(MODEL) ../../src/compiler/Compiler.Mod cp src/runtime/*.[ch] $(BUILDDIR) cp src/runtime/*.Txt $(BUILDDIR) @@ -132,8 +132,8 @@ translate: browsercmd: @printf "\nMaking symbol browser\n" - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ssf -O$(MODEL) ../../src/runtime/Oberon.Mod - @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Smf -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Ss -O$(MODEL) ../../src/runtime/Oberon.Mod + @cd $(BUILDDIR); $(ROOTDIR)/$(OBECOMP) -Sm -O$(MODEL) ../../src/tools/browser/BrowserCmd.Mod @cd $(BUILDDIR); $(COMPILE) BrowserCmd.c Oberon.c -o showdef \ Platform.o Texts.o OPT.o Heap.o Out.o SYSTEM.o OPM.o OPS.o OPV.o \ Files.o Reals.o Modules.o VT100.o Configuration.o Strings.o \ @@ -199,166 +199,166 @@ uninstall: runtime: @printf "\nMaking run time library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Heap.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Modules.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Out.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/In.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/VT100.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Files.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Math.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/MathL.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Reals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Texts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/runtime/Oberon.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Platform$(PLATFORM).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Heap.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Modules.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Out.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/In.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/VT100.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Files.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Math.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/MathL.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Reals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Texts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/runtime/Oberon.Mod v4: @printf "\nMaking v4 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Args.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Console.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Printer.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/v4/Sets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Args.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Console.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Printer.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/v4/Sets.Mod ooc2: @printf "\nMaking ooc2 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Strings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Ascii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2CharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2ConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2IntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc2/ooc2Real0.Mod ooc: @printf "\nMaking ooc library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLowLReal.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocOakMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLongInts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLComplexMath.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocAscii.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocCharClass.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocConvTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocLRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRealStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntConv.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocIntStr.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocMsg.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocSysClock.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTime.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocChannel.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocStrings2.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocRts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocTextRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocBinaryRider.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocJulianDay.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocFilenames.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocwrapperlibc.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ooc/oocC$(DATAMODEL).Mod oocX11: @printf "\nMaking oocX11 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocX11.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXutil.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/oocX11/oocXYplane.Mod ulm: @printf "\nMaking ulm library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPriorities.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmServices.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSys.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSYSTEM.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmProcess.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmResources.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmForwarders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRelatedEvents.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreams.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysTypes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTexts.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysConversions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysErrors.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysStat.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmASCII.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAssertions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIndirectDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIEEE.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmMC68881.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPrint.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmWrite.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConstStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPlotters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmSysIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmLoader.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmNetIO.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentObjects.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmPersistentDisciplines.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmOperations.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmScales.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimes.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmClocks.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmStreamConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTimeConditions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmCipherOps.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmBlockCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmAsymmetricCiphers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmConclusions.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmRandomGenerators.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmTCrypt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/ulm/ulmIntOperations.Mod pow32: @printf "\nMaking pow library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/pow/powStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/pow/powStrings.Mod misc: @printf "\nMaking misc library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/crt.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/Listen.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/crt.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/Listen.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MersenneTwister.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrays.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/misc/MultiArrayRiders.Mod s3: @printf "\nMaking s3 library for -O$(MODEL)\n" - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethSets.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethZip.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethDates.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethReals.Mod - cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Ffs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethBTrees.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethMD5.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethSets.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlib.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibBuffers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibInflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibDeflate.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZlibWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethZip.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethRandomNumbers.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZReaders.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethGZWriters.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethUnicode.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethDates.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethReals.Mod + cd $(BUILDDIR)/$(MODEL); $(ROOTDIR)/$(OBECOMP) -Fs -O$(MODEL) ../../../src/library/s3/ethStrings.Mod From c12aae020dd344234cd293351b20a54aa54cff2f Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 18:03:57 +0000 Subject: [PATCH 126/140] Add IsConsole tests to compiler.mod, update bootstrap. --- bootstrap/unix-44/Compiler.c | 18 ++++---------- bootstrap/unix-44/Configuration.c | 2 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-44/OPM.h | 3 ++- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 4 +++- bootstrap/unix-44/Out.h | 3 ++- bootstrap/unix-44/Platform.c | 9 ++++++- bootstrap/unix-44/Platform.h | 3 ++- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 18 ++++---------- bootstrap/unix-48/Configuration.c | 2 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-48/OPM.h | 3 ++- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 4 +++- bootstrap/unix-48/Out.h | 3 ++- bootstrap/unix-48/Platform.c | 9 ++++++- bootstrap/unix-48/Platform.h | 3 ++- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 18 ++++---------- bootstrap/unix-88/Configuration.c | 2 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 36 +++++++++++++--------------- bootstrap/unix-88/OPM.h | 3 ++- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 4 +++- bootstrap/unix-88/Out.h | 3 ++- bootstrap/unix-88/Platform.c | 9 ++++++- bootstrap/unix-88/Platform.h | 3 ++- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 18 ++++---------- bootstrap/windows-48/Configuration.c | 2 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 36 +++++++++++++--------------- bootstrap/windows-48/OPM.h | 3 ++- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 4 +++- bootstrap/windows-48/Out.h | 3 ++- bootstrap/windows-48/Platform.c | 9 ++++++- bootstrap/windows-48/Platform.h | 3 ++- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 18 ++++---------- bootstrap/windows-88/Configuration.c | 2 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 36 +++++++++++++--------------- bootstrap/windows-88/OPM.h | 3 ++- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 4 +++- bootstrap/windows-88/Out.h | 3 ++- bootstrap/windows-88/Platform.c | 9 ++++++- bootstrap/windows-88/Platform.h | 3 ++- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- src/compiler/Compiler.Mod | 8 ++----- src/compiler/OPM.Mod | 2 +- 187 files changed, 348 insertions(+), 342 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c220d8a5..428cf3db 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index a97a0220..4c861f05 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 93bf36ce..d5d3297d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6cb7767f..f58bb07a 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 6ae68d6f..0a85488d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 8688df84..f661a75f 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 08d97e8d..883fba9f 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c220d8a5..428cf3db 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index a97a0220..4c861f05 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index deae7082..a80a5307 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6cb7767f..f58bb07a 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 6ae68d6f..0a85488d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index b3ef5a6d..9827cf2e 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 92886678..51e39825 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index bf261994..e90d45de 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index aec2d9e7..e9575a26 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 9caec7dd..37d3265c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c62af8b2..5aa43338 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index bdc60565..6c9fd2b7 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 69d07404..36a43b89 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 05e74ff1..59d1e709 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 052b4ba3..df081a58 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 9857f122..5d180b17 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a4c3b892..bc314d4d 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(1); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a46330e3..4d64af83 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -63,6 +63,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -131,6 +132,7 @@ extern void Heap_InitHeap(); #define Platform_getenv(var, var__len) (Platform_EnvPtr)getenv((char*)var) #define Platform_getpid() (INTEGER)getpid() #define Platform_gettimeval() struct timeval tv; gettimeofday(&tv,0) +#define Platform_isatty(fd) isatty(fd) #define Platform_lseek(fd, o, w) lseek(fd, o, w) #define Platform_nanosleep(s, ns) struct timespec req, rem; req.tv_sec = s; req.tv_nsec = ns; nanosleep(&req, &rem) #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) @@ -404,6 +406,11 @@ INT16 Platform_Close (INT32 h) __RETCHK; } +BOOLEAN Platform_IsConsole (INT32 h) +{ + return Platform_isatty(h) != 0; +} + INT16 Platform_Identify (INT32 h, Platform_FileIdentity *identity, ADDRESS *identity__typ) { Platform_structstats(); diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 21b3ac40..ed5faf55 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -45,6 +45,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 537d4d09..fedd5ba1 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index f408e854..fe5ba341 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index cc2adfda..6fab39f4 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index ac675d4d..305419c8 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index dc79f2c6..be352cc8 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 3d31f97c..620c600d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2632922b..e2a62e9c 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 4e1b04a2..63faf68d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index e1f6e651..ffc41784 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index deae7082..a80a5307 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 78becdbf..7eb931aa 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index d5709f1e..6f988eae 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 2ea96476..893f8576 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,6 +67,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT32 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT32 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -622,6 +623,12 @@ static void Platform_EnableVT100 (void) } } +BOOLEAN Platform_IsConsole (INT32 h) +{ + INT32 mode; + return Platform_GetConsoleMode(Platform_StdOut, &mode); +} + static void Platform_TestLittleEndian (void) { INT16 i; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 10ba64d7..8d2441f4 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -47,6 +47,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT32 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT32 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT32 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index b3ef5a6d..9827cf2e 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 92886678..51e39825 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index abb29dbf..ef5126fc 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamSf */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 @@ -46,22 +46,14 @@ void Compiler_Module (BOOLEAN *done) if (OPM_noerr) { if ((__IN(10, OPM_Options, 32) && __STRCMP(OPM_modName, "SYSTEM") != 0)) { OPM_DeleteNewSym(); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" Main program.", 16); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { if (new) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogWStr((CHAR*)" New symbol file.", 19); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); OPM_RegisterNewSym(); } else if (ext) { OPM_LogWStr((CHAR*)" Extended symbol file.", 24); diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 0fe23200..8dee54dd 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 8821eec7..68bf9ed7 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7d967950..b3d5385e 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 11437d58..47a3d116 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 9caec7dd..37d3265c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c62af8b2..5aa43338 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index bdc60565..6c9fd2b7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index ef8a8c3b..2ec0e428 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index bb87539a..adda3018 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 20ecca68..d59b8602 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 96d49e67..e92faf91 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index a27ea6fd..eede7b95 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 69d07404..36a43b89 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -59,6 +59,7 @@ export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); export void OPM_InitOptions (void); export INT16 OPM_Integer (INT64 n); static void OPM_LogErrMsg (INT16 n); +export void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); export void OPM_LogW (CHAR ch); export void OPM_LogWLn (void); export void OPM_LogWNum (INT64 i, INT64 len); @@ -121,6 +122,15 @@ void OPM_LogWLn (void) Out_Ln(); } +void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len) +{ + __DUP(vt100code, vt100code__len, CHAR); + if ((Out_IsConsole && !__IN(16, OPM_Options, 32))) { + VT100_SetAttr(vt100code, vt100code__len); + } + __DEL(vt100code); +} + INT64 OPM_SignedMaximum (INT32 bytecount) { INT64 result; @@ -540,22 +550,14 @@ static void OPM_LogErrMsg (INT16 n) Texts_Scanner S; CHAR c; if (n >= 0) { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"31m", 4); - } + OPM_LogVT100((CHAR*)"31m", 4); OPM_LogWStr((CHAR*)" err ", 7); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } else { - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"35m", 4); - } + OPM_LogVT100((CHAR*)"35m", 4); OPM_LogWStr((CHAR*)" warning ", 11); n = -n; - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); } OPM_LogWNum(n, 1); OPM_LogWStr((CHAR*)" ", 3); @@ -641,13 +643,9 @@ static void OPM_ShowLine (INT64 pos) OPM_LogW(' '); i -= 1; } - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"32m", 4); - } + OPM_LogVT100((CHAR*)"32m", 4); OPM_LogW('^'); - if (!__IN(16, OPM_Options, 32)) { - VT100_SetAttr((CHAR*)"0m", 3); - } + OPM_LogVT100((CHAR*)"0m", 3); Files_Close(f); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 17ae2fda..2e875d8f 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -31,6 +31,7 @@ import void OPM_Get (CHAR *ch); import void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len); import void OPM_InitOptions (void); import INT16 OPM_Integer (INT64 n); +import void OPM_LogVT100 (CHAR *vt100code, LONGINT vt100code__len); import void OPM_LogW (CHAR ch); import void OPM_LogWLn (void); import void OPM_LogWNum (INT64 i, INT64 len); diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 05e74ff1..59d1e709 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 272a545a..960ea29e 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 0b2a09d7..72d77adb 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2cb37758..92740884 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 052b4ba3..df081a58 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 6c82f6b5..b6ecef0e 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 9857f122..5d180b17 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index dff88ffa..ad0a4e1c 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index d5709f1e..6f988eae 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -9,6 +9,7 @@ #include "Platform.h" +export BOOLEAN Out_IsConsole; static CHAR Out_buf[128]; static INT16 Out_in; @@ -311,6 +312,7 @@ export void *Out__init(void) __REGCMD("Ln", Out_Ln); __REGCMD("Open", Out_Open); /* BEGIN */ + Out_IsConsole = Platform_IsConsole(Platform_StdOut); Out_in = 0; __ENDMOD; } diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index fd11d7ba..e3b542f1 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h @@ -6,6 +6,7 @@ #include "SYSTEM.h" +import BOOLEAN Out_IsConsole; import void Out_Char (CHAR ch); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index e120708e..8017966b 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -67,6 +67,7 @@ export INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden export BOOLEAN Platform_Inaccessible (INT16 e); export void Platform_Init (INT32 argc, INT64 argvadr); export BOOLEAN Platform_Interrupted (INT16 e); +export BOOLEAN Platform_IsConsole (INT64 h); export void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); export INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); export BOOLEAN Platform_NoSuchDirectory (INT16 e); @@ -622,6 +623,12 @@ static void Platform_EnableVT100 (void) } } +BOOLEAN Platform_IsConsole (INT64 h) +{ + INT32 mode; + return Platform_GetConsoleMode(Platform_StdOut, &mode); +} + static void Platform_TestLittleEndian (void) { INT16 i; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 59418a88..5c38cd8d 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h @@ -47,6 +47,7 @@ import INT16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIden import BOOLEAN Platform_Inaccessible (INT16 e); import void Platform_Init (INT32 argc, INT64 argvadr); import BOOLEAN Platform_Interrupted (INT16 e); +import BOOLEAN Platform_IsConsole (INT64 h); import void Platform_MTimeAsClock (Platform_FileIdentity i, INT32 *t, INT32 *d); import INT16 Platform_New (CHAR *n, LONGINT n__len, INT64 *h); import BOOLEAN Platform_NoSuchDirectory (INT16 e); diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 3445ecec..e532c10a 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 035a9727..9e6d921e 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 2e536dda..5921a597 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 668261aa..c8760025 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 537d4d09..fedd5ba1 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index f408e854..fe5ba341 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 2d8d0a2a..8b786199 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ae8ad073..ca8fd2fa 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 76e386df..e1cc07ba 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 2a8c5c12..c31ea618 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSfF */ +/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index b6683241..4ec44f03 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -25,14 +25,10 @@ MODULE Compiler; (* J. Templ 3.2.95 *) IF OPM.noerr THEN IF (OPM.mainprog IN OPM.Options) & (OPM.modName # "SYSTEM") THEN OPM.DeleteNewSym; - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; - OPM.LogWStr(" Main program."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; + OPM.LogVT100(VT100.Green); OPM.LogWStr(" Main program."); OPM.LogVT100(VT100.ResetAll); ELSE IF new THEN - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.Green) END; - OPM.LogWStr(" New symbol file."); - IF ~(OPM.notcoloroutput IN OPM.Options) THEN VT100.SetAttr(VT100.ResetAll) END; + OPM.LogVT100(VT100.Green); OPM.LogWStr(" New symbol file."); OPM.LogVT100(VT100.ResetAll); OPM.RegisterNewSym ELSIF ext THEN OPM.LogWStr(" Extended symbol file."); diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index 7c0892fa..c72912a7 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -129,7 +129,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) PROCEDURE LogWNum*(i, len: SYSTEM.INT64); BEGIN Out.Int(i, len) END LogWNum; PROCEDURE LogWLn*; BEGIN Out.Ln END LogWLn; - PROCEDURE LogVT100(vt100code: ARRAY OF CHAR); + PROCEDURE LogVT100*(vt100code: ARRAY OF CHAR); BEGIN IF Out.IsConsole & ~(notcoloroutput IN Options) THEN VT100.SetAttr(vt100code) From 65db905f0b65da3ba73b513c59986d483d3c6268 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 22:59:43 +0000 Subject: [PATCH 127/140] Fix misfiring of error 308 by calculating type sizes when not already calculated. --- bootstrap/unix-44/OPB.c | 2 ++ bootstrap/unix-48/OPB.c | 2 ++ bootstrap/unix-88/OPB.c | 2 ++ bootstrap/windows-48/OPB.c | 2 ++ bootstrap/windows-88/OPB.c | 2 ++ src/compiler/OPB.Mod | 1 + 6 files changed, 11 insertions(+) diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index adda3018..8533be52 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -2172,6 +2172,8 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, INT8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501, 32)) || x->typ->comp == 3) { OPB_err(126); } + OPT_TypSize(x->typ); + OPT_TypSize(p->typ); if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 5cdad662..91576fd3 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1226,6 +1226,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) err(126) END; (* Warn if the result type includes memory past the end of the source variable *) + OPT.TypSize(x.typ); OPT.TypSize(p.typ); IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN From 240885d8416f79d71cf5ad8c4ae10d0d95dffa69 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 15 Nov 2016 23:40:26 +0000 Subject: [PATCH 128/140] Restore showdef lookup of installed library modules. --- src/tools/browser/BrowserCmd.Mod | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index dd15c680..86b7d4e0 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -1,8 +1,9 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line version jt 4.4.95 *) IMPORT - OPM, OPS, OPT, OPV, Texts, Out, Oberon, Platform, SYSTEM; - + OPM, OPS, OPT, OPV, + Texts, Strings, Files, Out, + Oberon, Platform, SYSTEM, Configuration; CONST OptionChar = "-"; @@ -275,13 +276,29 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver WModule(name, Oberon.Log); OPT.Close; ELSE - Texts.WriteString(W, "showdef - Display module's public interface."); Texts.WriteLn(W); - Texts.WriteString(W, "Usage: showdef module"); Texts.WriteLn(W); - Texts.WriteString(W, "Note: module.sym must be in the current directory."); Texts.WriteLn(W); + Ws("showdef - Display module's public interface."); Wln; + Wln; + Ws("Usage: showdef module"); Wln; + Wln; + Ws("Any path and/or filename extension are stripped from the module name,"); Wln; + Ws("and the module is found the same way as it is found by the compiler."); Wln; + Wln; + Ws("Thus the module .sym file must be in the current directory, or module"); Wln; + Ws("must be the name of one of the library modules installed with the compiler."); Wln; Texts.Append(Oberon.Log, W.buf) END END ShowDef; +PROCEDURE SetPath; +VAR path: ARRAY 256 OF CHAR; BEGIN - Texts.OpenWriter(W); ShowDef + COPY(Configuration.installdir, path); + Strings.Append("/2/sym", path); + Files.SetSearchPath(path) +END SetPath; + +BEGIN + Texts.OpenWriter(W); + SetPath; + ShowDef END BrowserCmd. From 13da50007efe00729d70b1d73d99731b77d422c9 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 16 Nov 2016 11:56:40 +0000 Subject: [PATCH 129/140] Honour file path in showdef module argument. --- src/tools/browser/BrowserCmd.Mod | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tools/browser/BrowserCmd.Mod b/src/tools/browser/BrowserCmd.Mod index 86b7d4e0..d463c22d 100644 --- a/src/tools/browser/BrowserCmd.Mod +++ b/src/tools/browser/BrowserCmd.Mod @@ -256,6 +256,7 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver BEGIN i := 0; WHILE name[i] # 0X DO INC(i) END; WHILE (i >= 0) & (name[i] # "/") DO DEC(i) END; + IF i > 0 THEN name[i] := 0X; Files.SetSearchPath(name) END; INC(i); j := 0; ch := name[i]; WHILE (ch # ".") & (ch # 0X) DO first[j] := ch; INC(i); INC(j); ch := name[i] END; first[j] := 0X @@ -280,25 +281,24 @@ MODULE BrowserCmd; (* RC 29.10.93 *) (* object model 4.12.93, command line ver Wln; Ws("Usage: showdef module"); Wln; Wln; - Ws("Any path and/or filename extension are stripped from the module name,"); Wln; - Ws("and the module is found the same way as it is found by the compiler."); Wln; - Wln; - Ws("Thus the module .sym file must be in the current directory, or module"); Wln; - Ws("must be the name of one of the library modules installed with the compiler."); Wln; + Ws("Where is a symbol file name. The .sym may be omitted."); Wln; + Ws("If no path is provided, and the module does not exist in the current directory,"); Wln; + Ws("then showdef will also look for the module in the installed libraries."); Wln; Texts.Append(Oberon.Log, W.buf) END END ShowDef; -PROCEDURE SetPath; +PROCEDURE SetDefaultPath; VAR path: ARRAY 256 OF CHAR; BEGIN - COPY(Configuration.installdir, path); + path := ".;"; + Strings.Append(Configuration.installdir, path); Strings.Append("/2/sym", path); Files.SetSearchPath(path) -END SetPath; +END SetDefaultPath; BEGIN Texts.OpenWriter(W); - SetPath; + SetDefaultPath; ShowDef END BrowserCmd. From 654b6ecb24eb21cf8a4a83f69fb74f4f0a511c89 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 16 Nov 2016 12:33:53 +0000 Subject: [PATCH 130/140] Add offset assertions to Files.Mod. --- src/runtime/Files.Mod | 63 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/src/runtime/Files.Mod b/src/runtime/Files.Mod index 841c5c41..9e51f73b 100644 --- a/src/runtime/Files.Mod +++ b/src/runtime/Files.Mod @@ -14,10 +14,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files CONST - nofbufs = 4; - bufsize = 4096; - noDesc = -1; - notDone = -1; + NumBufs = 4; + BufSize = 4096; + NoDesc = -1; (* file states *) open = 0; (* OS File has been opened *) @@ -40,7 +39,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files identity: Platform.FileIdentity; fd-: Platform.FileHandle; len, pos: LONGINT; - bufs: ARRAY nofbufs OF Buffer; + bufs: ARRAY NumBufs OF Buffer; swapper: INTEGER; state: INTEGER; next: File; @@ -51,7 +50,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files chg: BOOLEAN; org: LONGINT; size: LONGINT; - data: ARRAY bufsize OF SYSTEM.BYTE + data: ARRAY BufSize OF SYSTEM.BYTE END; Rider* = RECORD @@ -131,7 +130,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Out.String(", state = "); Out.Int(f.state,1); Out.Ln; *) - IF f.fd = noDesc THEN + IF f.fd = NoDesc THEN IF f.state = create THEN GetTempName(f.registerName, f.workName); f.tempFile := TRUE ELSIF f.state = close THEN @@ -203,7 +202,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF prev.next # NIL THEN prev.next := f.next END END; error := Platform.Close(f.fd); - f.fd := noDesc; f.state := create; DEC(Heap.FileCount); + f.fd := NoDesc; f.state := create; DEC(Heap.FileCount); END CloseOSFile; @@ -214,7 +213,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN IF (f.state # create) OR (f.registerName # "") THEN Create(f); i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; + WHILE (i < NumBufs) & (f.bufs[i] # NIL) DO Flush(f.bufs[i]); INC(i) END; (* There's no reason to sync this file - we're about to close it. The OS will sync if necessary. Further, sync will fail for a R/O file on Windows. error := Platform.Sync(f.fd); @@ -231,7 +230,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR f: File; BEGIN NEW(f); f.workName := ""; COPY(name, f.registerName); - f.fd := noDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) + f.fd := NoDesc; f.state := create; f.len := 0; f.pos := 0; f.swapper := -1; (*all f.buf[i] = NIL*) RETURN f END New; @@ -275,7 +274,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files WHILE f # NIL DO IF Platform.SameFile(identity, f.identity) THEN IF ~Platform.SameFileTime(identity, f.identity) THEN i := 0; - WHILE i < nofbufs DO + WHILE i < NumBufs DO IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) END; @@ -340,11 +339,11 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files PROCEDURE Purge* (f: File); VAR i: INTEGER; identity: Platform.FileIdentity; error: Platform.ErrorCode; BEGIN i := 0; - WHILE i < nofbufs DO + WHILE i < NumBufs DO IF f.bufs[i] # NIL THEN f.bufs[i].org := -1; f.bufs[i] := NIL END; INC(i) END; - IF f.fd # noDesc THEN + IF f.fd # NoDesc THEN error := Platform.Truncate(f.fd, 0); error := Platform.Seek(f.fd, 0, Platform.SeekSet) END; @@ -361,7 +360,9 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END GetDate; PROCEDURE Pos* (VAR r: Rider): LONGINT; - BEGIN RETURN r.org + r.offset + BEGIN + ASSERT(r.offset <= BufSize); + RETURN r.org + r.offset END Pos; PROCEDURE Set* (VAR r: Rider; f: File; pos: LONGINT); @@ -376,14 +377,14 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files Out.Ln; *) IF pos > f.len THEN pos := f.len ELSIF pos < 0 THEN pos := 0 END; - offset := pos MOD bufsize; org := pos - offset; i := 0; - WHILE (i < nofbufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; - IF i < nofbufs THEN + offset := pos MOD BufSize; org := pos - offset; i := 0; + WHILE (i < NumBufs) & (f.bufs[i] # NIL) & (org # f.bufs[i].org) DO INC(i) END; + IF i < NumBufs THEN IF f.bufs[i] = NIL THEN NEW(buf); buf.chg := FALSE; buf.org := -1; buf.f := f; f.bufs[i] := buf ELSE buf := f.bufs[i] END ELSE - f.swapper := (f.swapper + 1) MOD nofbufs; + f.swapper := (f.swapper + 1) MOD NumBufs; buf := f.bufs[f.swapper]; Flush(buf) END; @@ -400,6 +401,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files END ELSE buf := NIL; org := 0; offset := 0 END; + ASSERT(offset <= BufSize); r.buf := buf; r.org := org; r.offset := offset; r.eof := FALSE; r.res := 0 END Set; @@ -408,6 +410,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files BEGIN buf := r.buf; offset := r.offset; IF r.org # buf.org THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + ASSERT(offset <= buf.size); IF (offset < buf.size) THEN x := buf.data[offset]; r.offset := offset + 1 ELSIF r.org + offset < buf.f.len THEN @@ -424,7 +427,7 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; @@ -432,7 +435,8 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF restInBuf = 0 THEN r.res := n; r.eof := TRUE; RETURN ELSIF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(buf.data) + ToAdr(offset), SYSTEM.ADR(x) + ToAdr(xpos), min); - INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min) + INC(offset, min); r.offset := offset; INC(xpos, min); DEC(n, min); + ASSERT(offset <= BufSize) END; r.res := 0; r.eof := FALSE END ReadBytes; @@ -445,10 +449,12 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - IF (r.org # buf.org) OR (offset >= bufsize) THEN + ASSERT(offset <= BufSize); + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; + ASSERT(offset < BufSize); buf.data[offset] := x; buf.chg := TRUE; IF offset = buf.size THEN @@ -463,14 +469,17 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files IF n > LEN(x) THEN IdxTrap END; xpos := 0; buf := r.buf; offset := r.offset; WHILE n > 0 DO - IF (r.org # buf.org) OR (offset >= bufsize) THEN + ASSERT(offset <= BufSize); + IF (r.org # buf.org) OR (offset >= BufSize) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset END; - restInBuf := bufsize - offset; + ASSERT(offset <= BufSize); + restInBuf := BufSize - offset; IF n > restInBuf THEN min := restInBuf ELSE min := n END; SYSTEM.MOVE(SYSTEM.ADR(x) + ToAdr(xpos), SYSTEM.ADR(buf.data) + ToAdr(offset), min); INC(offset, min); r.offset := offset; + ASSERT(offset <= BufSize); IF offset > buf.size THEN INC(buf.f.len, offset - buf.size); buf.size := offset END; INC(xpos, min); DEC(n, min); buf.chg := TRUE END; @@ -479,14 +488,14 @@ MODULE Files; (* J. Templ 1.12. 89/12.4.95 Oberon files mapped onto Unix files (* another solution would be one that is similar to ReadBytes, WriteBytes. No code duplication, more symmetric, only two ifs for -Read and Write in buffer, buf.size replaced by bufsize in Write ops, buf.size and len +Read and Write in buffer, buf.size replaced by BufSize in Write ops, buf.size and len must be made consistent with offset (if offset > buf.size) in a lazy way. PROCEDURE Write* (VAR r: Rider; x: SYSTEM.BYTE); VAR buf: Buffer; offset: LONGINT; BEGIN buf := r.buf; offset := r.offset; - IF (offset >= bufsize) OR (r.org # buf.org) THEN + IF (offset >= BufSize) OR (r.org # buf.org) THEN Set(r, buf.f, r.org + offset); buf := r.buf; offset := r.offset; END; buf.data[offset] := x; r.offset := offset + 1; buf.chg := TRUE @@ -541,7 +550,7 @@ Especially Length would become fairly complex. IF error # 0 THEN res := 2; RETURN END; error := Platform.New(new, fdnew); IF error # 0 THEN error := Platform.Close(fdold); res := 3; RETURN END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + error := Platform.Read(fdold, SYSTEM.ADR(buf), BufSize, n); WHILE n > 0 DO error := Platform.Write(fdnew, SYSTEM.ADR(buf), n); IF error # 0 THEN @@ -549,7 +558,7 @@ Especially Length would become fairly complex. ignore := Platform.Close(fdnew); Err("cannot move file", NIL, error) END; - error := Platform.Read(fdold, SYSTEM.ADR(buf), bufsize, n); + error := Platform.Read(fdold, SYSTEM.ADR(buf), BufSize, n); END; ignore := Platform.Close(fdold); ignore := Platform.Close(fdnew); From 7abdaf2312f6978575e49d2d38ead10e85d02056 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 12:50:07 +0000 Subject: [PATCH 131/140] Add new test virtual machines --- src/tools/make/buildall.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 20d99cbd..bba5eeca 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -20,7 +20,11 @@ my %machines = ( . "export CC=gcc && make full;" . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], - "lub32" => ['dave@lub32', "sudo", "vishap/voc", "make full"], + "oldlub32"=> ['dave@lub32', "sudo", "vishap/voc", "make full"], + "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], + "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], + "fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"], + "osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"], From fd744350edabf4c83b9aba3469624ffe07102225 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 13:07:34 +0000 Subject: [PATCH 132/140] Update bootstrap. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 11 ++++++++++- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 11 ++++++++++- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 11 ++++++++++- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 11 ++++++++++- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 11 ++++++++++- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 235 insertions(+), 190 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 428cf3db..fca47b71 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 4c861f05..139c7610 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index d5d3297d..f711e45a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f58bb07a..d8f1091f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 0a85488d..2c06f00f 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index f661a75f..d9dc4a1e 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 883fba9f..10794f98 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 428cf3db..fca47b71 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 4c861f05..139c7610 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index a80a5307..cbbea5ee 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f58bb07a..d8f1091f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 0a85488d..2c06f00f 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 9827cf2e..79978dd0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 51e39825..85d96a5c 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index e90d45de..a69b1ca4 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index e9575a26..75bbd79d 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 37d3265c..6fccacad 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5aa43338..38e22dc5 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 6c9fd2b7..5cd3a8f2 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 36a43b89..8d12d8b8 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 59d1e709..ba967ced 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index df081a58..45020434 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 5d180b17..230bfeab 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index bc314d4d..335dfb8b 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 4d64af83..1a860275 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index ed5faf55..d45341cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index fedd5ba1..72d11d0a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fe5ba341..c2de6638 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6fab39f4..7c7e002a 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -526,6 +526,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -584,6 +585,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -602,6 +604,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -646,6 +649,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -662,11 +666,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -688,11 +694,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -702,6 +710,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 305419c8..268537df 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index be352cc8..9c565b65 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 620c600d..293dde6d 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e2a62e9c..be6e0643 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 63faf68d..9727f400 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index ffc41784..334a40ef 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index a80a5307..cbbea5ee 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7eb931aa..7647ce34 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 6f988eae..7664fba6 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 893f8576..168bd702 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 8d2441f4..6d71e6ec 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 9827cf2e..79978dd0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 51e39825..85d96a5c 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index ef5126fc..f25df83b 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 8dee54dd..91d42e8e 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 68bf9ed7..1415f836 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index b3d5385e..86ac4e72 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -527,6 +527,7 @@ void Files_GetDate (Files_File f, INT32 *t, INT32 *d) INT32 Files_Pos (Files_Rider *r, ADDRESS *r__typ) { + __ASSERT((*r).offset <= 4096, 0); return (*r).org + (*r).offset; } @@ -585,6 +586,7 @@ void Files_Set (Files_Rider *r, ADDRESS *r__typ, Files_File f, INT32 pos) org = 0; offset = 0; } + __ASSERT(offset <= 4096, 0); (*r).buf = buf; (*r).org = org; (*r).offset = offset; @@ -603,6 +605,7 @@ void Files_Read (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x) buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= buf->size, 0); if (offset < buf->size) { *x = buf->data[offset]; (*r).offset = offset + 1; @@ -647,6 +650,7 @@ void Files_ReadBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT x (*r).offset = offset; xpos += min; n -= min; + __ASSERT(offset <= 4096, 0); } (*r).res = 0; (*r).eof = 0; @@ -663,11 +667,13 @@ void Files_Write (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE x) INT32 offset; buf = (*r).buf; offset = (*r).offset; + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset < 4096, 0); buf->data[offset] = x; buf->chg = 1; if (offset == buf->size) { @@ -689,11 +695,13 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT buf = (*r).buf; offset = (*r).offset; while (n > 0) { + __ASSERT(offset <= 4096, 0); if ((*r).org != buf->org || offset >= 4096) { Files_Set(&*r, r__typ, buf->f, (*r).org + offset); buf = (*r).buf; offset = (*r).offset; } + __ASSERT(offset <= 4096, 0); restInBuf = 4096 - offset; if (n > restInBuf) { min = restInBuf; @@ -703,6 +711,7 @@ void Files_WriteBytes (Files_Rider *r, ADDRESS *r__typ, SYSTEM_BYTE *x, LONGINT __MOVE((ADDRESS)x + Files_ToAdr(xpos), (ADDRESS)buf->data + Files_ToAdr(offset), min); offset += min; (*r).offset = offset; + __ASSERT(offset <= 4096, 0); if (offset > buf->size) { buf->f->len += offset - buf->size; buf->size = offset; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 47a3d116..031c9316 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 37d3265c..6fccacad 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5aa43338..38e22dc5 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 6c9fd2b7..5cd3a8f2 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 2ec0e428..7def082a 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8533be52..217eeb29 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index d59b8602..fb6b73a6 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index e92faf91..0531b31c 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index eede7b95..d60c768f 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 36a43b89..8d12d8b8 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 2e875d8f..53606446 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 59d1e709..ba967ced 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 960ea29e..1d5d5fe5 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 72d77adb..aef09240 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 92740884..5c6a4918 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index df081a58..45020434 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index b6ecef0e..e4034455 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 5d180b17..230bfeab 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index ad0a4e1c..84dfb3e7 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6f988eae..7664fba6 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index e3b542f1..08a49b70 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 8017966b..f556570a 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 5c38cd8d..c7ff9362 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index e532c10a..4338272f 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 9e6d921e..da39ccfe 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 5921a597..884336a1 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index c8760025..2131b02a 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index fedd5ba1..72d11d0a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fe5ba341..c2de6638 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 8b786199..7b0a9006 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index ca8fd2fa..34999961 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index e1cc07ba..b5104358 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index c31ea618..54bf5084 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/15]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 66105ee5ae784d83d8f1d80987d916df657e6d73 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 14:17:08 +0000 Subject: [PATCH 133/140] Add output of id command to poostpush log. --- src/tools/make/postpush.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 47956785..5cfe3008 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -17,6 +17,7 @@ sub writelog { flock(LOG, 2) or die "Could not lock postpush.log"; print LOG sprintf("%s %s\n", strftime("%Y/%m/%d %H.%M.%S", localtime), $msg); close(LOG); + system "id >> /tmp/postpush.log"; } my $postdata = from_json(param('POSTDATA')); From 8e1897fe17e6feac4d511e70a629d68045f5fe66 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 14:49:11 +0000 Subject: [PATCH 134/140] Ha! Still getting the wrong security for new machines to build. Lets try again. --- src/tools/make/postpush.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/make/postpush.pl b/src/tools/make/postpush.pl index 5cfe3008..5bfe0ffb 100755 --- a/src/tools/make/postpush.pl +++ b/src/tools/make/postpush.pl @@ -1,11 +1,9 @@ #!/usr/bin/perl -w - use strict; use warnings; use POSIX "strftime"; - use CGI qw(:standard escapeHTML); use JSON; From bf65c3744b964716d1ce9350d8638180f4f053aa Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 17:10:29 +0000 Subject: [PATCH 135/140] Split windows build into parallel cygwin and mingw builds, remove old nas builds. --- src/tools/make/buildall.pl | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index bba5eeca..2207b205 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -12,22 +12,34 @@ if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], - "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" - . "export CC=i686-w64-mingw32-gcc && make full;" + +# "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" +# . "export CC=i686-w64-mingw32-gcc && make full;" +# . "cd ~;" +# . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" +# . "git pull && git checkout $branch && git pull;" +# . "export CC=gcc && make full;" +# . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], + + "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" + . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" - . "export CC=gcc && make full;" - . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], + . "export CC=gcc && make full;\\\""], + + "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" + . "cd ~;" + . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" + . "git pull && git checkout $branch && git pull;" + . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], + "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], - "oldlub32"=> ['dave@lub32', "sudo", "vishap/voc", "make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], "fed64" => ['dave@vim-fed64', "sudo", "oberon/voc", "make full"], "osu64" => ['dave@vim-osu64', "sudo", "oberon/voc", "make full"], "ob32" => ['root@nas-ob32', "", "vishap/voc", "make full"], "ce64" => ['-p5922 obe@www', "sudo", "vishap/voc", "make full"], - "ub64" => ['dave@nas-ub64', "sudo", "vishap/voc", "make full"], "fb64" => ['root@oberon', "", "vishap/voc", "make full"] ); From 2321695270324c7342e2443dd03fa1dff1eff273 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 18 Nov 2016 17:26:10 +0000 Subject: [PATCH 136/140] Hopefully fix 64 bit cygwin and mingw builds. --- src/tools/make/buildall.pl | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 2207b205..0dbb0260 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -12,27 +12,16 @@ if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} my %machines = ( "pi" => ['pi@pie', "sudo", "projects/oberon/vishap/voc", "make full"], "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], - -# "wind" => ['-p5932 dave@wax', "", "vishaps/voc", "export CC=gcc && make full;" -# . "export CC=i686-w64-mingw32-gcc && make full;" -# . "cd ~;" -# . "sh start64.sh \\\"cd vishaps/voc && git reset --hard && git clean -dfx &&" -# . "git pull && git checkout $branch && git pull;" -# . "export CC=gcc && make full;" -# . "export CC=x86_64-w64-mingw32-gcc && make full\\\""], - "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" . "export CC=gcc && make full;\\\""], - "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" . "git pull && git checkout $branch && git pull;" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], - "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], "lub32" => ['dave@vim-lub32', "sudo", "oberon/voc", "make full"], From 3798b9c5373fa73c8bde65259d859097b9623c47 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 19 Nov 2016 00:42:35 +0000 Subject: [PATCH 137/140] Fix mingw/msc support on pre Windows 10 systems. --- src/runtime/Platformwindows.Mod | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/Platformwindows.Mod b/src/runtime/Platformwindows.Mod index 6a80bff4..bde70184 100644 --- a/src/runtime/Platformwindows.Mod +++ b/src/runtime/Platformwindows.Mod @@ -435,12 +435,13 @@ END ReadBuf; -PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT; VAR n: SYSTEM.INT32): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0)"; PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: LONGINT): ErrorCode; +VAR n: SYSTEM.INT32; BEGIN - IF writefile(h, p, l) = 0 THEN RETURN err() ELSE RETURN 0 END + IF writefile(h, p, l, n) = 0 THEN RETURN err() ELSE RETURN 0 END END Write; From 036b8eef4197c2eb688ef6956e9cb71d5c458d60 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sat, 19 Nov 2016 15:17:51 +0000 Subject: [PATCH 138/140] Update bootstrap. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 ++-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 ++-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 ++-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 ++-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 7 ++++--- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 ++-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 7 ++++--- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 196 insertions(+), 194 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fca47b71..fc08bb66 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 139c7610..51464477 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index f711e45a..48ee337d 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index d8f1091f..71e9381c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 2c06f00f..3e9d5b43 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index d9dc4a1e..05d3df80 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 10794f98..6738320c 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fca47b71..fc08bb66 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 139c7610..51464477 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index cbbea5ee..076b5e16 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index d8f1091f..71e9381c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 2c06f00f..3e9d5b43 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 79978dd0..595fa511 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 85d96a5c..17506204 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a69b1ca4..a812a3de 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 75bbd79d..3cbd88cf 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 6fccacad..830efb5f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 38e22dc5..c69d655b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 5cd3a8f2..42f2051a 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 8d12d8b8..55f7f41b 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index ba967ced..02abdf28 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 45020434..2682db8a 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 230bfeab..38f21585 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 335dfb8b..8cef91b8 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 1a860275..a41c8622 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index d45341cb..1fa15be1 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 72d11d0a..a567719a 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index c2de6638..4825ba4c 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 7c7e002a..13f94028 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 268537df..c632b029 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 9c565b65..28b5931a 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 293dde6d..a8f43cd4 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index be6e0643..2d6a6601 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 9727f400..bfcd9a7d 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 334a40ef..2aba6340 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index cbbea5ee..076b5e16 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 7647ce34..b219bec1 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 7664fba6..082aa1be 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 168bd702..19195bf6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -176,7 +176,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l, n) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -525,7 +525,8 @@ INT16 Platform_ReadBuf (INT32 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) INT16 Platform_Write (INT32 h, INT32 p, INT32 l) { - if (Platform_writefile(h, p, l) == 0) { + INT32 n; + if (Platform_writefile(h, p, l, &n) == 0) { return Platform_err(); } else { return 0; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 6d71e6ec..162dda27 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 79978dd0..595fa511 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 85d96a5c..17506204 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f25df83b..f91f65b0 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 91d42e8e..37061819 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1415f836..b182309a 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 86ac4e72..c765bb85 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 031c9316..3af067f2 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 6fccacad..830efb5f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 38e22dc5..c69d655b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 5cd3a8f2..42f2051a 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 7def082a..a13681ca 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 217eeb29..8dde1d6f 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index fb6b73a6..019adbb7 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 0531b31c..4c1eaf60 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index d60c768f..1008f2b2 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 8d12d8b8..55f7f41b 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 53606446..a4631607 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index ba967ced..02abdf28 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 1d5d5fe5..ecb8b3dd 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index aef09240..86adcd6a 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 5c6a4918..13869701 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 45020434..2682db8a 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index e4034455..f18e86c7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 230bfeab..38f21585 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 84dfb3e7..b29088ac 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 7664fba6..082aa1be 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 08a49b70..6c12b541 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index f556570a..6bc7548d 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -176,7 +176,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l, n) (INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, (DWORD*)n, 0) BOOLEAN Platform_TooManyFiles (INT16 e) { @@ -525,7 +525,8 @@ INT16 Platform_ReadBuf (INT64 h, SYSTEM_BYTE *b, LONGINT b__len, INT32 *n) INT16 Platform_Write (INT64 h, INT64 p, INT32 l) { - if (Platform_writefile(h, p, l) == 0) { + INT32 n; + if (Platform_writefile(h, p, l, &n) == 0) { return Platform_err(); } else { return 0; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c7ff9362..c235aa2b 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4338272f..45163d35 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index da39ccfe..1d66f986 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 884336a1..1c626264 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 2131b02a..a9865bc1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 72d11d0a..a567719a 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index c2de6638..4825ba4c 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 7b0a9006..072be052 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 34999961..68fd3b81 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index b5104358..54bf0d04 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 54bf5084..fb77b9a7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/18]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h From 1c137d2d7a5e72c980386a1111cac46275c75ba6 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 12:49:59 +0000 Subject: [PATCH 139/140] Doc updates. Add warning for anonymous ARAY or RECORD parameter types. --- ReadMe.md | 17 +-- doc/Installation.md | 242 +++++++++++++++++------------------ doc/Winstallation.md | 253 +++++++++++++++++++++++++++++++++++++ makefile | 9 +- src/compiler/Compiler.Mod | 1 - src/compiler/OPM.Mod | 28 ++-- src/compiler/OPP.Mod | 6 + src/compiler/OPT.Mod | 3 +- src/runtime/Errors.Txt | 1 + src/tools/make/configure.c | 2 - 10 files changed, 405 insertions(+), 157 deletions(-) create mode 100644 doc/Winstallation.md diff --git a/ReadMe.md b/ReadMe.md index 1330efb6..b5dbdb74 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -32,13 +32,14 @@ with the following simple steps. #### 1. Install prerequisites -| Platform | Packages | -| --------- | ------------ | -| Debian/Ubuntu/Mint ... | `apt-get install git` | -| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` | -| FreeBSD/OpenBSD/NetBSD | `pkg install git` | -| Cygwin | use setup-x86[_x64] to add packages git, make and gcc-core | -| Darwin | type 'git' at the command line and accept the prompt to install it. | +| Platform | Packages | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | `apt-get install git` | +| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` (`dnf` instead of `yum` on recent Fedoras) | +| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| OpenSUSE | `zypper install gcc git-core make glibc-devel-static` | +| Cygwin | use setup-x86[_x64] to add packages git, make, diffutils and gcc-core | +| Darwin | type 'git' at the command line and accept the prompt to install it. | More details, including for MingW and MS C, in [**Installation**](/doc/Installation.md). @@ -50,7 +51,7 @@ More details, including for MingW and MS C, in [**Installation**](/doc/Installat Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. -#### 3. Stet your PATH environment variable +#### 3. Set your PATH environment variable Set your path to the installed compiler binary location as reported by make full, e.g. diff --git a/doc/Installation.md b/doc/Installation.md index 64c50555..cbd893ca 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -1,152 +1,154 @@ -#### (Work in progress) +## Building and installation summary + +The Oberon compiler and libraries may be built and installed on Linux based, BSD based or Windows based systems. + +Building on Linux and BSD based systems is reasonably straightforward. First make sure you have he right pre-requites like C compiler and static libraries installed, then clone the repository and run `make full`. + +Full instructions for a Linux/BSD based build follow in the next section. -## TODO - - Organise into summary and per-platfrom sections - - with subsections for linux and BSD variants - - Add pre-requisites. E.g. static library support. +Bulding on Windows is not so simple largely because there is more than one way to do it: -#### Building and installation summary - -1. git clone https://github.com/vishaps/voc -2. cd voc -3. [sudo] make full - -Since 'make full' will install the compiler and libraries, it needs root (unix) or administrator (windows) privileges. - -| System | Install dir | Access required | -| ----------------------- | -------------------------------------- | ------------------------------ | -| Linux | /opt/voc | Needs root except under cygwin | -| BSD | /usr/local/share/voc | Needs root | -| Windows (mingw or Visual C) | %ProgramFiles[(X86)]% | Needs administrator | -| Termux (android) | /data/data/com.termux/files/opt/voc | | + - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. + With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make + as on Linux. + This builds a compiler that is dependent on the cygwin environment, and which compiles + Oberon programs to binaries that are themselves dependent on the cygwin environment. + + - Install the cygwin project and the mingw compiler. The Oberon compiler this builds is + still dependent on the cygwin environment, but programs built with this compiler are + Windows binaries dependent only on standard Microsoft APIs and libraries. + + - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). + The Oberon compiler can be built in the WSL using exactly the same procedure + as on a normal Ubuntu environment, and the resulting compiler and user programs will run + within the Windows subsystem for Linux. + + - Build with the Microsoft C compiler generating native windows binaries. A make.cmd script + is provided which has been developed for and tested with the free 'Visual C++ build tools' + available at http://landinghub.visualstudio.com/visual-cpp-build-tools. + +For building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) + +The following sections provide more details for Linux based builds. -#### 32 and 64 bit +### Building the Oberon compiler and libraries on a Linux or BSD based system -The size of compiler built is determined by the C compiler that runs, which is in turn determined by -the shell or command prompt configuration you are running under. +This approach is for + - All Linux based systems + - includes Android (specifically termux on Android) + - includes Windows subsystem for Linux (aka Bash on Ubuntu on Windows) + - All BSD based systems + - includes macOS (Darwin) + +#### 1. Install pre-requisites -The following type sizes follow the built compiler size: +The build process has the following pre-requisites: -| Types | 32 bit builds | 64 bit builds | -| ----- | ------------- | ------------- | -| INTEGER | 16 bit | 32 bit | -| LONGINT, SET | 32 bit | 64 bit | + - gcc (or clang) compiler + - static libraries for the chosen compiler + - git + - make + - diff -Note that many library modules have been written with the assumption that INTEGER -is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. +Example pre-requisite installation commands: -#### Which compiler? (gcc vs clang) +| Platform | Pre-requisite installation | +| --------- | ------------ | +| Debian/Ubuntu/Mint ... | `apt-get install git` | +| Fedora/RHEL/CentOS ... | `yum install git gcc glibc-static` (`dnf` instead of `yum` on recent Fedoras) | +| FreeBSD/OpenBSD/NetBSD | `pkg install git` | +| OpenSUSE | `zypper install gcc git-core make glibc-devel-static` | -By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. +On Mac OS (Darwin) just type the git command. OS/X will tell you that it is not installed and ask if you want to install it (say yes). Note that Darwin builds always use clang, the OS will redirect attempts to use gcc to clang. -*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. +#### 2. Clone the Oberon compiler repository -*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. +Create and change to a directory in which to make the compiler and clone with this command: + +`git clone https://github.com/vishaps/voc` + +This will create a subdirectory 'voc' which includes the following files and directories: + +| Name | Content | +| --- | --- | +| src/ | Compiler and library source, build tools and tests. | +| bootstrap/ | Pre-generated C source for the compiler targetting the 5 distinct build models needed. | +| doc/ | Documents (including this one). | +| makefile | Makefile for all BSD- and Linux- like environments. Includes tests. | +| make.cmd | Makefile specifically for native Microsoft C builds. No tests. | + +#### 3. Build and install the Oberon compiler and library -#### Building on Windows +``` +cd voc +[sudo] make full +``` -There are three ways to build on Windows: +The makefile will: -| Type | How to build | Compiled binary uses: | -| ----------- | ------- | --------------------- | -| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | -| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | -| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + - Compile and run a C program that determines your C compiler and OS's configuration and creates + the files Configuration.Make and Configuration.Mod. + - C Compile the bootstrap C sources to generate an interim Oberon compiler for your configuration. + - Use the interim compiler to compile the src/compiler and src/runtime directories and statically + link the final Oberon compiler. This compiler is then used for the remaining steps. + - Build the .sym file browser command `showdef`. + - Build all the libraries in -O2 mode, and a subset in -OC mode. + - Install the compiler and libraries by copying them to an appropriate location for your OS. + - Run a set of confidence tests. -##### mingw on cygwin +Since installation directories are not generally write accessible to normal users, is is necessary to run +the `make full` command from a root shell, or by using `sudo`. -To use mingw, install the correct sized package and export CC= the compiler name: +The makefile will use either gcc or clang, whichever is installed. If you have both installed you can specify which to use by running either `export CC=gcc` or `export CC=clang` before the `make full` command. - - For 32 bit cygwin - - use setup-x86.exe to add the package mingw64-i686-gcc-core. - - run 'export CC=i686-w64-mingw32-gcc' then 'make full' +#### Installation directories: + +If the makefile succeeds it will end with instructions on how to set your path variable so that the +compiler (voc) is found. + +The installation will be found at: + +| System | Install dir | +| ----------------------- | -------------------------------------- | +| All types of Linux | /opt/voc | +| BSD (including Darwin) | /usr/local/share/voc | +| Termux (android) | /data/data/com.termux/files/opt/voc | | - - For 64 bit cygwin +The installation directory contains: - - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. - - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' +| Directory | Content | +| --- | --- | +| bin/ | Compiler and symbol file browser command binaries. | +| lib/ | Static and dynamic link libraries for all (-O2 and -OC) type models. | +| 2/include/ | C compiler header files for -O2 modules | +| 2/sym/ | .sym files for -O2 modules | +| C/include/ | C compiler header files for -OC modules | +| C/sym/ | .sym files for -OC modules | -(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) -##### Microsoft Visual C compiler -Use the free command line Visual C++ compiler. At the time of writing it can be -downloaded here: +### 32 and 64 bit - http://landinghub.visualstudio.com/visual-cpp-build-tools +The compiler may be built on both 32 bit and 64 bit systems. -For example (Windows 10): +Oberon programs may be compiled using the -O2 (default) or -OC elementary type models. The elementary +types are as follows: -Start an adminstrator command prompt from the start button as follows: +| Model | 8 bit | 16 bit | 32 bit | 64 bit | +| --- | ---- | --- | --- | --- | +| -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | +| -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | - Start / All apps / Visual C++ Build Tools +A convention of many Oberon compilers has been that LONGINT is a suitable integer type for +manipulating addresses. However since the size of pointer types is fixed by the OS and we +support both 32 and 64 bit operating systems, LONGINT is not always sufficient for us. -Right click on +Accordingly, the SYSTEM module has been updated to ease the development of platform independent +code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` +and `SYSTEM.ADDRESS`. - Visual C++ 2015 x86 Native Build Tools Command Prompt - -or - - Visual C++ 2015 x64 Native Build Tools Command Prompt - -And select - - More / Administrative Command Prompt - -#### How make adapts to each platform - -On all platforms other than Visual C on Windows, make runs from a bash shell, -using makefile in the enlistment root, and vishap.make in the src/tools/make -directory. - -For Visual C only, there is a slightly cut down implementation of the same -functionality in the file 'make.cmd' in the enlistment root. - -In all cases src/tools/make/configure.c is executed to determine all -platform dependent parameters: it generates two files: - - - Configuration.Make: a set of environment variables included by the makefile - - Configuration.Mod: An Oberon MODULE containing just configuraton constants. - -The following examples correspond to a 32 bit Ubuntu build using GCC: - -Configuration.Make: - - OLANGDIR=/home/dave/projects/oberon/olang - COMPILER=gcc - OS=ubuntu - VERSION=1.2 - ONAME=voc - DATAMODEL=ILP32 - INTSIZE=2 - ADRSIZE=4 - ALIGNMENT=4 - INSTALLDIR=/opt/voc - PLATFORM=unix - BINEXT= - COMPILE=gcc -fPIC -g - STATICLINK=-static - LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi - -Configuration.Mod: - - MODULE Configuration; - CONST - name* = 'voc'; - versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; - intsize* = 2; - addressSize* = 4; - alignment* = 4; - objext* = '.o'; - objflag* = ' -o '; - linkflags* = ' -L"'; - libspec* = ' -l voc'; - compile* = 'gcc -fPIC -g'; - dataModel* = 'ILP32'; - installdir* = '/opt/voc'; - staticLink* = '-static'; - END Configuration. +For details, see [**Features**](doc/Features.md). diff --git a/doc/Winstallation.md b/doc/Winstallation.md new file mode 100644 index 00000000..b7a1f1b0 --- /dev/null +++ b/doc/Winstallation.md @@ -0,0 +1,253 @@ +### Building the Oberon compiler and libraries on a Windows system + +This approach is for Windows systems using + - Cygwin (with or without mingw) + - Microsoft Visual C + +Building on Bash on Ubuntu on Windows (aka Windows Subsystem for Linux) is the same as building on Ubuntu, +for which see [**Installation**](/doc/Installation.md). + +### Building and installing with Cygwin + +Cygwin comes in 32 bit and 64 bit flavours, and both may be installed on a 64 bit system. On such a dual system, Oberon may be built and installed in both Cygwins. + + +#### 1. Install pre-requisites + +The build process has the following pre-requisites: + + - gcc (or clang) compiler + - static libraries for the chosen compiler + - git + - make + - diff + +To install these, run the Cygwin setup program (setup-x86.exe or setup-x86_64.exe as appropriate), work +your way through the initaial questions until you reach the 'Select packages' page, and make sure the +following packages are selected: + +| Section | Package | +| --- | --- | +| devel | binutils | +| devel | git | +| devel | gcc-core | +| devel | make | +| utils | diffutils | + +Click next and continue to the end of setup. + +#### 2. Clone the Oberon compiler repository + +Create and change to a directory in which to make the compiler and clone with this command: + +`git clone https://github.com/vishaps/voc` + +This will create a subdirectory 'voc' including the following files and directories: + +| Name | Content | +| --- | --- | +| src/ | Compiler and library source, build tools and tests. | +| bootstrap/ | Pre-generated C source for the compiler targetting the 5 distinct build models needed. | +| doc/ | Documents (including this one). | +| makefile | Makefile for all BSD- and Linux- like environments. Includes tests. | +| make.cmd | Makefile specifically for native Microsoft C builds. No tests. | + +#### 3. Build and install the Oberon compiler and library + + +``` +cd voc +[sudo] make full +``` + +The makefile will: + + - Compile and run a C program that determines your C compiler and OS's configuration and creates + the files Configuration.Make and Configuration.Mod. + - C Compile the bootstrap C sources to generate an interim Oberon compiler for your configuration. + - Use the interim compiler to compile the src/compiler and src/runtime directories and statically + link the final Oberon compiler. This compiler is then used for the remaining steps. + - Build the .sym file browser command `showdef`. + - Build all the libraries in -O2 mode, and a subset in -OC mode. + - Install the compiler and libraries by copying them to an appropriate location for your OS. + - Run a set of confidence tests. + + + Since installation directories are not generally write accessible to normal users, is is necessary to run + the `make full` command from a root shell, or by using `sudo`. + + #### Installation directories: + + If it succeeds the makefile will end with instructions on how to set your path variable so that the + compiler (voc) is found. + + The installation will be found at: + +| System | Install dir | +| ----------------------- | -------------------------------------- | +| All types of Linux | /opt/voc | +| BSD (including Darwin) | /usr/local/share/voc | +| Termux (android) | /data/data/com.termux/files/opt/voc | | + +The installation directory contains: + +| Directory | Content | +| --- | --- | +| bin/ | Compiler and symbol file browser command binaries. | +| lib/ | Static and dynamic link libraries for all (-O2 and -OC) type models. | +| 2/include/ | C compiler header files for -O2 modules | +| 2/sym/ | .sym files for -O2 modules | +| C/include/ | C compiler header files for -OC modules | +| C/sym/ | .sym files for -OC modules | + + + +### 32 and 64 bit + +The compiler may be built on both 32 bit and 64 bit systems. + +User Oberon programs may be compiled using the -O2 (default) or -OC elementary type models. The elementary +types are as follows: + +| Model | 8 bit types | 16 bit types | 32 bit types | 64 bit types | +| --- | ---- | --- | --- | --- | +| -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | +| -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | + +Of course the size of pointer types is fixed by the OS. + +The SYSTEM module has been updated to ease the development of platform independent code, with new +types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` and `SYSTEM.ADDRESS`. + +For more details, see [**Features**](doc/Features.md). + +---- + +---- + +The size of compiler built is determined by the C compiler that runs, which is in turn determined by +the shell or command prompt configuration you are running under. + +The following type sizes follow the built compiler size: + +| Types | 32 bit builds | 64 bit builds | +| ----- | ------------- | ------------- | +| INTEGER | 16 bit | 32 bit | +| LONGINT, SET | 32 bit | 64 bit | + +Note that many library modules have been written with the assumption that INTEGER +is 16 bit and LONGINT 32 bit, therefore they will only work in 32 bit builds. + +#### Which compiler? (gcc vs clang) + +By default make uses the compiler defined in variable CC. This can be overriden by running 'export CC=gcc' or 'export CC=clang' from the command line before running make. + +*Note*: be sure to run 'make clean' any time you change the value of CC. Otherwise directories will be mixed up. + +*Note*: Darwin (MAC OS/X) redirects gcc to clang, so specifying CC=gcc still builds clang binaries under Darwin. + + +#### Building on Windows + +There are three ways to build on Windows: + +| Type | How to build | Compiled binary uses: | +| ----------- | ------- | --------------------- | +| cygwin | Use 'make' from cygwin bash shell. | cygwin.dll | +| mingw under cygwin | Set CC for mingw then use 'make' from cygwin bash shell. | Win32 API | +| Visual C | Use 'make.cmd' from Visual C command prompt. | Win32 API | + +##### mingw on cygwin + +To use mingw, install the correct sized package and export CC= the compiler name: + + - For 32 bit cygwin + + - use setup-x86.exe to add the package mingw64-i686-gcc-core. + - run 'export CC=i686-w64-mingw32-gcc' then 'make full' + + - For 64 bit cygwin + + - use setup-x86\_64.exe to add the package mingw64-x86\_64-gcc-core. + - run 'export CC=x86_64-w64-mingw32-gcc' then 'make full' + +(*Note*: Don't be put off by the name 'mingw64' in the 32 bit package.) + +##### Microsoft Visual C compiler + +Use the free command line Visual C++ compiler. At the time of writing it can be +downloaded here: + + http://landinghub.visualstudio.com/visual-cpp-build-tools + +For example (Windows 10): + +Start an adminstrator command prompt from the start button as follows: + + Start / All apps / Visual C++ Build Tools + +Right click on + + Visual C++ 2015 x86 Native Build Tools Command Prompt + +or + + Visual C++ 2015 x64 Native Build Tools Command Prompt + +And select + + More / Administrative Command Prompt + +#### How make adapts to each platform + +On all platforms other than Visual C on Windows, make runs from a bash shell, +using makefile in the enlistment root, and vishap.make in the src/tools/make +directory. + +For Visual C only, there is a slightly cut down implementation of the same +functionality in the file 'make.cmd' in the enlistment root. + +In all cases src/tools/make/configure.c is executed to determine all +platform dependent parameters: it generates two files: + + - Configuration.Make: a set of environment variables included by the makefile + - Configuration.Mod: An Oberon MODULE containing just configuraton constants. + +The following examples correspond to a 32 bit Ubuntu build using GCC: + +Configuration.Make: + + OLANGDIR=/home/dave/projects/oberon/olang + COMPILER=gcc + OS=ubuntu + VERSION=1.2 + ONAME=voc + DATAMODEL=ILP32 + INTSIZE=2 + ADRSIZE=4 + ALIGNMENT=4 + INSTALLDIR=/opt/voc + PLATFORM=unix + BINEXT= + COMPILE=gcc -fPIC -g + STATICLINK=-static + LDCONFIG=if echo "/opt/voc/lib" >/etc/ld.so.conf.d/libvoc.conf; then ldconfig; fi + +Configuration.Mod: + + MODULE Configuration; + CONST + name* = 'voc'; + versionLong* = '1.2 [2016/06/11] for gcc ILP32 on ubuntu'; + intsize* = 2; + addressSize* = 4; + alignment* = 4; + objext* = '.o'; + objflag* = ' -o '; + linkflags* = ' -L"'; + libspec* = ' -l voc'; + compile* = 'gcc -fPIC -g'; + dataModel* = 'ILP32'; + installdir* = '/opt/voc'; + staticLink* = '-static'; + END Configuration. diff --git a/makefile b/makefile index 39da025f..12924600 100644 --- a/makefile +++ b/makefile @@ -85,15 +85,8 @@ usage: @echo " (Needs root access)" @echo "" @echo "Targets for (re)creating and reverting bootstrap C sources:" - @echo " make bootstrap - Uddate bootstrap C source directories. Always run on 64 bit." + @echo " make bootstrap - Update bootstrap C source directories." @echo " make revertbootstrap - Use git checkout to restore bootstrap C source directories" - @echo "" - @echo "" - @echo "Multi-platform coordinated network build:" - @echo " make coordinator - Start central task to trigger builds and collect logs" - @echo " make auto - Start machine specific build server" - @echo " make autobuild - Trigger all machines running 'make auto' to start a build" - @echo " make autobuild - Terminate 'make auto' on all machines" diff --git a/src/compiler/Compiler.Mod b/src/compiler/Compiler.Mod index 4ec44f03..0a373e7a 100644 --- a/src/compiler/Compiler.Mod +++ b/src/compiler/Compiler.Mod @@ -68,7 +68,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *) OPT.intobj.typ := OPT.inttyp; OPT.lintobj.typ := OPT.linttyp; - (*OPT.settyp.size := OPM.SetSize;*) CASE OPM.LongintSize OF |4: OPT.settyp := OPT.set32typ ELSE OPT.settyp := OPT.set64typ diff --git a/src/compiler/OPM.Mod b/src/compiler/OPM.Mod index c72912a7..fe43393b 100644 --- a/src/compiler/OPM.Mod +++ b/src/compiler/OPM.Mod @@ -92,7 +92,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) GlobalAlignment, Alignment*: INTEGER; GlobalOptions*, Options*: SET; - ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER; + ShortintSize*, IntegerSize*, LongintSize*: INTEGER; MaxIndex*: SYSTEM.INT64; @@ -214,13 +214,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) ASSERT((IntegerSize = 2) OR (IntegerSize = 4)); ASSERT((AddressSize = 4) OR (AddressSize = 8)); ASSERT((Alignment = 4) OR (Alignment = 8)); - IF IntegerSize = 2 THEN - LongintSize := 4; - SetSize := 4; - ELSE - LongintSize := 8; - SetSize := 8; - END; + IF IntegerSize = 2 THEN LongintSize := 4 ELSE LongintSize := 8 END; Files.SetSearchPath("") ELSE LogWStr(" warning: option "); @@ -317,11 +311,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) BEGIN LogWLn; LogWStr("Type Size"); LogWLn; - LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn; - LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn; - LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn; - LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn; - LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn; + LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); LogWLn; + LogWStr("INTEGER "); LogWNum(IntegerSize, 4); LogWLn; + LogWStr("LONGINT "); LogWNum(LongintSize, 4); LogWLn; + LogWStr("SET "); LogWNum(LongintSize, 4); LogWLn; + LogWStr("ADDRESS "); LogWNum(AddressSize, 4); LogWLn; LogWLn; LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn; END VerboseListSizes; @@ -344,10 +338,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *) MaxIndex := SignedMaximum(AddressSize); CASE Model[0] OF - |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 - |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8 - |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8 - ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4 + |'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4 + |'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8 + |'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8 + ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4 END; IF verbose IN Options THEN VerboseListSizes END; diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 72b6701d..329d52b4 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -218,6 +218,12 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END END ; CheckSym(OPS.colon); Type(typ, OPT.notyp); + + IF ((typ.comp = OPT.Array) OR (typ.comp = OPT.Record)) + & (typ.strobj = NIL) THEN + err(-309) + END; + IF mode = OPT.Var THEN typ^.pvused := TRUE END ; (* typ^.pbused is set when parameter type name is parsed *) WHILE first # NIL DO first^.typ := typ; first := first^.link END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 75ad6c72..54975745 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -1327,10 +1327,10 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; - EnterTyp("BOOLEAN", Bool, 1, booltyp); EnterTyp("CHAR", Char, 1, chartyp); EnterTyp("REAL", Real, 4, realtyp); @@ -1338,6 +1338,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("HUGEINT", Int, 8, hinttyp); EnterTyp("BYTE@", Int, 1, cpbytetyp); (* Component Pascal byte type, enabled in Compiler.PropagateElementaryTypeSize *) + (* Type aliases for standard integer and set types are linked to real types in Compiler.PropagateElementaryTypeSize *) EnterTypeAlias("SHORTINT", sintobj); EnterTypeAlias("INTEGER", intobj); EnterTypeAlias("LONGINT", lintobj); diff --git a/src/runtime/Errors.Txt b/src/runtime/Errors.Txt index a5cea1f1..5e608945 100644 --- a/src/runtime/Errors.Txt +++ b/src/runtime/Errors.Txt @@ -176,6 +176,7 @@ Compiler Warnings 306 inappropriate symbol file ignored 307 no ELSE symbol after CASE statement sequence may lead to trap 308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET +309 you should name this parameter type, or else no actual parameter will match Run-time Error Messages -1 assertion failed, cf. SYSTEM_assert diff --git a/src/tools/make/configure.c b/src/tools/make/configure.c index 13ea087a..24b7b903 100644 --- a/src/tools/make/configure.c +++ b/src/tools/make/configure.c @@ -11,8 +11,6 @@ #define O_VER 1.95 // Version number to be reported by compiler. #define O_NAME voc // Compiler name used for binary, install dir and references in text. -// #define LARGE // Define this to get 32 bit INTEGER and 64 bit longints even on 32 bit platforms. - #include "SYSTEM.h" From 610cc38efac38b6524a20133971529b5f5efb4c1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 24 Nov 2016 13:06:00 +0000 Subject: [PATCH 140/140] Update C bootstrap source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +-- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 2 +- bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 12 ++------ bootstrap/unix-44/OPM.h | 4 +-- bootstrap/unix-44/OPP.c | 5 ++- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +-- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 2 +- bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 12 ++------ bootstrap/unix-48/OPM.h | 4 +-- bootstrap/unix-48/OPP.c | 5 ++- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +-- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 2 +- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 12 ++------ bootstrap/unix-88/OPM.h | 4 +-- bootstrap/unix-88/OPP.c | 5 ++- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +-- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 2 +- bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 12 ++------ bootstrap/windows-48/OPM.h | 4 +-- bootstrap/windows-48/OPP.c | 5 ++- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +-- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 2 +- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 12 ++------ bootstrap/windows-88/OPM.h | 4 +-- bootstrap/windows-88/OPP.c | 5 ++- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- doc/Installation.md | 46 ++++++++++++++-------------- doc/Winstallation.md | 39 ++++++++++++----------- 187 files changed, 264 insertions(+), 276 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index fc08bb66..548774b0 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 51464477..79164af5 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 48ee337d..fb007184 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 71e9381c..72c15bf8 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 3e9d5b43..b04f552d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 05d3df80..0ac5c5f2 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 6738320c..0d5201cb 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index fc08bb66..548774b0 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 51464477..79164af5 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 076b5e16..75820a95 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 71e9381c..72c15bf8 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 3e9d5b43..b04f552d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 595fa511..ad26b1cb 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 17506204..e2c03958 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index a812a3de..826c3d63 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 3cbd88cf..855c5f7c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index 830efb5f..a2bb8f2f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index c69d655b..163cad8c 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 42f2051a..4e4d62e7 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 55f7f41b..60ab38c7 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 02abdf28..df908a43 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 2682db8a..a8d42b40 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 38f21585..4bd6b3fb 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index 8cef91b8..39f383cf 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index a41c8622..46e18441 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 1fa15be1..80307386 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index a567719a..ae12961b 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 4825ba4c..61a97dda 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 13f94028..5326fe10 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c632b029..62df86fc 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 28b5931a..72677604 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index a8f43cd4..0aa0a18b 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 2d6a6601..a5e72ba3 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index bfcd9a7d..e76d763e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 2aba6340..3f360d00 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 076b5e16..75820a95 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b219bec1..5c21cb97 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 082aa1be..720267fd 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 19195bf6..5a57f076 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 162dda27..f62a8ab8 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 595fa511..ad26b1cb 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 17506204..e2c03958 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index f91f65b0..dc4bb660 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 37061819..2d0061df 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); + __MOVE("1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index b182309a..b28e0caa 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index c765bb85..c3ea44cf 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 3af067f2..5c402312 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index 830efb5f..a2bb8f2f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index c69d655b..163cad8c 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 42f2051a..4e4d62e7 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index a13681ca..8bb89fe5 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 8dde1d6f..3ef8e2f9 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 019adbb7..0be714e8 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 4c1eaf60..ef4b429f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 1008f2b2..842e7dec 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 55f7f41b..60ab38c7 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -26,7 +26,7 @@ export INT16 OPM_AddressSize; static INT16 OPM_GlobalAlignment; export INT16 OPM_Alignment; export UINT32 OPM_GlobalOptions, OPM_Options; -export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +export INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; export INT64 OPM_MaxIndex; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export BOOLEAN OPM_noerr; @@ -245,10 +245,8 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len) __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); if (OPM_IntegerSize == 2) { OPM_LongintSize = 4; - OPM_SetSize = 4; } else { OPM_LongintSize = 8; - OPM_SetSize = 8; } Files_SetSearchPath((CHAR*)"", 1); break; @@ -395,7 +393,7 @@ static void OPM_VerboseListSizes (void) OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"SET ", 12); - OPM_LogWNum(OPM_SetSize, 4); + OPM_LogWNum(OPM_LongintSize, 4); OPM_LogWLn(); OPM_LogWStr((CHAR*)"ADDRESS ", 12); OPM_LogWNum(OPM_AddressSize, 4); @@ -432,25 +430,21 @@ void OPM_InitOptions (void) OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; case 'C': OPM_ShortintSize = 2; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; case 'V': OPM_ShortintSize = 1; OPM_IntegerSize = 4; OPM_LongintSize = 8; - OPM_SetSize = 8; break; default: OPM_ShortintSize = 1; OPM_IntegerSize = 2; OPM_LongintSize = 4; - OPM_SetSize = 4; break; } if (__IN(18, OPM_Options, 32)) { diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index a4631607..2d272feb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h @@ -9,7 +9,7 @@ import CHAR OPM_Model[10]; import INT16 OPM_AddressSize, OPM_Alignment; import UINT32 OPM_GlobalOptions, OPM_Options; -import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_SetSize; +import INT16 OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize; import INT64 OPM_MaxIndex; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import BOOLEAN OPM_noerr; diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 02abdf28..df908a43 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -392,6 +392,9 @@ static void OPP_FormalParameters (OPT_Object *firstPar, OPT_Struct *resTyp) } OPP_CheckSym(20); OPP_Type(&typ, &OPT_notyp); + if (((typ->comp == 2 || typ->comp == 4) && typ->strobj == NIL)) { + OPP_err(-309); + } if (mode == 1) { typ->pvused = 1; } diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index ecb8b3dd..5a71eb39 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 86adcd6a..6ee700e5 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 13869701..1f7a3e58 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 2682db8a..a8d42b40 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index f18e86c7..90fcacf5 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 38f21585..4bd6b3fb 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b29088ac..c4a61586 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 082aa1be..720267fd 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 6c12b541..0e66420d 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 6bc7548d..1e93deb2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index c235aa2b..f6a5d008 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 45163d35..cd4c3c61 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 1d66f986..f0c84ab1 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 1c626264..b5707327 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index a9865bc1..c987af8d 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index a567719a..ae12961b 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 4825ba4c..61a97dda 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 072be052..f69fd90e 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 68fd3b81..d99406ec 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 54bf0d04..37630d23 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index fb77b9a7..63e5df15 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/11/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ +/* voc 1.95 [2016/11/24]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/doc/Installation.md b/doc/Installation.md index cbd893ca..7c131005 100644 --- a/doc/Installation.md +++ b/doc/Installation.md @@ -2,34 +2,34 @@ The Oberon compiler and libraries may be built and installed on Linux based, BSD based or Windows based systems. -Building on Linux and BSD based systems is reasonably straightforward. First make sure you have he right pre-requites like C compiler and static libraries installed, then clone the repository and run `make full`. +Building on Linux and BSD based systems is reasonably straightforward. First make sure you have the right pre-requites like a C compiler and static libraries installed, then clone the repository and run `make full`. Full instructions for a Linux/BSD based build follow in the next section. Bulding on Windows is not so simple largely because there is more than one way to do it: - - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. - With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make - as on Linux. + - Install the cygwin project and use Windows from the cygwin bash shell rather like Linux. + With the pre-requisites installed using the cygwin setup.exe gui tool, clone and run make + as on Linux. This builds a compiler that is dependent on the cygwin environment, and which compiles Oberon programs to binaries that are themselves dependent on the cygwin environment. - + - Install the cygwin project and the mingw compiler. The Oberon compiler this builds is still dependent on the cygwin environment, but programs built with this compiler are Windows binaries dependent only on standard Microsoft APIs and libraries. - - - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). - The Oberon compiler can be built in the WSL using exactly the same procedure - as on a normal Ubuntu environment, and the resulting compiler and user programs will run + + - Use the Windows 10 Bash on Ubuntu on Windows (aka WSL - Windows Subsystem for Linux). + The Oberon compiler can be built in the WSL using exactly the same procedure + as on a normal Ubuntu environment, and the resulting compiler and user programs will run within the Windows subsystem for Linux. - + - Build with the Microsoft C compiler generating native windows binaries. A make.cmd script - is provided which has been developed for and tested with the free 'Visual C++ build tools' + is provided which has been developed for and tested with the free 'Visual C++ build tools' available at http://landinghub.visualstudio.com/visual-cpp-build-tools. - -For building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) - + +For full details about building with Cygwin or native Microsoft C environments see [**Cygwin and MSC Installation**](/doc/Winstallation.md) + The following sections provide more details for Linux based builds. @@ -39,9 +39,9 @@ This approach is for - All Linux based systems - includes Android (specifically termux on Android) - includes Windows subsystem for Linux (aka Bash on Ubuntu on Windows) - - All BSD based systems + - All BSD based systems - includes macOS (Darwin) - + #### 1. Install pre-requisites The build process has the following pre-requisites: @@ -106,12 +106,12 @@ The makefile will use either gcc or clang, whichever is installed. If you have b #### Installation directories: - + If the makefile succeeds it will end with instructions on how to set your path variable so that the compiler (voc) is found. - + The installation will be found at: - + | System | Install dir | | ----------------------- | -------------------------------------- | | All types of Linux | /opt/voc | @@ -143,12 +143,12 @@ types are as follows: | -O2 (default) | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | `HUGEINT` | | -OC | `BYTE` | `SHORTINT` | `INTEGER` | `LONGINT` and `SET` | -A convention of many Oberon compilers has been that LONGINT is a suitable integer type for +A convention of many Oberon compilers has been that LONGINT is a suitable integer type for manipulating addresses. However since the size of pointer types is fixed by the OS and we support both 32 and 64 bit operating systems, LONGINT is not always sufficient for us. -Accordingly, the SYSTEM module has been updated to ease the development of platform independent -code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` +Accordingly, the SYSTEM module has been updated to ease the development of platform independent +code, with new types such as `SYSTEM.INT8`, `SYSTEM.INT16`, `SYSTEM.INT32`, `SYSTEM.INT64` and `SYSTEM.ADDRESS`. -For details, see [**Features**](doc/Features.md). +For details, see [**Features**](/doc/Features.md). diff --git a/doc/Winstallation.md b/doc/Winstallation.md index b7a1f1b0..74eb3c97 100644 --- a/doc/Winstallation.md +++ b/doc/Winstallation.md @@ -1,6 +1,6 @@ ### Building the Oberon compiler and libraries on a Windows system -This approach is for Windows systems using +This approach is for Windows systems using - Cygwin (with or without mingw) - Microsoft Visual C @@ -21,9 +21,9 @@ The build process has the following pre-requisites: - git - make - diff - + To install these, run the Cygwin setup program (setup-x86.exe or setup-x86_64.exe as appropriate), work -your way through the initaial questions until you reach the 'Select packages' page, and make sure the +your way through the initaial questions until you reach the 'Select packages' page, and make sure the following packages are selected: | Section | Package | @@ -73,21 +73,24 @@ The makefile will: - Run a set of confidence tests. - Since installation directories are not generally write accessible to normal users, is is necessary to run - the `make full` command from a root shell, or by using `sudo`. - - #### Installation directories: - - If it succeeds the makefile will end with instructions on how to set your path variable so that the - compiler (voc) is found. - - The installation will be found at: - -| System | Install dir | -| ----------------------- | -------------------------------------- | -| All types of Linux | /opt/voc | -| BSD (including Darwin) | /usr/local/share/voc | -| Termux (android) | /data/data/com.termux/files/opt/voc | | +### Build using mingw under cygwin + +### Build using Microsft C + + + +#### Installation directories: + +If it succeeds the makefile will end with instructions on how to set your path variable so that the +compiler (voc) is found. + +The installation will be found at: + +| Built with | Install dir | +| --------------- | -------------------------------------- | +| cygwin | /opt/voc | +| cygwin + mingw | %PROGRAMFILES%/voc | +| MSC | %PROGRAMFILES%/voc | The installation directory contains: